Some icons can be recolored. However if the titlebar color is different
compared to the normal color scheme, this can lead to bad contrast.
Details
- Reviewers
ngraham - Group Reviewers
Plasma VDG - Commits
- R31:a1e1a53f3b73: Color icons in titlebar if possible
Before:
After:
Diff Detail
- Repository
- R31 Breeze
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
kdecoration/breezebutton.cpp | ||
---|---|---|
148 | Is there a chance the cast could fail? |
kdecoration/breezebutton.cpp | ||
---|---|---|
148 | I don't think it can fail. decoration() is a QPointer (https://api.kde.org/kdecoration/html/classKDecoration2_1_1DecorationButton.html) do you mean that with cross-cast? |
With cross-casting I meant the type of cast where the types involved are not in same inheritance branch
kdecoration/breezebutton.cpp | ||
---|---|---|
147–160 | Assumes there is no other custom palette set before we set ours here. Does that assumption hold? Or could KWin & Co do mess with that palette as well? | |
148 | Looking at the rest of the code, it always tests for decoration() resolving to an existing Decoration pointer. Now, Button::paint(...) already has half the check ealier, by the if (!decoration()) return; But this does not ensure we have a Breeze::Decoration type. And QPointer only ensures that the pointer is updated if the object is deleted elsewhere. It still can be nullptr, and possibly this is done here as the decoration object is not owned by us, so something might delete it behind the button's back. So IMHO this logic might need another check by someone who can tell if the right type can be still assumed (which ideally then should be reflected in the API, so it is clear no other type could be present. |
kdecoration/breezebutton.cpp | ||
---|---|---|
147–160 | I will look into it |
kdecoration/breezebutton.cpp | ||
---|---|---|
153 | KWin doesn't change the palette, it uses to global one to draw the icons for example when you right click on a window titlebar. |