The icon function did not take into account the fact that icons have limited size options available.
Also take into account scale parameter.
Details
- Reviewers
davidedmundson zzag - Group Reviewers
KWin - Commits
- R130:8339cba19e9a: [KWindowSystem] in icon() return realistic icon size
Diff Detail
- Repository
- R130 Frameworks integration plugin using KWayland
- Branch
- master
- Lint
No Linters Available - Unit
No Unit Test Coverage - Build Status
Buildable 17736 Build 17754: arc lint + arc unit
@ngraham In Wayland this allows the Tooltips from the taskmanager to display centered icon for wayland windows.
src/windowsystem/windowsystem.cpp | ||
---|---|---|
188 | You forgot to assign the copied pixmap to something. However, I think you could just return it from this point. |
src/windowsystem/windowsystem.cpp | ||
---|---|---|
188 | edit: scaled pixmap |
src/windowsystem/windowsystem.cpp | ||
---|---|---|
173 | what's the logic behind the numbers 40, 56, 96 ans 192? |
src/windowsystem/windowsystem.cpp | ||
---|---|---|
173 | It was copied from kwindowsystem/src/platforms/xcb/kwindowsytem.cpp |
src/windowsystem/windowsystem.cpp | ||
---|---|---|
173 | I can't explain the current logic. @mart Do you think I should change the logic to give it more sense ? Perhaps make the 24, 40.. values match the iconWidth i.e : if (width <= 16){ iconWidth = 16; else if (width <= 32) iconWidth = 32 else if (width <= 48){ iconWidth = 48 ... |
src/windowsystem/windowsystem.cpp | ||
---|---|---|
173 | @anthonyfieroni Hey Anthony |
src/windowsystem/windowsystem.cpp | ||
---|---|---|
173 | That's adjustment, 16, 32, 48, 64, 128, 256 are standard icon sizes, when you got a value between 2 sizes you adjust it by lower bound. Say (256 - 128) / 2 = 64, so 128 + 64 = 192, when request is smaller than 192 and bigger than 96 (which is same calculated for previous values) it returns 128. If you want write an algorithm for that. |
src/windowsystem/windowsystem.cpp | ||
---|---|---|
173 | Thank you @anthonyfieroni for the explanation
I don't think more comment is necessary. |