Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Icons available through QML Icon Themes #115

Open
jarolrod opened this issue May 11, 2022 · 3 comments
Open

Make Icons available through QML Icon Themes #115

jarolrod opened this issue May 11, 2022 · 3 comments
Labels
Build system enhancement New feature or request

Comments

@jarolrod
Copy link
Member

Currently, with the way our Image Provider is set up, every Icon will need an entry under
1.Makefile.qt.include

QML_RES_ICONS = \
  qml/res/icons/sun.png\
  ...

2.bitcoin_qml.qrc

 <qresource prefix="/icons">
        ...
        <file alias="sun">res/icons/sun.png</file>

3.imageprovider.cpp

if (id == "sun") {
        *size = requested_size;
        return QIcon(":/icons/sun").pixmap(requested_size);
}

Then access to the Icon will require explicitly stating its URL, for example: icon.source: "image://images/sun"

We should instead make use of QML's Icon Themes. Instead of maintaining all these different entries in order to serve one icon, we could have an index.theme file which lists all entries. Then Icons are available by name, for example: icon.name: "sun"

Useful skills:

Qt5/6, QML

Want to work on this issue?

For guidance on contributing, please read CONTRIBUTING.md before opening your pull request.

@shaavan
Copy link
Contributor

shaavan commented May 13, 2022

Let me try giving it a shot!

@jarolrod
Copy link
Member Author

@promag do you think this is better than the imageprovider we use?

@jarolrod jarolrod added enhancement New feature or request Build system labels Sep 25, 2024
@jarolrod
Copy link
Member Author

TODO when migration to cmake and QT6 is done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build system enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants