/usr/share/kpackage/genericqml/org.kde.plasma.themeexplorer/contents/ui/ColorEditor.qml is in plasma-sdk 5.8.6-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 | /*
* Copyright 2015 Marco Martin <mart@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2 or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details
*
* You should have received a copy of the GNU Library General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import QtQuick 2.3
import QtGraphicalEffects 1.0
import QtQuick.Layouts 1.1
import QtQuick.Controls 1.2
import QtQuick.Dialogs 1.2
import org.kde.plasma.core 2.0 as PlasmaCore
import "fakecontrols" as FakeControls
Dialog {
id: dialog
property alias textColor: textButton.color
property alias backgroundColor: backgroundButton.color
property alias highlightColor: highlightButton.color
property alias linkColor: linkButton.color
property alias visitedLinkColor: visitedLinkButton.color
property alias buttonTextColor: buttonTextButton.color
property alias buttonBackgroundColor: buttonBackgroundButton.color
property alias buttonHoverColor: buttonHoverButton.color
property alias buttonFocusColor: buttonFocusButton.color
property alias viewTextColor: viewTextButton.color
property alias viewBackgroundColor: viewBackgroundButton.color
property alias viewHoverColor: viewHoverButton.color
property alias viewFocusColor: viewFocusButton.color
property alias complementaryTextColor: complementaryTextButton.color
property alias complementaryBackgroundColor: complementaryBackgroundButton.color
property alias complementaryHoverColor: complementaryHoverButton.color
property alias complementaryFocusColor: complementaryFocusButton.color
title: i18n("Edit Colors");
onVisibleChanged: {
if (visible) {
textColor = themeModel.colorEditor.textColor;
backgroundColor = themeModel.colorEditor.backgroundColor;
highlightColor = themeModel.colorEditor.highlightColor;
linkColor = themeModel.colorEditor.linkColor;
visitedLinkColor = themeModel.colorEditor.visitedLinkColor;
buttonTextColor = themeModel.colorEditor.buttonTextColor;
buttonBackgroundColor = themeModel.colorEditor.buttonBackgroundColor;
buttonHoverColor = themeModel.colorEditor.buttonHoverColor;
buttonFocusColor = themeModel.colorEditor.buttonFocusColor;
viewTextColor = themeModel.colorEditor.viewTextColor;
viewBackgroundColor = themeModel.colorEditor.viewBackgroundColor;
viewHoverColor = themeModel.colorEditor.viewHoverColor;
viewFocusColor = themeModel.colorEditor.viewFocusColor;
complementaryTextColor = themeModel.colorEditor.complementaryTextColor;
complementaryBackgroundColor = themeModel.colorEditor.complementaryBackgroundColor;
complementaryHoverColor = themeModel.colorEditor.complementaryHoverColor;
complementaryFocusColor = themeModel.colorEditor.complementaryFocusColor;
}
}
ColorDialog {
id: colorDialog
modality: Qt.WindowModal
showAlphaChannel: false
title: i18n("Select Color")
property Item activeButton
onAccepted: {
activeButton.color = color;
}
}
contentItem: Rectangle {
implicitWidth: units.gridUnit * 50
implicitHeight: units.gridUnit * 42
Keys.onPressed: {
if (event.key == Qt.Key_Enter || event.key == Qt.Key_Return) {
dialog.accept();
} else if (event.key == Qt.Key_Escape) {
dialog.reject();
}
}
SystemPalette {
id: palette
}
color: palette.window
ColumnLayout {
anchors.fill: parent
spacing: 0
Rectangle {
Layout.fillWidth: true
//Layout.fillHeight: true
Layout.minimumHeight: units.gridUnit * 15
color: palette.base
Rectangle {
id: plasmoidPreview
anchors.centerIn: parent
width: parent.width/1.5
height: parent.height/1.5
radius: units.smallSpacing
color: backgroundColor
ColumnLayout {
anchors.centerIn: parent
Label {
Layout.alignment: Qt.AlignHCenter
text: i18n("Normal text")
color: textColor
}
RowLayout {
Layout.alignment: Qt.AlignHCenter
Label {
text: i18n("Link")
color: linkColor
}
Label {
text: i18n("Visited Link")
color: visitedLinkColor
}
}
FakeControls.CheckBox {
Layout.alignment: Qt.AlignHCenter
}
FakeControls.LineEdit {
Layout.alignment: Qt.AlignHCenter
}
FakeControls.Button {
Layout.alignment: Qt.AlignHCenter
}
}
}
DropShadow {
anchors.fill: plasmoidPreview
horizontalOffset: 0
verticalOffset: units.smallSpacing/2
radius: units.gridUnit / 2.2
samples: 16
color: Qt.rgba(0, 0, 0, 0.5)
source: plasmoidPreview
}
}
Rectangle {
id: complementaryBar
color: complementaryBackgroundColor
height: units.gridUnit * 2
anchors {
left: parent.left
right: parent.right
}
Label {
text: i18n("Complementary colors area:")
color: complementaryTextColor
anchors {
verticalCenter: parent.verticalCenter
left: complementaryBar.left
leftMargin: units.smallspacing
}
}
RowLayout {
anchors {
top: complementaryBar.top
bottom: complementaryBar.bottom
horizontalCenter: complementaryBar.horizontalCenter
}
Label {
text: i18n("Label")
color: complementaryTextColor
}
FakeControls.CheckBox {
complementary: true
}
}
}
ScrollView {
id: scroll
Layout.fillWidth: true
Layout.fillHeight: true
Layout.minimumHeight: units.gridUnit * 15
Item {
width: scroll.viewport.width
height: childrenRect.height
GridLayout {
//Layout.alignment: Qt.AlignHCenter
anchors.centerIn: parent
columns: 2
columnSpacing: units.smallSpacing
FormLabel {
text: i18n("Text color:")
buddy: textButton
}
ColorButton {
id: textButton
}
FormLabel {
text: i18n("Background color:")
buddy: backgroundButton
}
ColorButton {
id: backgroundButton
}
FormLabel {
text: i18n("Highlight color:")
buddy: highlightButton
}
ColorButton {
id: highlightButton
}
FormLabel {
text: i18n("Link color:")
buddy: linkButton
}
ColorButton {
id: linkButton
}
FormLabel {
text: i18n("Visited link color:")
buddy: visitedLinkButton
}
ColorButton {
id: visitedLinkButton
}
FormLabel {
text: i18n("Button text color:")
buddy: buttonTextButton
}
ColorButton {
id: buttonTextButton
}
FormLabel {
text: i18n("Button background color:")
buddy: buttonBackgroundButton
}
ColorButton {
id: buttonBackgroundButton
}
FormLabel {
text: i18n("Button mouse over color:")
buddy: buttonHoverButton
}
ColorButton {
id: buttonHoverButton
}
FormLabel {
text: i18n("Button focus color:")
buddy: buttonFocusButton
}
ColorButton {
id: buttonFocusButton
}
FormLabel {
text: i18n("Text view text color:")
buddy: viewTextButton
}
ColorButton {
id: viewTextButton
}
FormLabel {
text: i18n("Text view background color:")
buddy: viewBackgroundButton
}
ColorButton {
id: viewBackgroundButton
}
FormLabel {
text: i18n("Text view mouse over color:")
buddy: viewHoverButton
}
ColorButton {
id: viewHoverButton
}
FormLabel {
text: i18n("Text view focus color:")
buddy: viewFocusButton
}
ColorButton {
id: viewFocusButton
}
FormLabel {
text: i18n("Complementary text color:")
buddy: complementaryTextButton
}
ColorButton {
id: complementaryTextButton
}
FormLabel {
text: i18n("Complementary background color:")
buddy: complementaryBackgroundButton
}
ColorButton {
id: complementaryBackgroundButton
}
FormLabel {
text: i18n("Complementary mouse over color:")
buddy: complementaryHoverButton
}
ColorButton {
id: complementaryHoverButton
}
FormLabel {
text: i18n("Complementary focus color:")
buddy: complementaryFocusButton
}
ColorButton {
id: complementaryFocusButton
}
}
}
}
RowLayout {
anchors {
right: parent.right
rightMargin: units.smallSpacing
}
Button {
text: i18n("OK")
onClicked: dialog.accept()
isDefault: true
}
Button {
text: i18n("Cancel")
onClicked: dialog.reject()
}
}
}
}
onAccepted: {
themeModel.colorEditor.textColor = textColor;
themeModel.colorEditor.backgroundColor = backgroundColor;
themeModel.colorEditor.highlightColor = highlightColor;
themeModel.colorEditor.linkColor = linkColor;
themeModel.colorEditor.visitedLinkColor = visitedLinkColor;
themeModel.colorEditor.buttonTextColor = buttonTextColor;
themeModel.colorEditor.buttonBackgroundColor = buttonBackgroundColor;
themeModel.colorEditor.buttonHoverColor = buttonHoverColor;
themeModel.colorEditor.buttonFocusColor = buttonFocusColor;
themeModel.colorEditor.viewTextColor = viewTextColor;
themeModel.colorEditor.viewBackgroundColor = viewBackgroundColor;
themeModel.colorEditor.viewHoverColor = viewHoverColor;
themeModel.colorEditor.viewFocusColor = viewFocusColor;
themeModel.colorEditor.complementaryTextColor = complementaryTextColor;
themeModel.colorEditor.complementaryBackgroundColor = complementaryBackgroundColor;
themeModel.colorEditor.complementaryHoverColor = complementaryHoverColor;
themeModel.colorEditor.complementaryFocusColor = complementaryFocusColor;
themeModel.colorEditor.save();
}
}
|