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 2.2 as QtControls | ||||
22 | import org.kde.kirigami 2.2 as Kirigami | ||||
23 | import org.kde.kcm 1.0 | ||||
24 | import org.kde.kcmcontrols 1.0 as KCMControls | ||||
25 | | ||||
26 | import org.kde.private.kcm_cursortheme 1.0 | ||||
27 | | ||||
28 | KCMControls.GridViewPage { | ||||
29 | | ||||
30 | | ||||
31 | ConfigModule.quickHelp: i18n("This module lets you configure the mouse cursor theme used.") | ||||
32 | | ||||
33 | view.model: kcm.cursorsModel | ||||
34 | view.delegate: Delegate {} | ||||
35 | view.onCurrentIndexChanged: { | ||||
36 | kcm.selectedThemeRow = view.currentIndex; | ||||
37 | view.positionViewAtIndex(view.currentIndex, view.GridView.Beginning); | ||||
38 | } | ||||
39 | | ||||
40 | Connections { | ||||
41 | target: kcm | ||||
42 | onSelectedThemeRowChanged: view.currentIndex = kcm.selectedThemeRow; | ||||
43 | } | ||||
44 | | ||||
45 | footer: RowLayout { | ||||
46 | //spacer | ||||
47 | Item { | ||||
48 | Layout.fillWidth: true | ||||
49 | Layout.fillHeight: true | ||||
50 | } | ||||
51 | | ||||
52 | QtControls.Label { | ||||
53 | text: i18n("Size:") | ||||
54 | } | ||||
55 | QtControls.ComboBox { | ||||
56 | id: sizeCombo | ||||
57 | currentIndex: 0 | ||||
58 | onCountChanged: currentIndex = 0 | ||||
59 | model: kcm.sizesModel | ||||
60 | textRole: "display" | ||||
61 | onCurrentTextChanged: { | ||||
62 | kcm.preferredSize = parseInt(sizeCombo.currentText) !== NaN ? parseInt(sizeCombo.currentText) : 0 | ||||
63 | } | ||||
64 | } | ||||
65 | QtControls.Button { | ||||
66 | // iconName: "document-import" | ||||
67 | text: i18n("&Install From File...") | ||||
68 | onClicked: kcm.installClicked(); | ||||
69 | enabled: kcm.canInstall | ||||
70 | } | ||||
71 | QtControls.Button { | ||||
72 | // iconName: "get-hot-new-stuff" | ||||
73 | text: i18n("&Get New Theme...") | ||||
74 | onClicked: kcm.getNewClicked(); | ||||
75 | enabled: kcm.canInstall | ||||
76 | } | ||||
77 | } | ||||
78 | } | ||||
79 | |