[Desktop Theme KCM] "Normalize" margin around background in previews
ClosedPublic

Authored by kossebau on Mar 14 2019, 5:45 AM.

Details

Summary

Instead of a hard-coded hack for a single theme ("Air") to deal with themes
with large margins, having a generic hack based on heuristics makes
non-default themes look better in the preview.
Not using "widgets/panel-background" for "Air" also results in a better
preview for Air.

Diff Detail

Repository
R119 Plasma Desktop
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
kossebau created this revision.Mar 14 2019, 5:45 AM
Restricted Application added a project: Plasma. · View Herald TranscriptMar 14 2019, 5:45 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
kossebau requested review of this revision.Mar 14 2019, 5:45 AM
kossebau added a comment.EditedMar 14 2019, 5:49 AM

The hack for "Air" was especially annoying as it fails for themes inheriting "Air" and reusing the widget background, like "Air openSUSE"
Before:


After:
(updated to latest code)
Looks in average better IMHO, and makes things more comparaible, unless one is out to know the transparent margin size perhaps.
Something still strange with "openSUSE dark", but that might be an issue with the theme itself. Or elsewehere, as if one changes the icon theme while kcmshell desktoptheme is running, on the update of the view it suddenly also has normalized margins...

kossebau updated this revision to Diff 53856.Mar 14 2019, 5:58 AM

On a second look, of course the normalized margins should be also used for
the content shown in the widget

+1 Since there is no "proper" way I think this is fine and also looks a lot better than the previous Kraut und Rüben.

kossebau added a comment.EditedMar 14 2019, 1:21 PM

Seems the broken openSUSEdark display was due to cached rendered pixmaps, at least I can no longer reproduce it. So for completeness, and to celebrate the initial recovery of good old Fluffy Bunny theme, here another After (beware, can harm sensitive eyes):

ngraham accepted this revision as: VDG.Mar 14 2019, 2:04 PM
ngraham added a subscriber: ngraham.

This visual change makes sense to me, +1.

kossebau updated this revision to Diff 53938.Mar 15 2019, 6:44 AM

Clip the background to not overrun the item border and thus also the
selection/highlight markup

Hit & found thanks to fluffy themes :)

ngraham accepted this revision.Mar 15 2019, 5:23 PM

Let's ship Plasma Bunny by default! /s

This revision is now accepted and ready to land.Mar 15 2019, 5:23 PM

Personally I would consider this a bug fix and apply to 5.12. I always thought the openSUSE themes are broken just by their preview being so messy. It's a simple fix with no side-effects by what I can tell.
What do you think?

No objection!


Seems it does break things here (both with and without Qt scaling :/)

Seems it does break things here (both with and without Qt scaling :/)

Could you retry with cleaned Plasma cache? As discussed before, I saw this with openSUSE dark as well, but since it disappeared and all the time I messed around with fluffy themes, I have not seen any new breakage of that kind.


Seems it does break things here (both with and without Qt scaling :/)

@broulik Any chance you could retry soon, with caches cleaned before? For me any such misrenderings disappeared and have not come back since I cleaned the cache. Also would I have no explanation code-wise why that would happen (though also no idea how the caching works, ideally that would not happen at all).

Also happy to have somebody else try this :)


Seems it does break things here (both with and without Qt scaling :/)

I could reproduce this now by accident while juggling with my patches. Turns out this is another case where D19743 will fix things, as this ensures the correct current margins are used.
So would be great if someone could have a look at that one. And also means, this patch here is then only Plasma master/5.16 material...

This revision was automatically updated to reflect the committed changes.