diff --git a/applets/colorpicker/package/contents/config/config.qml b/applets/colorpicker/package/contents/config/config.qml index b3ac6d06a..de985d95d 100644 --- a/applets/colorpicker/package/contents/config/config.qml +++ b/applets/colorpicker/package/contents/config/config.qml @@ -1,29 +1,29 @@ /* * Copyright 2015 Kai Uwe Broulik * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved * by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. * * 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 General Public License * along with this program. If not, see */ import org.kde.plasma.configuration 2.0 ConfigModel { ConfigCategory { name: i18nc("@title", "General") - icon: "preferences-desktop-color" + icon: "color-picker" source: "configGeneral.qml" } } diff --git a/applets/colorpicker/package/contents/ui/configGeneral.qml b/applets/colorpicker/package/contents/ui/configGeneral.qml index 6d704d84d..9ca381dca 100644 --- a/applets/colorpicker/package/contents/ui/configGeneral.qml +++ b/applets/colorpicker/package/contents/ui/configGeneral.qml @@ -1,97 +1,64 @@ /* * Copyright 2015 Kai Uwe Broulik * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved * by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. * * 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 General Public License * along with this program. If not, see */ 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 } }