Commit fb4fcae3 authored by Filip Fila's avatar Filip Fila 🌆

[color-picker] Port configuration window to QQC2 and Kirigami.FormLayout

Summary: Port color-picker's configuration window to QQC2 and Kirigami.FormLayout & change the General category's icon so that it matches the applet's icon.

Test Plan:
Before:
{F6693452}

After:
{F6693453}

Everything still worked.

Reviewers: #plasma, #vdg, ngraham

Reviewed By: #vdg, ngraham

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D19789
parent e32e12df
......@@ -23,7 +23,7 @@ import org.kde.plasma.configuration 2.0
ConfigModel {
ConfigCategory {
name: i18nc("@title", "General")
icon: "preferences-desktop-color"
icon: "color-picker"
source: "configGeneral.qml"
}
}
......@@ -19,79 +19,46 @@
*/
import QtQuick 2.0
import QtQuick.Controls 1.0 as QtControls
import QtQuick.Layouts 1.0
import QtQuick.Controls 2.5 as QtControls
import org.kde.kirigami 2.5 as Kirigami
import "logic.js" as Logic
ColumnLayout {
Kirigami.FormLayout {
id: appearancePage
anchors.left: parent.left
anchors.right: parent.right
property alias cfg_autoClipboard: autoClipboardCheckBox.checked
property string cfg_defaultFormat
property bool cfg_pickOnActivate
QtControls.ComboBox {
id: defaultFormatCombo
Kirigami.FormData.label: i18nc("@label:listbox", "Default color format:")
model: Logic.formats
currentIndex: defaultFormatCombo.model.indexOf(cfg_defaultFormat)
onActivated: cfg_defaultFormat = model[index]
}
QtControls.CheckBox {
id: autoClipboardCheckBox
Layout.fillWidth: true
text: i18nc("@option:check", "Automatically copy color to clipboard")
}
GridLayout {
Layout.fillWidth: false // Layout thinks it's smart whereas it's not
Layout.alignment: Qt.AlignLeft
columns: 2
QtControls.Label {
Layout.row: 0
Layout.column: 0
Layout.fillWidth: true
horizontalAlignment: Text.AlignRight
text: i18nc("@label:listbox", "Default color format:")
}
QtControls.ComboBox {
id: defaultFormatCombo
Layout.row: 0
Layout.column: 1
// ComboBox default sizing is totally off
Layout.minimumWidth: theme.mSize(theme.defaultFont).width * 12
model: Logic.formats
currentIndex: defaultFormatCombo.model.indexOf(cfg_defaultFormat)
onActivated: cfg_defaultFormat = model[index]
}
QtControls.Label {
Layout.row: 1
Layout.column: 0
Layout.fillWidth: true
horizontalAlignment: Text.AlignRight
text: i18nc("@label", "When pressing the keyboard shortcut:")
}
QtControls.ExclusiveGroup {
id: activationExclusiveGroup
}
QtControls.RadioButton {
Layout.row: 1
Layout.column: 1
text: i18nc("@option:radio", "Pick a color")
exclusiveGroup: activationExclusiveGroup
checked: cfg_pickOnActivate
onCheckedChanged: cfg_pickOnActivate = checked
}
Item {
Kirigami.FormData.isSection: true
}
QtControls.RadioButton {
Layout.row: 2
Layout.column: 1
text: i18nc("@option:radio", "Show history")
exclusiveGroup: activationExclusiveGroup
checked: !cfg_pickOnActivate
}
QtControls.RadioButton {
Kirigami.FormData.label: i18nc("@label", "When pressing the keyboard shortcut:")
text: i18nc("@option:radio", "Pick a color")
checked: cfg_pickOnActivate
onCheckedChanged: cfg_pickOnActivate = checked
}
Item {
Layout.fillHeight: true
QtControls.RadioButton {
text: i18nc("@option:radio", "Show history")
checked: !cfg_pickOnActivate
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment