66
77import QtQuick 2.15
88import QtQuick.Controls 2.15
9- import QtQuick.Controls 1.4
109import QtQuick.Layouts 1.15
1110
1211import org.kde.kirigami 2.19 as Kirigami
@@ -15,8 +14,134 @@ import org.kde.plasma.plasmoid 2.0
1514import org.kde.kquickcontrols 2.0 as KQControls
1615
1716
17+ import "../libconfig" as LibConfig
1818
1919Kirigami .FormLayout {
20+ // Props
21+ property color cfg_buttonActiveColor
22+ property color cfg_buttonInctiveColor
23+ property color cfg_buttonMinimizedColor
24+ property color cfg_buttonAttentionColor
25+ property color cfg_buttonProgressColor
26+ property color cfg_buttonHoverColor
27+ property color cfg_indicatorActiveColor
28+ property color cfg_indicatorInctiveColor
29+ property color cfg_indicatorMinimizedColor
30+ property color cfg_indicatorAttentionColor
31+ property color cfg_indicatorProgressColor
32+ property color cfg_indicatorHoverColor
33+ // Auto Enabled
34+ property int cfg_buttonActiveColorAuto
35+ property int cfg_buttonInctiveColorAuto
36+ property int cfg_buttonMinimizedColorAuto
37+ property int cfg_buttonAttentionColorAuto
38+ property int cfg_buttonProgressColorAuto
39+ property int cfg_buttonHoverColorAuto
40+ property int cfg_indicatorActiveColorAuto
41+ property int cfg_indicatorInctiveColorAuto
42+ property int cfg_indicatorMinimizedColorAuto
43+ property int cfg_indicatorAttentionColorAuto
44+ property int cfg_indicatorProgressColorAuto
45+ property int cfg_indicatorHoverColorAuto
46+ // Auto methods
47+ property int cfg_buttonActiveColorMethod
48+ property int cfg_buttonInctiveColorMethod
49+ property int cfg_buttonMinimizedColorMethod
50+ property int cfg_buttonAttentionColorMethod
51+ property int cfg_buttonProgressColorMethod
52+ property int cfg_buttonHoverColorMethod
53+ property int cfg_indicatorActiveColorMethod
54+ property int cfg_indicatorInctiveColorMethod
55+ property int cfg_indicatorMinimizedColorMethod
56+ property int cfg_indicatorAttentionColorMethod
57+ property int cfg_indicatorProgressColorMethod
58+ property int cfg_indicatorHoverColorMethod
59+
60+ wideMode: false
61+ width: parent .width
2062 anchors .left : parent .left
2163 anchors .right : parent .right
64+ ColumnLayout{
65+ TabBar{
66+ TabButton {
67+ enabled: plasmoid .configuration .buttonColorize
68+ id: buttonTab
69+ text: i18n (" Button Colors" )
70+ }
71+ TabButton {
72+ enabled: plasmoid .configuration .indicatorsEnabled
73+ id: indicatorTab
74+ text: i18n (" Indicator Colors" )
75+ checked: ! plasmoid .configuration .buttonColorize && plasmoid .configuration .indicatorsEnabled
76+ }
77+ }
78+ Label{
79+ visible: ! plasmoid .configuration .buttonColorize && ! plasmoid .configuration .indicatorsEnabled
80+ text: i18n (" Enable Button Color Overlay or Indicators to be able to use this page." )
81+ }
82+ RowLayout{
83+ Label{
84+ text: i18n (" State" )
85+ }
86+ ComboBox {
87+ id: state
88+ model: [
89+ i18n (" Active" ),
90+ i18n (" Inactive" ),
91+ i18n (" Minimized" ),
92+ i18n (" Attention" ),
93+ i18n (" Progress" ),
94+ i18n (" Hover" )
95+ ]
96+ }
97+ }
98+ ColorSlider {
99+ id: colorSelector
100+ enabled: plasmoid .configuration .buttonColorize || plasmoid .configuration .indicatorsEnabled
101+ }
102+ }
103+ function buildColorSlider (){
104+ var autoHue
105+ var autoSat
106+ var autoLight
107+ var cfgKey = " cfg_"
108+ if (buttonTab .checked ){
109+ cfgKey += " button"
110+ }
111+ else if (indicatorTab .checked ){
112+ cfgKey += " indicator"
113+ }
114+ else {
115+ return // This should never be reached.
116+ }
117+ switch (state .currentIndex ){
118+ case 0 :
119+ cfgKey += " Active"
120+ break ;
121+ case 1 :
122+ cfgKey += " Inctive"
123+ break ;
124+ case 2 :
125+ cfgKey += " Minimized"
126+ break ;
127+ case 3 :
128+ cfgKey += " Attention"
129+ break ;
130+ case 4 :
131+ cfgKey += " Progress"
132+ break ;
133+ case 5 :
134+ cfgKey += " Hover"
135+ break ;
136+ }
137+
138+ }
139+ function
140+ Connections{
141+ target: buttonTab
142+ function onCheckedChanged {
143+
144+ }
145+ }
146+
22147}
0 commit comments