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

Icons rendering on HighDPI displays #1244

Open
rgaudin opened this issue Nov 13, 2024 · 3 comments
Open

Icons rendering on HighDPI displays #1244

rgaudin opened this issue Nov 13, 2024 · 3 comments
Assignees
Milestone

Comments

@rgaudin
Copy link
Member

rgaudin commented Nov 13, 2024

Although we are using scalable (SVG) Icons, those are not rendered properly on HighDPI displays.
It's clearly visible on the Library tab icon which is the Kiwix bird

Image

There are a lot of topics about this online. It seems that it used to be complex, especially given DPR is per-display and an application can have a window in a HighDPI one and another window on a regular DPI one ; and there's the variations between the different systems and all.

I read that it should be transparent in Qt6 but I haven't tested that. If someone wants to send me qt6 build I'll gladly test.

On current Qt5, I could fix the Icon with just the following… but I'm pretty sure it make the icons ugly on regular DPI

diff --git i/src/kiwixapp.cpp w/src/kiwixapp.cpp
index ed29b52..f7477b0 100644
--- i/src/kiwixapp.cpp
+++ w/src/kiwixapp.cpp
@@ -492,6 +492,7 @@ void KiwixApp::handleItemsState(TabType tabType)
     auto libraryOrSettingsTab =  (tabType == TabType::LibraryTab || tabType == TabType::SettingsTab);
     auto notBookmarkableTab = libraryOrSettingsTab || getTabWidget()->currentArticleUrl().isEmpty();
     auto app = KiwixApp::instance();
+    app->setAttribute(Qt::AA_UseHighDpiPixmaps);
     app->getAction(KiwixApp::ToggleReadingListAction)->setDisabled(libraryOrSettingsTab);
     app->getAction(KiwixApp::ToggleAddBookmarkAction)->setDisabled(notBookmarkableTab);
     app->getAction(KiwixApp::FindInPageAction)->setDisabled(libraryOrSettingsTab);

Image

@rgaudin rgaudin added the bug label Nov 13, 2024
@kelson42
Copy link
Collaborator

kelson42 commented Nov 13, 2024

We will migrate to QT6 soon in milestone 2.5.0. Thx for the report, I will schedule the fix.

@BhargavMah
Copy link

I'm interested in assisting with this issue. Could you provide guidance on the best approach to ensure proper icon rendering across both HighDPI and standard DPI displays?

@kelson42
Copy link
Collaborator

@BhargavMah For the moment we migrate to Qt6 then we will see if the bug still occurs.

@kelson42 kelson42 self-assigned this Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants