Enable selecting all installed color schemes in Cuttlefish
ClosedPublic

Authored by davidre on Nov 12 2019, 3:00 PM.

Details

Summary

By using KColorSchemeManager we can enable viewing icons with all installed
color schemes. Also all the color setting everywhere can be dropped.

Test Plan

Diff Detail

Repository
R118 Plasma SDK
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
davidre created this revision.Nov 12 2019, 3:00 PM
Restricted Application added a project: Plasma. · View Herald TranscriptNov 12 2019, 3:00 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
davidre requested review of this revision.Nov 12 2019, 3:00 PM
davidre planned changes to this revision.Nov 12 2019, 3:01 PM
davidre edited the test plan for this revision. (Show Details)
davidre added a reviewer: Plasma.

I somehow broke it before uploading

davidre updated this revision to Diff 69639.Nov 12 2019, 3:08 PM

Was a typo

davidre edited the summary of this revision. (Show Details)Nov 12 2019, 3:09 PM
davidre added inline comments.Nov 12 2019, 3:43 PM
cuttlefish/src/main.cpp
145

Moving the setting of the context properties before loading of the file fixes these being unavailable at the beginning. => Less errors on startup and we can select the the current color scheme on startup because the index isn't reset when the color scheme model becomes available.

Nice, it's good to get rid of so much boilerplate.

However when I change the system's own color scheme from Breeze to anything else and start Cuttlefish, the app itself uses that color scheme as expected, but the combobox's text is blank:

Also, the combobox's model appears to have duplicates for Breeze, Breeze Dark, and Breeze Light, which (correctly) don't show up in the colors KCM for me:

Nice, it's good to get rid of so much boilerplate.

However when I change the system's own color scheme from Breeze to anything else and start Cuttlefish, the app itself uses that color scheme as expected, but the combobox's text is blank:

I see what's happening. I copied that code form Kate and it reads the current color scheme name from kdeglobals but there can be a difference between the stored name and the user visible name. Especially when it includes a space or hyphen. So it works correctly for Breeze or Oxygen but not Breeze Dark or Oxygen cold.

Also, the combobox's model appears to have duplicates for Breeze, Breeze Dark, and Breeze Light, which (correctly) don't show up in the colors KCM for me:

Since this directly uses KColorSchemeManager, do you also see duplicated entries in Kate's color scheme menu?

davidre updated this revision to Diff 69667.Nov 13 2019, 9:20 AM

Load initial color scheme name from the respective .colors file

Also, the combobox's model appears to have duplicates for Breeze, Breeze Dark, and Breeze Light, which (correctly) don't show up in the colors KCM for me:

I think I know what's happening. Do you have Breeze installed into the same prefix as cuttlefish in addition to system breeze? After doing so I also see the duplicate color. (The same happens in Kate)

Since this directly uses KColorSchemeManager, do you also see duplicated entries in Kate's color scheme menu?

Yep.

I think I know what's happening. Do you have Breeze installed into the same prefix as cuttlefish in addition to system breeze? After doing so I also see the duplicate color. (The same happens in Kate)

That's right.

davidre updated this revision to Diff 74332.Fri, Jan 24, 8:36 PM
  • remove default color scheme, system theme support in kcolorschememanager, also display icons
davidre edited the test plan for this revision. (Show Details)Fri, Jan 24, 8:37 PM

Ping since system theme support is now in frameworks and plasma master can depend on frameworks master

ngraham requested changes to this revision.Sat, Jan 25, 3:51 AM

Bad combobox width strikes again (https://bugs.kde.org/show_bug.cgi?id=403153), worsened by adding an icon:

Also, gross, there are duplicates

cuttlefish/src/main.cpp
139

typo causes a build failure

This revision now requires changes to proceed.Sat, Jan 25, 3:51 AM

Bad combobox width strikes again (https://bugs.kde.org/show_bug.cgi?id=403153), worsened by adding an icon:

Bah we should fix it finally if possible

Also, gross, there are duplicates

See above. Something to fix in KColorSchemeManager to not load the same theme twice if it has the same name as another one. (As the Colors KCM does)

davidre updated this revision to Diff 74358.Sat, Jan 25, 12:26 PM
davidre marked an inline comment as done.

Fix typo

ngraham accepted this revision.Mon, Jan 27, 4:56 AM
This revision is now accepted and ready to land.Mon, Jan 27, 4:56 AM
This revision was automatically updated to reflect the committed changes.