Changeset View
Changeset View
Standalone View
Standalone View
applets/quicklaunch/package/contents/ui/ConfigGeneral.qml
Show All 12 Lines | |||||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | 15 | * GNU General Public License for more details. | ||
16 | * | 16 | * | ||
17 | * You should have received a copy of the GNU General Public License | 17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program. If not, see <http://www.gnu.org/licenses/> | 18 | * along with this program. If not, see <http://www.gnu.org/licenses/> | ||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | import QtQuick 2.0 | 21 | import QtQuick 2.5 | ||
22 | import QtQuick.Layouts 1.0 | 22 | import QtQuick.Layouts 1.3 | ||
23 | import QtQuick.Controls 1.0 | 23 | import QtQuick.Controls 2.5 as QQC2 | ||
24 | | ||||
25 | import org.kde.kirigami 2.8 as Kirigami | ||||
24 | import org.kde.plasma.core 2.0 as PlasmaCore | 26 | import org.kde.plasma.core 2.0 as PlasmaCore | ||
25 | 27 | | |||
26 | ColumnLayout { | 28 | Kirigami.FormLayout { | ||
29 | | ||||
30 | anchors.right: parent.right | ||||
31 | anchors.left: parent.left | ||||
27 | 32 | | |||
28 | readonly property bool vertical: plasmoid.formFactor == PlasmaCore.Types.Vertical || (plasmoid.formFactor == PlasmaCore.Types.Planar && plasmoid.height > plasmoid.width) | 33 | readonly property bool vertical: plasmoid.formFactor == PlasmaCore.Types.Vertical || (plasmoid.formFactor == PlasmaCore.Types.Planar && plasmoid.height > plasmoid.width) | ||
29 | 34 | | |||
30 | property alias cfg_maxSectionCount: maxSectionCount.value | 35 | property alias cfg_maxSectionCount: maxSectionCount.value | ||
31 | property alias cfg_showLauncherNames: showLauncherNames.checked | 36 | property alias cfg_showLauncherNames: showLauncherNames.checked | ||
32 | property alias cfg_enablePopup: enablePopup.checked | 37 | property alias cfg_enablePopup: enablePopup.checked | ||
33 | property alias cfg_title: title.text | 38 | property alias cfg_title: title.text | ||
34 | 39 | | |||
35 | GroupBox { | | |||
36 | Layout.fillWidth: true | | |||
37 | flat: true | | |||
38 | 40 | | |||
39 | title: i18nc("@title:group", "Arrangement") | 41 | QQC2.SpinBox { | ||
42 | id: maxSectionCount | ||||
40 | 43 | | |||
41 | RowLayout { | 44 | Kirigami.FormData.label: vertical ? i18nc("@label:spinbox", "Maximum columns:") : i18nc("@label:spinbox", "Maximum rows:") | ||
42 | Label { | | |||
43 | text: vertical ? i18nc("@label:spinbox", "Maximum columns:") : i18nc("@label:spinbox", "Maximum rows:") | | |||
44 | } | | |||
45 | 45 | | |||
46 | SpinBox { | 46 | from: 1 | ||
47 | id: maxSectionCount | | |||
48 | minimumValue: 1 | | |||
49 | } | | |||
50 | } | | |||
51 | } | 47 | } | ||
52 | 48 | | |||
53 | GroupBox { | | |||
54 | Layout.fillWidth: true | | |||
55 | flat: true | | |||
56 | 49 | | |||
57 | title: i18nc("@title:group", "Appearance") | 50 | Item { | ||
51 | Kirigami.FormData.isSection: true | ||||
52 | } | ||||
53 | | ||||
58 | 54 | | |||
59 | ColumnLayout { | 55 | QQC2.CheckBox { | ||
60 | CheckBox { | | |||
61 | id: showLauncherNames | 56 | id: showLauncherNames | ||
57 | | ||||
58 | Kirigami.FormData.label: i18nc("@title:group", "Appearance:") | ||||
59 | | ||||
62 | text: i18nc("@option:check", "Show launcher names") | 60 | text: i18nc("@option:check", "Show launcher names") | ||
63 | } | 61 | } | ||
64 | 62 | | |||
65 | CheckBox { | 63 | QQC2.CheckBox { | ||
66 | id: enablePopup | 64 | id: enablePopup | ||
67 | text: i18nc("@option:check", "Enable popup") | 65 | text: i18nc("@option:check", "Enable popup") | ||
68 | } | 66 | } | ||
69 | } | 67 | | ||
68 | | ||||
69 | Item { | ||||
70 | Kirigami.FormData.isSection: true | ||||
70 | } | 71 | } | ||
71 | 72 | | |||
72 | GroupBox { | 73 | | ||
74 | RowLayout { | ||||
75 | Kirigami.FormData.label: i18nc("@title:group", "Title:") | ||||
73 | Layout.fillWidth: true | 76 | Layout.fillWidth: true | ||
74 | flat: true | | |||
75 | 77 | | |||
76 | title: i18nc("@title:group", "Title") | | |||
77 | visible: plasmoid.formFactor == PlasmaCore.Types.Planar | 78 | visible: plasmoid.formFactor == PlasmaCore.Types.Planar | ||
78 | 79 | | |||
79 | RowLayout { | 80 | QQC2.CheckBox { | ||
80 | anchors.fill: parent | | |||
81 | CheckBox { | | |||
82 | id: showTitle | 81 | id: showTitle | ||
83 | checked: title.activeFocus || title.length | 82 | checked: title.length | ||
84 | text: i18nc("@option:check", "Show title") | 83 | text: i18nc("@option:check", "Show:") | ||
85 | 84 | | |||
86 | onClicked: { | 85 | onClicked: { | ||
87 | if (checked) { | 86 | if (checked) { | ||
88 | title.forceActiveFocus(); | 87 | title.forceActiveFocus(); | ||
89 | } else { | 88 | } else { | ||
90 | title.text = ""; | 89 | title.text = ""; | ||
91 | } | 90 | } | ||
92 | } | 91 | } | ||
93 | } | 92 | } | ||
94 | 93 | | |||
95 | TextField { | 94 | Kirigami.ActionTextField { | ||
96 | id: title | 95 | id: title | ||
97 | Layout.fillWidth: true | | |||
98 | enabled: showTitle.checked | 96 | enabled: showTitle.checked | ||
99 | placeholderText: i18nc("@info:placeholder", "Enter title") | 97 | | ||
100 | } | 98 | Layout.fillWidth: true | ||
99 | placeholderText: i18nc("@info:placeholder", "Custom title") | ||||
100 | | ||||
101 | rightActions: [ | ||||
102 | Kirigami.Action { | ||||
103 | iconName: "edit-clear" | ||||
104 | visible: title.text.length !== 0 | ||||
105 | onTriggered: title.text = ""; | ||||
101 | } | 106 | } | ||
107 | ] | ||||
102 | } | 108 | } | ||
103 | | ||||
104 | Item { // tighten layout | | |||
105 | Layout.fillHeight: true | | |||
106 | } | 109 | } | ||
107 | } | 110 | } |