Replace manual palette adjustment with background role (fullscreen info label)
ClosedPublic

Authored by huoni on Feb 23 2018, 10:30 PM.

Details

Summary

Instead of customising the palette, then monitoring for changes, we set the background color role of the widget.

This has the benefit of keeping the palette inherited, therefore changes to the system palette still propogate. Not to mention we don't need to watch for palette change events.

Test Plan

The information label in fullscreen (where the filename is displayed) should not significantly change color. A slight change is expected as we are not manually setting it but using a pre-determined role.

Diff Detail

Repository
R260 Gwenview
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
huoni requested review of this revision.Feb 23 2018, 10:30 PM
huoni created this revision.

Yay, cleaning up is an important part in keeping the code healthy.

Still I wonder what this code did in the past. Applying this patch to the stable branch (which does not have 543f0b9cc958), I cannot find any breakage, while you say I should. GammaRay and mInformationLabel->setObjectName("mInformationLabel") tell me that this would affect the label that displays the filename in the fullscreen top bar.

I tend to land this, but will first wait for your comment so we don't cause any accidental breakage.


Not related to this patch, but when testing I found an interesting bug: Open Gwenview, externally change colour scheme (Gwenview adapts), press F11 twice: Gwenview forgets the new colour scheme (a restart will fix this, of course). I wouldn't worry too much about it for now, though.

huoni added a comment.EditedFeb 26 2018, 1:39 AM

@rkflx Hmm you're right, I mixed things up here. The removed code affects mInformationLabel, not mThumbnailBar which is where we apply the stylesheet.

I took screenshots to compare, and this actually does have an effect, it darkens the information label ever so slightly.

I suppose the question is whether that slight change is necessary, or we can simply bin this revision.


EDIT: I've updated this to replace it with the background role

huoni updated this revision to Diff 28081.Feb 26 2018, 3:06 AM
  • Replace with background role adjustment
huoni retitled this revision from Remove palette code for fullscreen bar now we use stylesheets to Replace manualy palette adjustment with background role.Feb 26 2018, 3:07 AM
huoni edited the summary of this revision. (Show Details)
huoni edited the test plan for this revision. (Show Details)
huoni retitled this revision from Replace manualy palette adjustment with background role to Replace manual palette adjustment with background role (fullscreen info label).Feb 26 2018, 3:11 AM
huoni edited the summary of this revision. (Show Details)
huoni edited the test plan for this revision. (Show Details)
rkflx accepted this revision.Feb 26 2018, 10:32 PM

Now the patch slightly changed its personality, but I like it ;) No issues found.

Landing this in a moment, but could you look for more places which can be changed similarly? Considerations:

  • Any other places currently using dark()or light()?
  • Should KUrlNavigator and crop toolbar have the same (darker) colour?
  • In fullscreen Browse mode, KUrlNavigator has a slightly different background than the buttons on its left and right. Bring it in line, or emphasize?
This revision is now accepted and ready to land.Feb 26 2018, 10:32 PM
This revision was automatically updated to reflect the committed changes.
huoni added a comment.Feb 27 2018, 2:40 AM
  • Any other places currently using dark()or light()?
  • Should KUrlNavigator and crop toolbar have the same (darker) colour?
  • In fullscreen Browse mode, KUrlNavigator has a slightly different background than the buttons on its left and right. Bring it in line, or emphasize?

D10880: Improve background color code for URL Navigator and adjacent fullscreen toolbars should sort out all these!