Commit 2e2cfa89 authored by Nate Graham's avatar Nate Graham 🔩

[Kicker] Modernize settings window

Summary: Port Kicker's settings window to Kirigami+FormLayout and QQC2.

Test Plan:
{F6787481}

All features tested and still work.

Reviewers: #vdg, #plasma, hein, GB_2

Reviewed By: #vdg, #plasma, hein, GB_2

Subscribers: GB_2, plasma-devel

Tags: #plasma

Maniphest Tasks: T10586

Differential Revision: https://phabricator.kde.org/D20743
parent 3024920b
......@@ -24,7 +24,7 @@ import org.kde.plasma.configuration 2.0
ConfigModel {
ConfigCategory {
name: i18n("General")
icon: "kde"
icon: "preferences-desktop-plasma"
source: "ConfigGeneral.qml"
}
}
......@@ -17,24 +17,21 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
***************************************************************************/
import QtQuick 2.0
import QtQuick.Controls 1.0
import QtQuick.Dialogs 1.2
import QtQuick.Layouts 1.0
import QtQuick 2.5
import QtQuick.Controls 2.5
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.kquickcontrolsaddons 2.0 as KQuickAddons
import org.kde.draganddrop 2.0 as DragDrop
import org.kde.kirigami 2.5 as Kirigami
import org.kde.plasma.private.kicker 0.1 as Kicker
Item {
Kirigami.FormLayout {
id: configGeneral
width: childrenRect.width
height: childrenRect.height
anchors.left: parent.left
anchors.right: parent.right
property bool isDash: (plasmoid.pluginName === "org.kde.plasma.kickerdash")
......@@ -54,22 +51,21 @@ Item {
property alias cfg_useExtraRunners: useExtraRunners.checked
property alias cfg_alignResultsToBottom: alignResultsToBottom.checked
ColumnLayout {
anchors.left: parent.left
RowLayout {
spacing: units.smallSpacing
Label {
text: i18n("Icon:")
}
Button {
id: iconButton
Layout.minimumWidth: previewFrame.width + units.smallSpacing * 2
Layout.maximumWidth: Layout.minimumWidth
Layout.minimumHeight: previewFrame.height + units.smallSpacing * 2
Layout.maximumHeight: Layout.minimumWidth
Kirigami.FormData.label: i18n("Icon:")
implicitWidth: previewFrame.width + units.smallSpacing * 2
implicitHeight: previewFrame.height + units.smallSpacing * 2
// Just to provide some visual feedback when dragging;
// cannot have checked without checkable enabled
checkable: true
checked: dropArea.containsAcceptableDrag
onPressed: iconMenu.opened ? iconMenu.close() : iconMenu.open()
DragDrop.DropArea {
id: dropArea
......@@ -114,17 +110,6 @@ Item {
onIconNameChanged: setCustomButtonImage(iconName);
}
// just to provide some visual feedback, cannot have checked without checkable enabled
checkable: true
checked: dropArea.containsAcceptableDrag
onClicked: {
checked = Qt.binding(function() { // never actually allow it being checked
return iconMenu.status === PlasmaComponents.DialogStatus.Open || dropArea.containsAcceptableDrag;
})
iconMenu.open(0, height)
}
PlasmaCore.FrameSvgItem {
id: previewFrame
anchors.centerIn: parent
......@@ -140,125 +125,111 @@ Item {
source: cfg_useCustomButtonImage ? cfg_customButtonImage : cfg_icon
}
}
}
// QQC Menu can only be opened at cursor position, not a random one
PlasmaComponents.ContextMenu {
Menu {
id: iconMenu
visualParent: iconButton
PlasmaComponents.MenuItem {
// Appear below the button
y: +parent.height
onClosed: iconButton.checked = false;
MenuItem {
text: i18nc("@item:inmenu Open icon chooser dialog", "Choose...")
icon: "document-open-folder"
icon.name: "document-open-folder"
onClicked: iconDialog.open()
}
PlasmaComponents.MenuItem {
MenuItem {
text: i18nc("@item:inmenu Reset icon to default", "Clear Icon")
icon: "edit-clear"
icon.name: "edit-clear"
onClicked: {
cfg_useCustomButtonImage = false;
cfg_icon = "start-here-kde"
cfg_useCustomButtonImage = false
}
}
}
}
GroupBox {
Layout.fillWidth: true
title: i18n("Behavior")
flat: true
ColumnLayout {
RowLayout {
Label {
text: i18n("Show applications as:")
Item {
Kirigami.FormData.isSection: true
}
ComboBox {
id: appNameFormat
Layout.fillWidth: true
Kirigami.FormData.label: i18n("Show applications as:")
model: [i18n("Name only"), i18n("Description only"), i18n("Name (Description)"), i18n("Description (Name)")]
}
}
CheckBox {
id: limitDepth
visible: !isDash
text: i18n("Flatten menu to a single level")
Item {
Kirigami.FormData.isSection: true
}
CheckBox {
id: alphaSort
text: i18n("Sort alphabetically")
}
}
}
Kirigami.FormData.label: i18n("Behavior:")
GroupBox {
Layout.fillWidth: true
text: i18n("Sort applications alphabetically")
}
title: i18n("Categories")
CheckBox {
id: limitDepth
flat: true
visible: !isDash
ColumnLayout {
RowLayout {
Label {
text: i18n("Show:")
text: i18n("Flatten sub-menus to a single level")
}
ComboBox {
id: recentOrdering
Layout.fillWidth: true
model: [i18n("Recently used"), i18n("Often used")]
}
Item {
Kirigami.FormData.isSection: true
}
CheckBox {
id: showRecentApps
Kirigami.FormData.label: i18n("Show categories:")
text: recentOrdering.currentIndex == 0
? i18n("Show recent applications")
: i18n("Show often used applications")
? i18n("Recent applications")
: i18n("Often used applications")
}
CheckBox {
id: showRecentDocs
text: recentOrdering.currentIndex == 0
? i18n("Show recent documents")
: i18n("Show often used documents")
? i18n("Recent documents")
: i18n("Often used documents")
}
CheckBox {
id: showRecentContacts
text: recentOrdering.currentIndex == 0
? i18n("Show recent contacts")
: i18n("Show often used contacts")
}
}
? i18n("Recent contacts")
: i18n("Often used contacts")
}
GroupBox {
Layout.fillWidth: true
ComboBox {
id: recentOrdering
title: i18n("Search")
Kirigami.FormData.label: i18n("Sort items in categories by:")
model: [i18nc("@item:inlistbox Sort items in categories by [Recently used | Often used]", "Recently used"), i18nc("@item:inlistbox Sort items in categories by [Recently used | Ofetn used]", "Often used")]
}
flat: true
Item {
Kirigami.FormData.isSection: true
}
ColumnLayout {
CheckBox {
id: useExtraRunners
Kirigami.FormData.label: i18n("Search:")
text: i18n("Expand search to bookmarks, files and emails")
}
......@@ -269,7 +240,4 @@ Item {
text: i18n("Align search results to bottom")
}
}
}
}
}
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