Changeset View
Changeset View
Standalone View
Standalone View
kcms/activities/imports/qml/activityDialog/GeneralTab.qml
Show All 12 Lines | |||||
13 | * GNU General Public License for more details | 13 | * GNU General Public License for more details | ||
14 | * | 14 | * | ||
15 | * You should have received a copy of the GNU General Public | 15 | * You should have received a copy of the GNU General Public | ||
16 | * License along with this program; if not, write to the | 16 | * License along with this program; if not, write to the | ||
17 | * Free Software Foundation, Inc., | 17 | * Free Software Foundation, Inc., | ||
18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | import QtQuick 2.2 | 21 | import QtQuick 2.5 | ||
22 | import QtQuick.Controls 1.0 as QtControls | 22 | import QtQuick.Controls 2.5 as QQC2 | ||
23 | 23 | | |||
24 | import org.kde.plasma.core 2.0 as PlasmaCore | 24 | import org.kde.kirigami 2.5 as Kirigami | ||
25 | import org.kde.kquickcontrols 2.0 as KQuickControls | ||||
26 | import org.kde.kquickcontrolsaddons 2.0 as KQuickControlsAddons | ||||
ngraham: You're importing two different things with the same name | |||||
25 | 27 | | |||
26 | import "./components" as Local | 28 | Kirigami.FormLayout { | ||
27 | | ||||
28 | Item { | | |||
29 | id: root | 29 | id: root | ||
30 | 30 | | |||
31 | function setFocus() { | 31 | function setFocus() { | ||
32 | activityName.forceActiveFocus(); | 32 | activityName.forceActiveFocus(); | ||
33 | console.log("GeneralTab: Set focus called"); | | |||
34 | } | 33 | } | ||
35 | 34 | | |||
36 | property string activityId: "" | 35 | property string activityId: "" | ||
37 | 36 | | |||
38 | property alias activityName : activityName.text | 37 | property alias activityName : activityName.text | ||
39 | property alias activityDescription : activityDescription.text | 38 | property alias activityDescription : activityDescription.text | ||
40 | property alias activityIcon : buttonIcon.iconName | 39 | property alias activityIcon : activityIcon.icon.name | ||
41 | property alias activityWallpaper : imageWallpaper.source | 40 | property alias activityIsPrivate : activityIsPrivate.checked | ||
42 | 41 | property alias activityShortcut : activityShortcut.keySequence | |||
43 | height : content.childrenRect.height + 4 * units.smallSpacing | | |||
44 | width : content.childrenRect.width + 4 * units.smallSpacing | | |||
45 | | ||||
46 | Column { | | |||
47 | id: content | | |||
48 | | ||||
49 | anchors { | | |||
50 | fill: parent | | |||
51 | margins: 2 * units.smallSpacing | | |||
52 | } | | |||
53 | | ||||
54 | spacing: units.smallSpacing | | |||
55 | | ||||
56 | QtControls.Label { | | |||
57 | font.bold: true | | |||
58 | text: i18nd("kcm_activities5", "Activity information") | | |||
59 | } | | |||
60 | | ||||
61 | property int labelWidth : 2 * units.largeSpacing + | | |||
62 | Math.max(activityName.desiredLabelWidth, activityDescription.desiredLabelWidth) | | |||
63 | | ||||
64 | Local.LabeledTextField { | | |||
65 | id: activityName | | |||
66 | label: i18nd("kcm_activities5", "Name:") | | |||
67 | | ||||
68 | labelWidth: content.labelWidth | | |||
69 | } | | |||
70 | | ||||
71 | Local.LabeledTextField { | | |||
72 | id: activityDescription | | |||
73 | label: i18nd("kcm_activities5", "Description:") | | |||
74 | | ||||
75 | labelWidth: content.labelWidth | | |||
76 | } | | |||
77 | 42 | | |||
78 | Item { | 43 | Item { | ||
79 | width: parent.width | 44 | height: Kirigami.Units.smallSpacing | ||
80 | height: units.smallSpacing | | |||
81 | } | 45 | } | ||
82 | 46 | | |||
83 | Row { | 47 | QQC2.Button { | ||
84 | height : units.iconSizes.large * 3 | 48 | id: activityIcon | ||
85 | width : childrenRect.width | 49 | implicitHeight: Kirigami.Units.iconSizes.medium + Kirigami.Units.largeSpacing * 2 | ||
86 | spacing : units.largeSpacing | 50 | implicitWidth: height | ||
87 | 51 | icon.height: Kirigami.Units.iconSizes.medium | |||
88 | Item { | 52 | icon.width: Kirigami.Units.iconSizes.medium | ||
89 | id: panelWallpaper | 53 | icon.name: "preferences-activities" | ||
90 | 54 | Kirigami.FormData.label: i18nd("kcm_activities5", "Icon:") | |||
91 | visible: false | | |||
92 | 55 | | |||
93 | height: parent.height | 56 | KQuickControlsAddons.IconDialog { | ||
94 | width: buttonChangeWallpaper.width + imageWallpaper.width + units.smallSpacing | 57 | id: iconDialog | ||
95 | 58 | onIconNameChanged: activityIcon.icon.name = iconName | |||
96 | QtControls.Label { | | |||
97 | id: labelWallpaper | | |||
98 | font.bold: true | | |||
99 | text: i18nd("kcm_activities5", "Wallpaper") | | |||
100 | } | 59 | } | ||
101 | 60 | | |||
102 | QtControls.Button { | 61 | onClicked: { | ||
103 | id: buttonChangeWallpaper | 62 | iconDialog.open(); | ||
104 | width: content.labelWidth | | |||
105 | text: i18ndc("kcm_activities5", "@action:button", "Change...") | | |||
106 | | ||||
107 | anchors { | | |||
108 | verticalCenter: imageWallpaper.verticalCenter | | |||
109 | } | 63 | } | ||
110 | } | 64 | } | ||
111 | 65 | | |||
112 | Image { | 66 | QQC2.TextField { | ||
113 | id: imageWallpaper | 67 | id: activityName | ||
114 | source: "" | 68 | Kirigami.FormData.label: i18nd("kcm_activities5", "Name:") | ||
115 | | ||||
116 | width: height / 3 * 4 | | |||
117 | | ||||
118 | anchors { | | |||
119 | top: labelWallpaper.bottom | | |||
120 | bottom: parent.bottom | | |||
121 | left: buttonChangeWallpaper.right | | |||
122 | | ||||
123 | leftMargin: units.smallSpacing | | |||
124 | } | 69 | } | ||
125 | 70 | | |||
71 | QQC2.TextField { | ||||
72 | id: activityDescription | ||||
73 | Kirigami.FormData.label: i18nd("kcm_activities5", "Description:") | ||||
126 | } | 74 | } | ||
127 | } | | |||
128 | | ||||
129 | Item { | | |||
130 | id: panelIcon | | |||
131 | 75 | | |||
132 | height : parent.height | 76 | Kirigami.Separator { | ||
133 | width : parent.height | 77 | Kirigami.FormData.isSection: true | ||
134 | | ||||
135 | QtControls.Label { | | |||
136 | id: labelIcon | | |||
137 | font.bold: true | | |||
138 | text: i18nd("kcm_activities5", "Icon") | | |||
139 | } | 78 | } | ||
140 | 79 | | |||
141 | Item { | 80 | QQC2.CheckBox { | ||
142 | anchors { | 81 | id: activityIsPrivate | ||
143 | top: labelIcon.bottom | 82 | Kirigami.FormData.label: i18nd("kcm_activities5", "Privacy:") | ||
144 | bottom: parent.bottom | 83 | text: i18nd("kcm_activities5", "Do not track usage for this activity") | ||
145 | left: parent.left | | |||
146 | right: parent.right | | |||
147 | } | 84 | } | ||
148 | 85 | | |||
149 | Local.IconChooser { | 86 | KQuickControls.KeySequenceItem { | ||
150 | id: buttonIcon | 87 | id: activityShortcut | ||
151 | 88 | Kirigami.FormData.label: i18nd("kcm_activities5", "Shortcut for switching:") | |||
152 | width: height | | |||
153 | height: 2 * units.iconSizes.large | | |||
154 | | ||||
155 | anchors { | | |||
156 | centerIn: parent | | |||
157 | } | | |||
158 | } | 89 | } | ||
159 | } | 90 | } | ||
160 | } | | |||
161 | } | | |||
162 | } | | |||
163 | } | | |||
164 | |
You're importing two different things with the same name