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

Fix incorrect tray icon scaling #1190

Merged
merged 1 commit into from
Aug 1, 2021
Merged

Fix incorrect tray icon scaling #1190

merged 1 commit into from
Aug 1, 2021

Conversation

mswiger
Copy link
Contributor

@mswiger mswiger commented Aug 1, 2021

This PR fixes #1175 and refactors the code around updating the image to separate fetching the correct pixmap and scaling the pixmap.

The root cause of #1175 is that for certain icons, such as the network manager wireless signal icons, the requested icon size may not be available (the network manager applet only supplies a 22x22 pixel version of the wireless signal icon). There is some logic in updateImage for proportionally scaling the icon pixbuf if it did not match the requested icon size. However, the code branch in updateImage where the icon was loaded using getIconByName did not apply this resize logic, resulting in situations where, e.g., the pixbuf is too small.

In this PR, updateImage has been updated to apply the logic for proportionally resizing the icon pixbuf to all pixbufs. Additionally, the logic for fetching the correct pixbuf for a given item has been factored out into getIconPixbuf.

Side note, it does appear that the network manager applet supplies "symbolic" SVG icons, which are scalable monochrome icons, but it's not clear to me how to use these symbolic icons in the Waybar tray module.

Screenshot (2.0 scale factor)

screenshot

@Alexays
Copy link
Owner

Alexays commented Aug 1, 2021

LGTM

@Alexays Alexays merged commit 9aec6bb into Alexays:master Aug 1, 2021
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.

Tray icons with incorrect size on fractionally scaled output
2 participants