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
Branch
colorschemes (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 18742
Build 18760: arc lint + arc unit
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
130

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.Jan 24 2020, 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)Jan 24 2020, 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.Jan 25 2020, 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
126

typo causes a build failure

This revision now requires changes to proceed.Jan 25 2020, 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.Jan 25 2020, 12:26 PM
davidre marked an inline comment as done.

Fix typo

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