Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Increase visual distinction for disabled state
Depending on the palette, PhantomStyle might not always provide enough visual hints for disabled states. This commit tries to add some additional visual distinction. This commit changes two things: it decreases the outline contrast on disabled widgets, and removes the specular shading on disabled widgets. For the outline contrast, the Swatchy code which derives the outline color from the window color is changed to use a smaller contrast value when the QPalette's current color group is Disabled. Many clickable widgets, like push buttons, have an inner ring of highlighting which is called specular in the PhantomStyle code. This commit changes the colors used for these specular highlights to be the same as the colors that are underneath the highlights when the QPalette's current color group is Disabled, thus making the specular not visible. This means the painting operations for the specular roundrects and rectangles are still occurring. It would be more efficient to have code paths which don't draw the specular at all when a widget is disabled, but this would require adding a number of additional code paths in PhantomStyle in the widget drawing code, and I don't think that's worth it at the moment. It's probably worth revisiting if the Inactive state is ever changed to also not show the specular, because redraws on multiple widgets might occur when focusing and defocusing a window, and saving a few roundrect draws would be worth it, even though it would add more code.
- Loading branch information