Skip to content

Commit

Permalink
Allow picking any System (Kirigami.Theme) color
Browse files Browse the repository at this point in the history
  • Loading branch information
luisbocanegra committed Apr 1, 2024
1 parent a8938be commit 60df439
Show file tree
Hide file tree
Showing 7 changed files with 240 additions and 14 deletions.
25 changes: 25 additions & 0 deletions package/contents/config/main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@
type="Int">
<default>0</default>
</entry>
<entry
name="colorModeThemeVariant"
type="Int">
<default>0</default>
</entry>
<entry
name="singleColor"
type="String">
Expand Down Expand Up @@ -97,6 +102,11 @@
type="Int">
<default>1</default>
</entry>
<entry
name="widgetOutlineColorModeThemeVariant"
type="Int">
<default>0</default>
</entry>
<entry
name="widgetOutlineOpacity"
type="Double">
Expand Down Expand Up @@ -175,6 +185,11 @@
type="Int">
<default>0</default>
</entry>
<entry
name="fgColorModeThemeVariant"
type="Int">
<default>0</default>
</entry>
<entry
name="fgSingleColor"
type="String">
Expand Down Expand Up @@ -271,6 +286,11 @@
type="Int">
<default>2</default>
</entry>
<entry
name="panelBgColorModeThemeVariant"
type="Int">
<default>0</default>
</entry>
<entry
name="hideRealPanelBg"
type="Bool">
Expand Down Expand Up @@ -311,6 +331,11 @@
type="Int">
<default>1</default>
</entry>
<entry
name="panelOutlineColorModeThemeVariant"
type="Int">
<default>0</default>
</entry>
<entry
name="panelOutlineWidth"
type="Int">
Expand Down
35 changes: 32 additions & 3 deletions package/contents/ui/configForeground.qml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ KCM.SimpleKCM {
property int cfg_fgMode: plasmoid.configuration.fgMode
property int cfg_fgColorMode: plasmoid.configuration.fgColorMode
property alias cfg_fgColorModeTheme: fgColorModeTheme.currentIndex
property alias cfg_fgColorModeThemeVariant: fgColorModeThemeVariant.currentIndex
property string cfg_fgSingleColor: fgSingleColor.color
property string cfg_fgCustomColors: fgCustomColors.text

Expand Down Expand Up @@ -222,7 +223,7 @@ KCM.SimpleKCM {
// RowLayout {
RadioButton {
id: fgSingleColorRadio
Kirigami.FormData.label: i18n("Color:")
Kirigami.FormData.label: i18n("Source:")
text: i18n("Custom")
ButtonGroup.group: colorModeGroup
property int index: 0
Expand Down Expand Up @@ -287,12 +288,40 @@ KCM.SimpleKCM {

ComboBox {
id: fgColorModeTheme
model: [i18n("Accent"), i18n("Text"), i18n("Background")]
Kirigami.FormData.label: i18n("Color:")
model: [
i18n("Text"),
i18n("Disabled Text"),
i18n("Highlighted Text"),
i18n("Active Text"),
i18n("Link"),
i18n("Visited Link"),
i18n("Negative Text"),
i18n("Neutral Text"),
i18n("Positive Text"),
i18n("Background"),
i18n("Highlight"),
i18n("Active Background"),
i18n("Link Background"),
i18n("Visited Link Background"),
i18n("Negative Background"),
i18n("Neutral Background"),
i18n("Positive Background"),
i18n("Alternate Background"),
i18n("Focus"),
i18n("Hover")
]
visible: accentColorRadio.checked
}

ComboBox {
id: fgColorModeThemeVariant
Kirigami.FormData.label: i18n("Color set:")
model: [i18n("View"), i18n("Window"), i18n("Button"), i18n("Selection"), i18n("Tooltip"), i18n("Complementary"), i18n("Header")]
visible: accentColorRadio.checked
}

GroupBox {
Kirigami.FormData.label: i18n("Colors list:")
visible: listColorRadio.checked
ColumnLayout {
Layout.alignment: Qt.AlignTop
Expand Down
5 changes: 5 additions & 0 deletions package/contents/ui/configGeneral.qml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ KCM.SimpleKCM {
property int cfg_fgShadowY
property int cfg_fgShadowRadius
property bool cfg_fixCustomBadges
property int cfg_colorModeThemeVariant
property int cfg_widgetOutlineColorModeThemeVariant
property int cfg_fgColorModeThemeVariant
property int cfg_panelBgColorModeThemeVariant
property int cfg_panelOutlineColorModeThemeVariant

Connections {
target: plasmoid.configuration
Expand Down
25 changes: 23 additions & 2 deletions package/contents/ui/configPanelBg.qml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ KCM.SimpleKCM {
property bool cfg_panelBgEnabled: panelBgEnabled.checked
property int cfg_panelBgColorMode: plasmoid.configuration.panelBgColorMode
property alias cfg_panelBgColorModeTheme: colorModeTheme.currentIndex
property alias cfg_panelBgcolorModeThemeVariant: colorModeThemeVariant.currentIndex
property string cfg_panelBgColor: panelBgColor.color
property bool cfg_hideRealPanelBg: hideRealPanelBg.checked
property real cfg_panelBgOpacity: parseFloat(panelBgOpacity.text)
Expand All @@ -21,6 +22,7 @@ KCM.SimpleKCM {

property int cfg_panelOutlineColorMode: plasmoid.configuration.panelOutlineColorMode
property alias cfg_panelOutlineColorModeTheme: panelOutlineColorModeTheme.currentIndex
property alias cfg_panelOutlineColorModeThemeVariant: panelOutlineColorModeThemeVariant.currentIndex
property string cfg_panelOutlineColor: panelOutlineColor.color
property int cfg_panelOutlineWidth: panelOutlineWidth.value
property real cfg_panelOutlineOpacity: panelOutlineOpacity.text
Expand Down Expand Up @@ -149,7 +151,7 @@ KCM.SimpleKCM {
}

RadioButton {
Kirigami.FormData.label: i18n("Color:")
Kirigami.FormData.label: i18n("Color source:")
text: i18n("Custom")
id: singleColorRadio
ButtonGroup.group: colorModeGroup
Expand Down Expand Up @@ -190,11 +192,20 @@ KCM.SimpleKCM {

ComboBox {
id: colorModeTheme
Kirigami.FormData.label: i18n("Color:")
model: [i18n("Accent"), i18n("Text"), i18n("Background")]
visible: accentColorRadio.checked
enabled: panelBgEnabled.checked
}

ComboBox {
id: colorModeThemeVariant
Kirigami.FormData.label: i18n("Color set:")
model: [i18n("View"), i18n("Window"), i18n("Button"), i18n("Selection"), i18n("Tooltip"), i18n("Complementary"), i18n("Header")]
visible: accentColorRadio.checked
enabled: panelBgEnabled.checked
}

RowLayout {
Kirigami.FormData.label: i18n("Opacity:")
TextField {
Expand Down Expand Up @@ -254,7 +265,7 @@ KCM.SimpleKCM {
}

RadioButton {
Kirigami.FormData.label: i18n("Color:")
Kirigami.FormData.label: i18n("Color source:")
text: i18n("Custom")
id: singleOutlineColorRadio
ButtonGroup.group: outlineColorModeGroup
Expand Down Expand Up @@ -295,11 +306,21 @@ KCM.SimpleKCM {

ComboBox {
id: panelOutlineColorModeTheme
Kirigami.FormData.label: i18n("Color:")
model: [i18n("Accent"), i18n("Text"), i18n("Background")]
visible: accentOutlineColorRadio.checked
enabled: panelBgEnabled.checked
}

ComboBox {
id: panelOutlineColorModeThemeVariant
Kirigami.FormData.label: i18n("Color set:")
model: [i18n("View"), i18n("Window"), i18n("Button"), i18n("Selection"), i18n("Tooltip"), i18n("Complementary"), i18n("Header")]
visible: accentOutlineColorRadio.checked
enabled: panelBgEnabled.checked
}


RowLayout {
Kirigami.FormData.label: i18n("Opacity:")
TextField {
Expand Down
68 changes: 64 additions & 4 deletions package/contents/ui/configWidgetBg.qml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ KCM.SimpleKCM {
property int cfg_mode: plasmoid.configuration.mode
property int cfg_colorMode: plasmoid.configuration.colorMode
property alias cfg_colorModeTheme: colorModeTheme.currentIndex
property alias cfg_colorModeThemeVariant: colorModeThemeVariant.currentIndex
property string cfg_singleColor: singleColor.color
property string cfg_customColors: customColors.text

Expand All @@ -31,6 +32,7 @@ KCM.SimpleKCM {

property int cfg_widgetOutlineColorMode: plasmoid.configuration.widgetOutlineColorMode
property alias cfg_widgetOutlineColorModeTheme: widgetOutlineColorModeTheme.currentIndex
property alias cfg_widgetOutlineColorModeThemeVariant: widgetOutlineColorModeThemeVariant.currentIndex
property string cfg_widgetOutlineColor: widgetOutlineColor.color
property real cfg_widgetOutlineOpacity: widgetOutlineOpacity.text
property int cfg_widgetOutlineWidth: widgetOutlineWidth.value
Expand Down Expand Up @@ -270,7 +272,7 @@ KCM.SimpleKCM {

// RowLayout {
RadioButton {
Kirigami.FormData.label: i18n("Color:")
Kirigami.FormData.label: i18n("Source:")
text: i18n("Custom")
id: singleColorRadio
ButtonGroup.group: colorModeGroup
Expand Down Expand Up @@ -329,7 +331,36 @@ KCM.SimpleKCM {

ComboBox {
id: colorModeTheme
model: [i18n("Accent"), i18n("Text"), i18n("Background")]
Kirigami.FormData.label: i18n("Color:")
model: [
i18n("Text"),
i18n("Disabled Text"),
i18n("Highlighted Text"),
i18n("Active Text"),
i18n("Link"),
i18n("Visited Link"),
i18n("Negative Text"),
i18n("Neutral Text"),
i18n("Positive Text"),
i18n("Background"),
i18n("Highlight"),
i18n("Active Background"),
i18n("Link Background"),
i18n("Visited Link Background"),
i18n("Negative Background"),
i18n("Neutral Background"),
i18n("Positive Background"),
i18n("Alternate Background"),
i18n("Focus"),
i18n("Hover")
]
visible: accentColorRadio.checked
}

ComboBox {
id: colorModeThemeVariant
Kirigami.FormData.label: i18n("Color set:")
model: [i18n("View"), i18n("Window"), i18n("Button"), i18n("Selection"), i18n("Tooltip"), i18n("Complementary"), i18n("Header")]
visible: accentColorRadio.checked
}

Expand Down Expand Up @@ -685,7 +716,7 @@ KCM.SimpleKCM {
}

RadioButton {
Kirigami.FormData.label: i18n("Color:")
Kirigami.FormData.label: i18n("Color source:")
text: i18n("Custom")
id: singleOutlineColorRadio
ButtonGroup.group: outlineColorModeGroup
Expand Down Expand Up @@ -722,7 +753,36 @@ KCM.SimpleKCM {

ComboBox {
id: widgetOutlineColorModeTheme
model: [i18n("Accent"), i18n("Text"), i18n("Background")]
Kirigami.FormData.label: i18n("Color:")
model: [
i18n("Text"),
i18n("Disabled Text"),
i18n("Highlighted Text"),
i18n("Active Text"),
i18n("Link"),
i18n("Visited Link"),
i18n("Negative Text"),
i18n("Neutral Text"),
i18n("Positive Text"),
i18n("Background"),
i18n("Highlight"),
i18n("Active Background"),
i18n("Link Background"),
i18n("Visited Link Background"),
i18n("Negative Background"),
i18n("Neutral Background"),
i18n("Positive Background"),
i18n("Alternate Background"),
i18n("Focus"),
i18n("Hover")
]
visible: accentOutlineColorRadio.checked
}

ComboBox {
id: widgetOutlineColorModeThemeVariant
Kirigami.FormData.label: i18n("Color set:")
model: [i18n("View"), i18n("Window"), i18n("Button"), i18n("Selection"), i18n("Tooltip"), i18n("Complementary"), i18n("Header")]
visible: accentOutlineColorRadio.checked
}

Expand Down
34 changes: 32 additions & 2 deletions package/contents/ui/configWidgetBlacklist.qml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ KCM.SimpleKCM {
property bool cfg_fgBlacklistedColorEnabled: fgBlacklistedColorEnabled.checked
property int cfg_fgBlacklistedColorMode: plasmoid.configuration.fgBlacklistedColorMode
property alias cfg_fgBlacklistedColorModeTheme: fgBlacklistedColorModeTheme.currentIndex
property alias cfg_fgBlacklistedColorModeThemeVariant: fgBlacklistedColorModeThemeVariant.currentIndex
property string cfg_blacklistedFgColor: blacklistedFgColor.color

property string cfg_blacklist: ""
Expand Down Expand Up @@ -100,7 +101,7 @@ KCM.SimpleKCM {
}

RadioButton {
Kirigami.FormData.label: i18n("Color:")
Kirigami.FormData.label: i18n("Source:")
text: i18n("Custom")
id: fgsingleColorRadio
ButtonGroup.group: fgcolorModeGroup
Expand Down Expand Up @@ -138,7 +139,36 @@ KCM.SimpleKCM {

ComboBox {
id: fgBlacklistedColorModeTheme
model: [i18n("Accent"), i18n("Text"), i18n("Background")]
Kirigami.FormData.label: i18n("Color:")
model: [
i18n("Text"),
i18n("Disabled Text"),
i18n("Highlighted Text"),
i18n("Active Text"),
i18n("Link"),
i18n("Visited Link"),
i18n("Negative Text"),
i18n("Neutral Text"),
i18n("Positive Text"),
i18n("Background"),
i18n("Highlight"),
i18n("Active Background"),
i18n("Link Background"),
i18n("Visited Link Background"),
i18n("Negative Background"),
i18n("Neutral Background"),
i18n("Positive Background"),
i18n("Alternate Background"),
i18n("Focus"),
i18n("Hover")
]
visible: fgaccentColorRadio.checked
enabled: fgBlacklistedColorEnabled.checked
}
ComboBox {
id: fgBlacklistedColorModeThemeVariant
Kirigami.FormData.label: i18n("Color set:")
model: [i18n("View"), i18n("Window"), i18n("Button"), i18n("Selection"), i18n("Tooltip"), i18n("Complementary"), i18n("Header")]
visible: fgaccentColorRadio.checked
enabled: fgBlacklistedColorEnabled.checked
}
Expand Down
Loading

0 comments on commit 60df439

Please sign in to comment.