Changeset View
Changeset View
Standalone View
Standalone View
kcms/cursortheme/package/contents/ui/main.qml
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | Copyright (c) 2015 Marco Martin <mart@kde.org> | ||||
3 | | ||||
4 | This library is free software; you can redistribute it and/or | ||||
5 | modify it under the terms of the GNU Library General Public | ||||
6 | License version 2 as published by the Free Software Foundation. | ||||
7 | | ||||
8 | This library is distributed in the hope that it will be useful, | ||||
9 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||||
11 | Library General Public License for more details. | ||||
12 | | ||||
13 | You should have received a copy of the GNU Library General Public License | ||||
14 | along with this library; see the file COPYING.LIB. If not, write to | ||||
15 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||||
16 | Boston, MA 02110-1301, USA. | ||||
17 | */ | ||||
18 | | ||||
19 | import QtQuick 2.7 | ||||
20 | import QtQuick.Layouts 1.1 | ||||
21 | import QtQuick.Controls 1.2 as QQC1 | ||||
22 | import QtQuick.Controls 2.2 as QtControls | ||||
23 | import org.kde.kirigami 2.2 as Kirigami | ||||
24 | import org.kde.kcm 1.0 | ||||
25 | import org.kde.kcmcontrols 1.0 as KCMControls | ||||
26 | | ||||
27 | import org.kde.private.kcm_cursortheme 1.0 | ||||
28 | | ||||
29 | KCMControls.GridViewKCM { | ||||
30 | | ||||
31 | | ||||
32 | ConfigModule.quickHelp: i18n("This module lets you configure the mouse cursor theme used.") | ||||
33 | | ||||
34 | view.model: kcm.cursorsModel | ||||
35 | view.delegate: Delegate {} | ||||
36 | view.onCurrentIndexChanged: { | ||||
37 | kcm.selectedThemeRow = view.currentIndex; | ||||
38 | view.positionViewAtIndex(view.currentIndex, view.GridView.Beginning); | ||||
39 | } | ||||
40 | | ||||
41 | Connections { | ||||
42 | target: kcm | ||||
43 | onSelectedThemeRowChanged: view.currentIndex = kcm.selectedThemeRow; | ||||
44 | } | ||||
45 | | ||||
46 | footer: ColumnLayout { | ||||
47 | id: footerLayout | ||||
48 | RowLayout { | ||||
49 | id: row1 | ||||
50 | //spacer | ||||
51 | Item { | ||||
52 | Layout.fillWidth: true | ||||
53 | Layout.fillHeight: true | ||||
54 | } | ||||
55 | | ||||
56 | RowLayout { | ||||
57 | id: comboLayout | ||||
58 | QtControls.Label { | ||||
59 | text: i18n("Size:") | ||||
60 | } | ||||
61 | QtControls.ComboBox { | ||||
62 | id: sizeCombo | ||||
63 | currentIndex: 0 | ||||
64 | onCountChanged: currentIndex = 0 | ||||
65 | model: kcm.sizesModel | ||||
66 | textRole: "display" | ||||
67 | onCurrentTextChanged: { | ||||
68 | kcm.preferredSize = parseInt(sizeCombo.currentText) !== NaN ? parseInt(sizeCombo.currentText) : 0 | ||||
69 | } | ||||
70 | } | ||||
71 | } | ||||
72 | RowLayout { | ||||
73 | parent: footerLayout.x + footerLayout.width - comboLayout.width > width ? row1 : row2 | ||||
74 | //TODO: port to QQC2 buttons as soon they have icons | ||||
75 | QQC1.Button { | ||||
76 | iconName: "document-import" | ||||
77 | text: i18n("&Install From File...") | ||||
78 | onClicked: kcm.installClicked(); | ||||
79 | enabled: kcm.canInstall | ||||
80 | } | ||||
81 | QQC1.Button { | ||||
82 | iconName: "get-hot-new-stuff" | ||||
83 | text: i18n("&Get New Theme...") | ||||
84 | onClicked: kcm.getNewClicked(); | ||||
85 | enabled: kcm.canInstall | ||||
86 | } | ||||
87 | } | ||||
88 | } | ||||
89 | RowLayout { | ||||
90 | id: row2 | ||||
91 | visible: children.length > 1 | ||||
92 | //spacer | ||||
93 | Item { | ||||
94 | Layout.fillWidth: true | ||||
95 | Layout.fillHeight: true | ||||
96 | } | ||||
97 | } | ||||
98 | } | ||||
99 | } | ||||
100 | |