Commit 12eba775 authored by Nate Graham's avatar Nate Graham 🔩

[quicklaunch] Port settings window to QQC2+Kirigami FormLayout and modernize UI

Summary:
- Port to QQC2+Kirigami FormLayout style
- Use standard import names
- Adjust some strings to sound a bit more natural
- Use Kirigami ActionTextField so that the text field can have a clear button
- Fix a bug preventing the text field from being disabled once enabled

Test Plan:
- All features still work
- Settings are saved and loaded correctly

On the desktop: {F6815666}

In a horizontal panel: {F6815665}

In a vertical panel: {F6815667}

Reviewers: #vdg, #plasma, filipf

Reviewed By: #vdg, filipf

Subscribers: filipf, plasma-devel

Tags: #plasma

Maniphest Tasks: T10586

Differential Revision: https://phabricator.kde.org/D21088
parent 864c0bf2
......@@ -18,12 +18,17 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*/
import QtQuick 2.0
import QtQuick.Layouts 1.0
import QtQuick.Controls 1.0
import QtQuick 2.5
import QtQuick.Layouts 1.3
import QtQuick.Controls 2.5 as QQC2
import org.kde.kirigami 2.8 as Kirigami
import org.kde.plasma.core 2.0 as PlasmaCore
ColumnLayout {
Kirigami.FormLayout {
anchors.right: parent.right
anchors.left: parent.left
readonly property bool vertical: plasmoid.formFactor == PlasmaCore.Types.Vertical || (plasmoid.formFactor == PlasmaCore.Types.Planar && plasmoid.height > plasmoid.width)
......@@ -32,76 +37,74 @@ ColumnLayout {
property alias cfg_enablePopup: enablePopup.checked
property alias cfg_title: title.text
GroupBox {
Layout.fillWidth: true
flat: true
title: i18nc("@title:group", "Arrangement")
QQC2.SpinBox {
id: maxSectionCount
RowLayout {
Label {
text: vertical ? i18nc("@label:spinbox", "Maximum columns:") : i18nc("@label:spinbox", "Maximum rows:")
}
Kirigami.FormData.label: vertical ? i18nc("@label:spinbox", "Maximum columns:") : i18nc("@label:spinbox", "Maximum rows:")
SpinBox {
id: maxSectionCount
minimumValue: 1
}
}
from: 1
}
GroupBox {
Layout.fillWidth: true
flat: true
title: i18nc("@title:group", "Appearance")
Item {
Kirigami.FormData.isSection: true
}
ColumnLayout {
CheckBox {
id: showLauncherNames
text: i18nc("@option:check", "Show launcher names")
}
CheckBox {
id: enablePopup
text: i18nc("@option:check", "Enable popup")
}
}
QQC2.CheckBox {
id: showLauncherNames
Kirigami.FormData.label: i18nc("@title:group", "Appearance:")
text: i18nc("@option:check", "Show launcher names")
}
GroupBox {
QQC2.CheckBox {
id: enablePopup
text: i18nc("@option:check", "Enable popup")
}
Item {
Kirigami.FormData.isSection: true
}
RowLayout {
Kirigami.FormData.label: i18nc("@title:group", "Title:")
Layout.fillWidth: true
flat: true
title: i18nc("@title:group", "Title")
visible: plasmoid.formFactor == PlasmaCore.Types.Planar
RowLayout {
anchors.fill: parent
CheckBox {
id: showTitle
checked: title.activeFocus || title.length
text: i18nc("@option:check", "Show title")
onClicked: {
if (checked) {
title.forceActiveFocus();
} else {
title.text = "";
}
}
}
QQC2.CheckBox {
id: showTitle
checked: title.length
text: i18nc("@option:check", "Show:")
TextField {
id: title
Layout.fillWidth: true
enabled: showTitle.checked
placeholderText: i18nc("@info:placeholder", "Enter title")
onClicked: {
if (checked) {
title.forceActiveFocus();
} else {
title.text = "";
}
}
}
}
Item { // tighten layout
Layout.fillHeight: true
Kirigami.ActionTextField {
id: title
enabled: showTitle.checked
Layout.fillWidth: true
placeholderText: i18nc("@info:placeholder", "Custom title")
rightActions: [
Kirigami.Action {
iconName: "edit-clear"
visible: title.text.length !== 0
onTriggered: title.text = "";
}
]
}
}
}
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