Changeset View
Changeset View
Standalone View
Standalone View
kcms/style/package/contents/ui/GtkStylePage.qml
Show All 18 Lines | |||||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | import QtQuick 2.7 | 21 | import QtQuick 2.7 | ||
22 | import QtQuick.Layouts 1.1 | 22 | import QtQuick.Layouts 1.1 | ||
23 | import QtQuick.Dialogs 1.0 as QtDialogs | 23 | import QtQuick.Dialogs 1.0 as QtDialogs | ||
24 | import QtQuick.Controls 2.10 as QtControls | 24 | import QtQuick.Controls 2.10 as QtControls | ||
25 | import org.kde.kirigami 2.10 as Kirigami | 25 | import org.kde.kirigami 2.10 as Kirigami | ||
26 | import org.kde.private.kcms.style 1.0 as Private | 26 | import org.kde.private.kcms.style 1.0 as Private | ||
27 | import org.kde.newstuff 1.62 as NewStuff | ||||
27 | import org.kde.kcm 1.2 as KCM | 28 | import org.kde.kcm 1.2 as KCM | ||
28 | 29 | | |||
29 | Kirigami.Page { | 30 | Kirigami.Page { | ||
30 | id: gtkStylePage | 31 | id: gtkStylePage | ||
31 | title: i18n("GNOME/GTK Application Style") | 32 | title: i18n("GNOME/GTK Application Style") | ||
32 | 33 | | |||
33 | ColumnLayout { | 34 | ColumnLayout { | ||
34 | anchors.fill: parent | 35 | anchors.fill: parent | ||
▲ Show 20 Lines • Show All 48 Lines • ▼ Show 20 Line(s) | 82 | QtControls.Button { | |||
83 | icon.name: "edit-delete" | 84 | icon.name: "edit-delete" | ||
84 | onClicked: gtk2ThemeCombo.model.removeSelectedTheme() | 85 | onClicked: gtk2ThemeCombo.model.removeSelectedTheme() | ||
85 | } | 86 | } | ||
86 | 87 | | |||
87 | QtControls.Button { | 88 | QtControls.Button { | ||
88 | icon.name: "preview" | 89 | icon.name: "preview" | ||
89 | text: i18n("Preview...") | 90 | text: i18n("Preview...") | ||
90 | onClicked: kcm.gtkPage.showGtk2Preview() | 91 | onClicked: kcm.gtkPage.showGtk2Preview() | ||
92 | visible: kcm.gtkPage.gtk2PreviewAvailable() | ||||
91 | } | 93 | } | ||
92 | } | 94 | } | ||
93 | } | 95 | } | ||
94 | 96 | | |||
95 | Row { | 97 | Row { | ||
96 | Kirigami.FormData.label: i18n("GTK3 theme:") | 98 | Kirigami.FormData.label: i18n("GTK3 theme:") | ||
97 | 99 | | |||
98 | Flow { | 100 | Flow { | ||
Show All 23 Lines | 122 | QtControls.Button { | |||
122 | icon.name: "edit-delete" | 124 | icon.name: "edit-delete" | ||
123 | onClicked: gtk3ThemeCombo.model.removeSelectedTheme() | 125 | onClicked: gtk3ThemeCombo.model.removeSelectedTheme() | ||
124 | } | 126 | } | ||
125 | 127 | | |||
126 | QtControls.Button { | 128 | QtControls.Button { | ||
127 | icon.name: "preview" | 129 | icon.name: "preview" | ||
128 | text: i18n("Preview...") | 130 | text: i18n("Preview...") | ||
129 | onClicked: kcm.gtkPage.showGtk3Preview() | 131 | onClicked: kcm.gtkPage.showGtk3Preview() | ||
132 | visible: kcm.gtkPage.gtk3PreviewAvailable() | ||||
130 | } | 133 | } | ||
131 | 134 | | |||
132 | } | 135 | } | ||
133 | } | 136 | } | ||
134 | 137 | | |||
135 | } | 138 | } | ||
136 | 139 | | |||
137 | Item { | 140 | Item { | ||
138 | Layout.fillHeight: true | 141 | Layout.fillHeight: true | ||
139 | } | 142 | } | ||
140 | 143 | | |||
141 | RowLayout { | 144 | RowLayout { | ||
142 | Item { | 145 | Item { | ||
143 | Layout.fillWidth: true | 146 | Layout.fillWidth: true | ||
144 | } | 147 | } | ||
145 | 148 | | |||
146 | QtControls.Button { | 149 | QtControls.Button { | ||
147 | icon.name: "document-import" | 150 | icon.name: "document-import" | ||
148 | text: i18n("Install from File...") | 151 | text: i18n("Install from File...") | ||
149 | onClicked: fileDialogLoader.active = true | 152 | onClicked: fileDialogLoader.active = true | ||
150 | } | 153 | } | ||
151 | 154 | | |||
152 | QtControls.Button { | 155 | QtControls.Button { | ||
153 | icon.name: "get-hot-new-stuff" | 156 | icon.name: "get-hot-new-stuff" | ||
154 | text: i18n("Get New GNOME/GTK Application Styles...") | 157 | text: i18n("Download New GNOME/GTK Application Styles...") | ||
155 | onClicked: ghnsMenu.open() | 158 | onClicked: ghnsMenu.open() | ||
156 | 159 | | |||
157 | QtControls.Menu { | 160 | QtControls.Menu { | ||
158 | id: ghnsMenu | 161 | id: ghnsMenu | ||
159 | 162 | | |||
160 | QtControls.MenuItem { | 163 | QtControls.MenuItem { | ||
161 | icon.name: "get-hot-new-stuff" | 164 | icon.name: "get-hot-new-stuff" | ||
162 | text: i18n("Get New GNOME/GTK2 Application Styles...") | 165 | text: i18n("Download New GNOME/GTK2 Application Styles...") | ||
163 | onClicked: function() { | 166 | onClicked: function() { | ||
164 | ghnsMenu.close() | 167 | ghnsMenu.close() | ||
165 | kcm.gtkPage.installGtk2ThemeFromGHNS() | 168 | gtk2NewStuffButton.showDialog() | ||
169 | } | ||||
170 | | ||||
171 | NewStuff.Button { | ||||
172 | id: gtk2NewStuffButton | ||||
173 | downloadNewWhat: i18n("GNOME/GTK2 Application Styles") | ||||
174 | configFile: "gtk2_themes.knsrc" | ||||
175 | viewMode: NewStuff.Page.ViewMode.Preview | ||||
176 | onChangedEntriesChanged: kcm.gtkPage.onGhnsEntriesChanged(gtk2NewStuffButton.changedEntries); | ||||
177 | visible: false | ||||
166 | } | 178 | } | ||
167 | } | 179 | } | ||
168 | QtControls.MenuItem { | 180 | QtControls.MenuItem { | ||
169 | icon.name: "get-hot-new-stuff" | 181 | icon.name: "get-hot-new-stuff" | ||
170 | text: i18n("Get New GNOME/GTK3 Application Styles...") | 182 | text: i18n("Download New GNOME/GTK3 Application Styles...") | ||
171 | onClicked: function() { | 183 | onClicked: function() { | ||
172 | ghnsMenu.close() | 184 | ghnsMenu.close() | ||
173 | kcm.gtkPage.installGtk3ThemeFromGHNS() | 185 | gtk3NewStuffButton.showDialog() | ||
186 | } | ||||
187 | | ||||
188 | NewStuff.Button { | ||||
189 | id: gtk3NewStuffButton | ||||
190 | downloadNewWhat: i18n("GNOME/GTK3 Application Styles") | ||||
191 | configFile: "gtk3_themes.knsrc" | ||||
192 | viewMode: NewStuff.Page.ViewMode.Preview | ||||
193 | onChangedEntriesChanged: kcm.gtkPage.onGhnsEntriesChanged(gtk3NewStuffButton.changedEntries); | ||||
194 | visible: false | ||||
174 | } | 195 | } | ||
175 | } | 196 | } | ||
176 | } | 197 | } | ||
198 | | ||||
177 | } | 199 | } | ||
178 | } | 200 | } | ||
179 | } | 201 | } | ||
180 | 202 | | |||
181 | Loader { | 203 | Loader { | ||
182 | id: fileDialogLoader | 204 | id: fileDialogLoader | ||
183 | active: false | 205 | active: false | ||
184 | sourceComponent: QtDialogs.FileDialog { | 206 | sourceComponent: QtDialogs.FileDialog { | ||
Show All 14 Lines |