Commit 7bbe5fc1 authored by Nate Graham's avatar Nate Graham 🔩

[Kickoff] Modernize settings window layout

Summary:
In this patch, the settings window is modernized in the following ways:
- Adopt Kirigami+FormLayout style
- Port away from QQC2
- Make the tab switcher UI take up less horizontal space, so the buttons don't get cut off at the default window size

Test Plan: {F6780579}

Reviewers: #plasma, #vdg, filipf, hein

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

Subscribers: hein, filipf, GB_2, broulik, plasma-devel

Tags: #plasma

Maniphest Tasks: T10586

Differential Revision: https://phabricator.kde.org/D20612
parent 3ffe80cb
......@@ -22,8 +22,8 @@ import org.kde.plasma.configuration 2.0
ConfigModel {
ConfigCategory {
name: i18n("Appearance")
icon: "preferences-desktop-color"
name: i18n("General")
icon: "preferences-desktop-plasma"
source: "ConfigGeneral.qml"
}
}
......@@ -16,17 +16,17 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
*/
import QtQuick 2.0
import QtQuick.Layouts 1.0 as Layouts
import QtQuick.Controls 1.0 as Controls
import QtQuick 2.5
import QtQml.Models 2.1
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.kirigami 2.5 as Kirigami
GridView {
id: configButtons
cellHeight: units.gridUnit * 5
cellHeight: units.gridUnit * 6 + units.smallSpacing
cellWidth: units.gridUnit * 6
width: cellWidth * 5
......@@ -209,4 +209,16 @@ GridView {
}
}
}
Kirigami.Heading {
level: 2
text: i18n("Active Tabs")
anchors.bottom: configButtons.top
}
Kirigami.Heading {
level: 2
text: i18n("Inactive Tabs")
anchors.bottom: configButtons.verticalCenter
}
}
......@@ -16,18 +16,16 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
*/
import QtQuick 2.0
import QtQuick 2.5
import QtQuick.Layouts 1.1
import QtQuick.Controls 1.0 as QtControls
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.plasma.extras 2.0 as PlasmaExtras
import org.kde.kirigami 2.5 as Kirigami
ColumnLayout {
property string cfg_icon: plasmoid.configuration.icon
property alias cfg_switchTabsOnHover: switchTabsOnHoverCheckbox.checked
property alias cfg_showAppsByName: showApplicationsByNameCheckbox.checked
......@@ -35,36 +33,22 @@ ColumnLayout {
property alias cfg_alphaSort: alphaSort.checked
property alias cfg_menuItems: configButtons.menuItems
spacing: units.smallSpacing
Kirigami.FormLayout {
RowLayout {
spacing: units.smallSpacing
Button {
id: iconButton
QtControls.Label {
text: i18n("Icon:")
}
Kirigami.FormData.label: i18n("Icon:")
QtControls.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
implicitWidth: previewFrame.width + units.smallSpacing * 2
implicitHeight: previewFrame.height + units.smallSpacing * 2
KQuickAddons.IconDialog {
id: iconDialog
onIconNameChanged: cfg_icon = iconName || "start-here-kde" // TODO use actual default
onIconNameChanged: cfg_icon = iconName || "start-here-kde"
}
// just to provide some visual feedback, cannot have checked without checkable enabled
checkable: true
onClicked: {
checked = Qt.binding(function() { // never actually allow it being checked
return iconMenu.status === PlasmaComponents.DialogStatus.Open
})
iconMenu.open(0, height)
}
onClicked: iconMenu.opened ? iconMenu.close() : iconMenu.open()
PlasmaCore.FrameSvgItem {
id: previewFrame
......@@ -81,88 +65,65 @@ ColumnLayout {
source: cfg_icon
}
}
}
// QQC Menu can only be opened at cursor position, not a random one
PlasmaComponents.ContextMenu {
id: iconMenu
visualParent: iconButton
Menu {
id: iconMenu
PlasmaComponents.MenuItem {
text: i18nc("@item:inmenu Open icon chooser dialog", "Choose...")
icon: "document-open-folder"
onClicked: iconDialog.open()
}
PlasmaComponents.MenuItem {
text: i18nc("@item:inmenu Reset icon to default", "Clear Icon")
icon: "edit-clear"
onClicked: cfg_icon = "start-here-kde" // TODO reset to actual default
// Appear below the button
y: +parent.height
MenuItem {
text: i18nc("@item:inmenu Open icon chooser dialog", "Choose...")
icon.name: "document-open-folder"
onPressed: iconDialog.open()
}
MenuItem {
text: i18nc("@item:inmenu Reset icon to default", "Clear Icon")
icon.name: "edit-clear"
onClicked: cfg_icon = "start-here-kde"
}
}
}
}
QtControls.CheckBox {
id: switchTabsOnHoverCheckbox
text: i18n("Switch tabs on hover")
}
QtControls.CheckBox {
id: showApplicationsByNameCheckbox
text: i18n("Show applications by name")
}
Item {
Kirigami.FormData.isSection: true
}
QtControls.CheckBox {
id: useExtraRunners
text: i18n("Expand search to bookmarks, files and emails")
}
CheckBox {
id: switchTabsOnHoverCheckbox
QtControls.CheckBox {
id: alphaSort
text: i18n("Sort alphabetically")
}
Kirigami.FormData.label: i18n("General:")
Item {
width: height
height: units.gridUnit / 2
}
text: i18n("Switch tabs on hover")
}
SystemPalette {
id: palette
}
CheckBox {
id: showApplicationsByNameCheckbox
text: i18n("Show applications by name")
}
PlasmaExtras.Heading {
level: 2
text: i18n("Menu Buttons")
color: palette.text
}
CheckBox {
id: useExtraRunners
text: i18n("Expand search to bookmarks, files and emails")
}
Row {
spacing: units.gridUnit
Column {
QtControls.Label {
text: i18n("Visible Tabs")
height: configButtons.cellHeight
}
QtControls.Label {
text: i18n("Hidden Tabs")
height: configButtons.cellHeight
}
CheckBox {
id: alphaSort
text: i18n("Sort alphabetically")
}
Column {
ConfigButtons {
id: configButtons
}
Item {
Kirigami.FormData.isSection: true
}
}
QtControls.Label {
ConfigButtons {
id: configButtons
}
Label {
Layout.fillWidth: true
text: i18n("Drag tabs between the boxes to show/hide them, or reorder the visible tabs by dragging.")
wrapMode: Text.WordWrap
}
Item {
//spacer
Layout.fillHeight: true
}
}
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