Changeset View
Changeset View
Standalone View
Standalone View
kcmkwin/kwindecoration/package/contents/ui/main.qml
Show All 19 Lines | |||||
20 | import QtQuick.Layouts 1.3 | 20 | import QtQuick.Layouts 1.3 | ||
21 | import QtQuick.Controls 2.4 as Controls | 21 | import QtQuick.Controls 2.4 as Controls | ||
22 | import org.kde.kcm 1.1 as KCM | 22 | import org.kde.kcm 1.1 as KCM | ||
23 | import org.kde.kconfig 1.0 // for KAuthorized | 23 | import org.kde.kconfig 1.0 // for KAuthorized | ||
24 | import org.kde.kirigami 2.4 as Kirigami | 24 | import org.kde.kirigami 2.4 as Kirigami | ||
25 | 25 | | |||
26 | Kirigami.Page { | 26 | Kirigami.Page { | ||
27 | KCM.ConfigModule.quickHelp: i18n("This module lets you configure the window decorations.") | 27 | KCM.ConfigModule.quickHelp: i18n("This module lets you configure the window decorations.") | ||
28 | KCM.ConfigModule.buttons: KCM.ConfigModule.Help | KCM.ConfigModule.Default | KCM.ConfigModule.Apply | | |||
29 | title: kcm.name | 28 | title: kcm.name | ||
30 | 29 | | |||
31 | SystemPalette { | 30 | SystemPalette { | ||
32 | id: palette | 31 | id: palette | ||
33 | colorGroup: SystemPalette.Active | 32 | colorGroup: SystemPalette.Active | ||
34 | } | 33 | } | ||
35 | 34 | | |||
36 | // To match SimpleKCM's borders of Page + headerParent/footerParent (also specified in raw pixels) | 35 | // To match SimpleKCM's borders of Page + headerParent/footerParent (also specified in raw pixels) | ||
Show All 37 Lines | 72 | StackLayout { | |||
74 | anchors.fill: parent | 73 | anchors.fill: parent | ||
75 | 74 | | |||
76 | currentIndex: tabBar.currentIndex | 75 | currentIndex: tabBar.currentIndex | ||
77 | 76 | | |||
78 | ColumnLayout { | 77 | ColumnLayout { | ||
79 | Themes { | 78 | Themes { | ||
80 | Layout.fillWidth: true | 79 | Layout.fillWidth: true | ||
81 | Layout.fillHeight: true | 80 | Layout.fillHeight: true | ||
81 | enabled: !kcm.settings.isImmutable("pluginName") && !kcm.settings.isImmutable("theme") | ||||
82 | } | 82 | } | ||
83 | 83 | | |||
84 | RowLayout { | 84 | RowLayout { | ||
85 | Controls.CheckBox { | 85 | Controls.CheckBox { | ||
86 | id: borderSizeAutoCheckbox | 86 | id: borderSizeAutoCheckbox | ||
87 | // Let it elide but don't make it push the ComboBox away from it | 87 | // Let it elide but don't make it push the ComboBox away from it | ||
88 | Layout.fillWidth: true | 88 | Layout.fillWidth: true | ||
89 | Layout.maximumWidth: implicitWidth | 89 | Layout.maximumWidth: implicitWidth | ||
90 | text: i18nc("checkbox label", "Use theme's default window border size") | 90 | text: i18nc("checkbox label", "Use theme's default window border size") | ||
91 | checked: kcm.borderSizeAuto | 91 | enabled: !kcm.settings.isImmutable("borderSizeAuto") | ||
92 | onCheckedChanged: { | 92 | checked: kcm.settings.borderSizeAuto | ||
93 | kcm.borderSizeAuto = checked; | 93 | onToggled: { | ||
94 | kcm.settings.borderSizeAuto = checked; | ||||
94 | borderSizeComboBox.autoBorderUpdate() | 95 | borderSizeComboBox.autoBorderUpdate() | ||
95 | } | 96 | } | ||
96 | } | 97 | } | ||
97 | Controls.ComboBox { | 98 | Controls.ComboBox { | ||
98 | id: borderSizeComboBox | 99 | id: borderSizeComboBox | ||
99 | enabled: !borderSizeAutoCheckbox.checked | 100 | enabled: !borderSizeAutoCheckbox.checked && !kcm.settings.isImmutable("borderSize") | ||
100 | model: kcm.borderSizesModel | 101 | model: kcm.borderSizesModel | ||
102 | currentIndex: kcm.borderSize | ||||
101 | onActivated: { | 103 | onActivated: { | ||
102 | kcm.borderSize = currentIndex | 104 | kcm.borderSize = currentIndex | ||
103 | } | 105 | } | ||
104 | function autoBorderUpdate() { | 106 | function autoBorderUpdate() { | ||
105 | if (borderSizeAutoCheckbox.checked) { | 107 | if (borderSizeAutoCheckbox.checked) { | ||
106 | currentIndex = kcm.recommendedBorderSize | 108 | kcm.borderSize = kcm.recommendedBorderSize | ||
107 | } else { | | |||
108 | currentIndex = kcm.borderSize | | |||
109 | } | 109 | } | ||
110 | } | 110 | } | ||
111 | 111 | | |||
112 | Connections { | 112 | Connections { | ||
113 | target: kcm | 113 | target: kcm | ||
114 | onThemeChanged: borderSizeComboBox.autoBorderUpdate() | 114 | onThemeChanged: borderSizeComboBox.autoBorderUpdate() | ||
115 | } | 115 | } | ||
116 | } | 116 | } | ||
117 | Item { | 117 | Item { | ||
118 | Layout.fillWidth: true | 118 | Layout.fillWidth: true | ||
119 | } | 119 | } | ||
120 | Controls.Button { | 120 | Controls.Button { | ||
121 | text: i18nc("button text", "Get New Window Decorations...") | 121 | text: i18nc("button text", "Get New Window Decorations...") | ||
122 | icon.name: "get-hot-new-stuff" | 122 | icon.name: "get-hot-new-stuff" | ||
123 | onClicked: kcm.getNewStuff(this) | 123 | onClicked: kcm.getNewStuff(this) | ||
124 | visible: KAuthorized.authorize("ghns") | 124 | visible: KAuthorized.authorize("ghns") | ||
125 | } | 125 | } | ||
126 | } | 126 | } | ||
127 | } | 127 | } | ||
128 | 128 | | |||
129 | ColumnLayout { | 129 | ColumnLayout { | ||
130 | Buttons { | 130 | Buttons { | ||
131 | Layout.fillWidth: true | 131 | Layout.fillWidth: true | ||
132 | Layout.fillHeight: true | 132 | Layout.fillHeight: true | ||
133 | enabled: !kcm.settings.isImmutable("buttonsOnLeft") && !kcm.settings.isImmutable("buttonsOnRight") | ||||
133 | } | 134 | } | ||
134 | 135 | | |||
135 | Controls.CheckBox { | 136 | Controls.CheckBox { | ||
136 | id: closeOnDoubleClickOnMenuCheckBox | 137 | id: closeOnDoubleClickOnMenuCheckBox | ||
137 | text: i18nc("checkbox label", "Close windows by double clicking the menu button") | 138 | text: i18nc("checkbox label", "Close windows by double clicking the menu button") | ||
138 | checked: kcm.closeOnDoubleClickOnMenu | 139 | enabled: !kcm.settings.isImmutable("closeOnDoubleClickOnMenu") | ||
140 | checked: kcm.settings.closeOnDoubleClickOnMenu | ||||
139 | onToggled: { | 141 | onToggled: { | ||
140 | kcm.closeOnDoubleClickOnMenu = checked | 142 | kcm.settings.closeOnDoubleClickOnMenu = checked | ||
141 | infoLabel.visible = checked | 143 | infoLabel.visible = checked | ||
142 | } | 144 | } | ||
143 | } | 145 | } | ||
144 | 146 | | |||
145 | Kirigami.InlineMessage { | 147 | Kirigami.InlineMessage { | ||
146 | Layout.fillWidth: true | 148 | Layout.fillWidth: true | ||
147 | id: infoLabel | 149 | id: infoLabel | ||
148 | type: Kirigami.MessageType.Information | 150 | type: Kirigami.MessageType.Information | ||
149 | text: i18nc("popup tip", "Close by double clicking: Keep the window's Menu button pressed until it appears.") | 151 | text: i18nc("popup tip", "Close by double clicking: Keep the window's Menu button pressed until it appears.") | ||
150 | showCloseButton: true | 152 | showCloseButton: true | ||
151 | visible: false | 153 | visible: false | ||
152 | } | 154 | } | ||
153 | 155 | | |||
154 | Controls.CheckBox { | 156 | Controls.CheckBox { | ||
155 | id: showToolTipsCheckBox | 157 | id: showToolTipsCheckBox | ||
156 | text: i18nc("checkbox label", "Show titlebar button tooltips") | 158 | text: i18nc("checkbox label", "Show titlebar button tooltips") | ||
157 | checked: kcm.showToolTips | 159 | enabled: !kcm.settings.isImmutable("showToolTips") | ||
158 | onToggled: kcm.showToolTips = checked | 160 | checked: kcm.settings.showToolTips | ||
161 | onToggled: kcm.settings.showToolTips = checked | ||||
159 | } | 162 | } | ||
160 | } | 163 | } | ||
161 | } | 164 | } | ||
162 | } | 165 | } | ||
163 | } | 166 | } | ||
164 | } | 167 | } |