Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 inupdateImage
where the icon was loaded usinggetIconByName
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 intogetIconPixbuf
.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)