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 sharp in HiDPI screen #932

Merged
merged 1 commit into from
Mar 6, 2019
Merged

Conversation

guoyunhe
Copy link
Contributor

@guoyunhe guoyunhe commented Mar 2, 2019

No description provided.

cola/app.py Outdated
@@ -178,6 +178,8 @@ def __init__(self, context, argv, locale=None,

self.context = context
self._install_hidpi_config()
# Make icons sharp in HiDPI screen
self._app.setAttribute(Qt.AA_UseHighDpiPixmaps, True)
Copy link
Member

@davvid davvid Mar 4, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense to be in the ColaQApplication constructor instead.

We still support PyQt4, so please check hasattr(Qt, 'AA_UseHighDpiPixmaps') before using it here.

This code probably doesn't work as written, and should be hitting a traceback -- self._app hasn't been assigned yet -- it's getting assigned on the line below.

Copy link
Member

@davvid davvid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please amend your commit with these fixes. High DPI icons should be really nice, thanks for the update.

@guoyunhe
Copy link
Contributor Author

guoyunhe commented Mar 4, 2019

I updated the code as you commented.

Before:

screenshot_20190304_092413

After:
screenshot_20190304_092512

System icons, like the settings icon (from Breeze theme) look pretty nice. But app's SVG icons are still not clear.

@guoyunhe
Copy link
Contributor Author

guoyunhe commented Mar 4, 2019

I think the SVG icons need some changes. x.svg is using 768x1024px sizes, which caused some scaling issue. If I change it to 22x22px, it becomes sharp:

image

Could I also modify all icons? Thanks!

@davvid
Copy link
Member

davvid commented Mar 6, 2019

Yes, please, that would be awesome.

davvid added a commit to davvid/git-cola that referenced this pull request Mar 6, 2019
* guoyunhe/patch-1:
  Make icons sharp in HiDPI screen

Signed-off-by: David Aguilar <davvid@gmail.com>
@davvid davvid merged commit b1b91fa into git-cola:master Mar 6, 2019
@davvid
Copy link
Member

davvid commented Mar 6, 2019

I've merged the current state as-is and speculatively updated the release notes to mention the upcoming updates to the icons. I'll merge make sure to merge that in asap. Thanks again

@guoyunhe guoyunhe deleted the patch-1 branch March 6, 2019 08:21
@davvid
Copy link
Member

davvid commented Mar 21, 2019

Can you share your updated x.svg? I tried doing the same by hand and it still looked blurry.

@guoyunhe
Copy link
Contributor Author

@davvid You can try this branch https://github.com/guoyunhe/git-cola/tree/make-icons-sharp

What I did is to change the size and view port of SVG files to 22x22px. Tested with @1.5 scale factor.

@davvid
Copy link
Member

davvid commented Mar 28, 2019

Thanks, I've now done this to all the icons, including the ones in the dark/ sub-directory. I couldn't find an easy way to get stuff in inkscape to align along integer px grid boundaries but if you know of any tips I'm all ears. Let me know if the icon updates look good to you. Thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants