Changeset View
Changeset View
Standalone View
Standalone View
cuttlefish/package/contents/ui/Tools.qml
Show All 19 Lines | |||||
20 | * * | 20 | * * | ||
21 | ***************************************************************************/ | 21 | ***************************************************************************/ | ||
22 | 22 | | |||
23 | import QtQuick 2.5 | 23 | import QtQuick 2.5 | ||
24 | import QtQuick.Controls 2.5 as QQC2 | 24 | import QtQuick.Controls 2.5 as QQC2 | ||
25 | import QtQuick.Layouts 1.0 | 25 | import QtQuick.Layouts 1.0 | ||
26 | 26 | | |||
27 | import org.kde.kirigami 2.8 as Kirigami | 27 | import org.kde.kirigami 2.8 as Kirigami | ||
28 | import org.kde.kquickcontrolsaddons 2.0 as KQCAddons | ||||
28 | 29 | | |||
29 | Rectangle { | 30 | Rectangle { | ||
30 | id: root | 31 | id: root | ||
31 | width: parent.width | 32 | width: parent.width | ||
32 | color: Kirigami.Theme.backgroundColor | 33 | color: Kirigami.Theme.backgroundColor | ||
33 | signal colorschemeChanged(int index) | 34 | signal colorschemeChanged(int index) | ||
34 | signal sliderValueChanged(int val) | 35 | signal sliderValueChanged(int val) | ||
35 | 36 | | |||
36 | property alias slider: sizeslider | 37 | property alias slider: sizeslider | ||
37 | property alias currentIndex: colorcombo.currentIndex | 38 | property alias currentIndex: colorcombo.currentIndex | ||
38 | property alias value: sizeslider.value | 39 | property alias value: sizeslider.value | ||
39 | 40 | | |||
40 | Kirigami.Theme.textColor: cuttlefish.textcolor | | |||
41 | Kirigami.Theme.backgroundColor: cuttlefish.bgcolor | | |||
42 | Kirigami.Theme.highlightColor: cuttlefish.highlightcolor | | |||
43 | Kirigami.Theme.highlightedTextColor: cuttlefish.highlightedtextcolor | | |||
44 | Kirigami.Theme.positiveTextColor: cuttlefish.positivetextcolor | | |||
45 | Kirigami.Theme.neutralTextColor: cuttlefish.neutraltextcolor | | |||
46 | Kirigami.Theme.negativeTextColor: cuttlefish.negativetextcolor | | |||
47 | | ||||
48 | RowLayout { | 41 | RowLayout { | ||
49 | anchors.fill: parent | 42 | anchors.fill: parent | ||
50 | anchors.leftMargin: Kirigami.Units.smallSpacing | 43 | anchors.leftMargin: Kirigami.Units.smallSpacing | ||
51 | anchors.rightMargin: Kirigami.Units.smallSpacing | 44 | anchors.rightMargin: Kirigami.Units.smallSpacing | ||
52 | anchors.verticalCenter: parent.verticalCenter | 45 | anchors.verticalCenter: parent.verticalCenter | ||
53 | spacing: Kirigami.Units.largeSpacing | 46 | spacing: Kirigami.Units.largeSpacing | ||
54 | Kirigami.SearchField { | 47 | Kirigami.SearchField { | ||
55 | id: filterInput | 48 | id: filterInput | ||
▲ Show 20 Lines • Show All 67 Lines • ▼ Show 20 Line(s) | |||||
123 | } | 116 | } | ||
124 | QQC2.Label { | 117 | QQC2.Label { | ||
125 | visible: cuttlefish.widescreen | 118 | visible: cuttlefish.widescreen | ||
126 | text: i18n("Color scheme:") | 119 | text: i18n("Color scheme:") | ||
127 | } | 120 | } | ||
128 | QQC2.ComboBox { | 121 | QQC2.ComboBox { | ||
129 | id: colorcombo | 122 | id: colorcombo | ||
130 | visible: cuttlefish.widescreen | 123 | visible: cuttlefish.widescreen | ||
131 | model: ["System Color Scheme", "Breeze (Normal)", "Breeze Dark"] | 124 | model: colorSchemes.colorSchemes | ||
132 | delegate: QQC2.ItemDelegate { | 125 | delegate: QQC2.ItemDelegate { | ||
133 | text: i18n(modelData) | 126 | Kirigami.Theme.colorSet: Kirigami.Theme.View | ||
134 | width: parent.width | 127 | width: parent.width | ||
128 | highlighted: colorcombo.highlightedIndex == index | ||||
129 | contentItem: RowLayout { | ||||
130 | Kirigami.Icon { | ||||
131 | source: model.decoration | ||||
132 | Layout.preferredHeight: Kirigami.Units.iconSizes.small | ||||
133 | Layout.preferredWidth: Kirigami.Units.iconSizes.small | ||||
134 | } | ||||
135 | QQC2.Label { | ||||
136 | text: model.display | ||||
137 | color: highlighted ? Kirigami.Theme.highlightedTextColor : Kirigami.Theme.textColor | ||||
138 | Layout.fillWidth: true | ||||
139 | } | ||||
140 | } | ||||
135 | } | 141 | } | ||
142 | textRole: "display" | ||||
136 | onActivated: (index) => { | 143 | onActivated: (index) => { | ||
137 | root.colorschemeChanged(index) | 144 | root.colorschemeChanged(index) | ||
145 | colorSchemes.activateColorScheme(currentText) | ||||
138 | } | 146 | } | ||
139 | popup.modal: false | 147 | popup.modal: false | ||
140 | } | 148 | } | ||
141 | } | 149 | } | ||
142 | Kirigami.Separator { | 150 | Kirigami.Separator { | ||
143 | height: 1 | 151 | height: 1 | ||
144 | anchors { | 152 | anchors { | ||
145 | left: parent.left | 153 | left: parent.left | ||
146 | right: parent.right | 154 | right: parent.right | ||
147 | bottom: parent.bottom | 155 | bottom: parent.bottom | ||
148 | } | 156 | } | ||
149 | } | 157 | } | ||
150 | } | 158 | } | ||
151 | 159 | |