Commit ad66b200 authored by Nate Graham's avatar Nate Graham 🔩

[Timer] 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

Test Plan:
{F6800650}
{F6800644}
Everything works.

Reviewers: #vdg, #plasma, davidedmundson, filipf

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

Subscribers: plasma-devel

Tags: #plasma

Maniphest Tasks: T10586

Differential Revision: https://phabricator.kde.org/D20905
parent c097927d
......@@ -16,53 +16,38 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
*/
import QtQuick 2.2
import QtQuick.Controls 1.3 as QtControls
import QtQuick.Layouts 1.0 as QtLayouts
import QtQuick 2.5
import QtQuick.Controls 2.5 as QQC2
import QtQuick.Layouts 1.0
QtLayouts.ColumnLayout {
import org.kde.kirigami 2.5 as Kirigami
Kirigami.FormLayout {
id: generalPage
property alias cfg_runCommand: runCommand.checked
property alias cfg_command: command.text
QtControls.GroupBox {
id: runCommandGroup
QtLayouts.Layout.fillWidth: true
flat: true
title: i18nc("@title:group", "Run Command")
RowLayout {
Layout.fillWidth: true
QtLayouts.ColumnLayout {
anchors.fill: parent
Kirigami.FormData.label: i18nc("@title:label", "After timer completes:")
QtControls.CheckBox {
id: runCommand
text: i18nc("@option:check", "Execute command")
onClicked: {
if (checked) {
command.forceActiveFocus();
}
}
}
QtLayouts.RowLayout {
QtControls.Label {
enabled: runCommand.checked
text: i18nc("@label:textbox", "Command:")
}
QtControls.TextField {
id: command
QtLayouts.Layout.fillWidth: true
enabled: runCommand.checked
QQC2.CheckBox {
id: runCommand
text: i18nc("@option:check", "Execute command:")
onClicked: {
if (checked) {
command.forceActiveFocus();
}
}
}
}
Item { // tighten layout
QtLayouts.Layout.fillHeight: true
QQC2.TextField {
id: command
Layout.fillWidth: true
enabled: runCommand.checked
}
}
}
......@@ -16,11 +16,13 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
*/
import QtQuick 2.2
import QtQuick.Controls 1.0 as QtControls
import QtQuick.Layouts 1.0 as QtLayouts
import QtQuick 2.5
import QtQuick.Controls 2.5 as QQC2
import QtQuick.Layouts 1.0
QtLayouts.ColumnLayout {
import org.kde.kirigami 2.5 as Kirigami
Kirigami.FormLayout {
id: appearancePage
property alias cfg_showTitle: showTitle.checked
......@@ -31,81 +33,61 @@ QtLayouts.ColumnLayout {
property alias cfg_showNotification: showNotification.checked
property alias cfg_notificationText: notificationText.text
QtControls.GroupBox {
id: displayGroup
RowLayout {
Layout.fillWidth: true
QtLayouts.Layout.fillWidth: true
flat: true
Kirigami.FormData.label: i18nc("@title:label", "Display:")
title: i18nc("@title:group", "Display")
QQC2.CheckBox {
id: showTitle
QtLayouts.ColumnLayout {
anchors.fill: parent
QtControls.CheckBox {
id: showTitle
text: i18nc("@option:check", "Show title");
onClicked: {
if (checked) {
title.forceActiveFocus();
}
}
}
QtLayouts.RowLayout {
QtControls.Label {
enabled: showTitle.checked
text: i18nc("@label:textbox", "Title:")
}
QtControls.TextField {
id: title
QtLayouts.Layout.fillWidth: true
enabled: showTitle.checked
text: i18nc("@option:check", "Show title:");
onClicked: {
if (checked) {
title.forceActiveFocus();
}
}
}
QtControls.CheckBox {
id: showSeconds
text: i18nc("@option:check", "Show seconds");
}
QQC2.TextField {
id: title
Layout.fillWidth: true
enabled: showTitle.checked
}
}
QtControls.GroupBox {
id: notificationGroup
QQC2.CheckBox {
id: showSeconds
text: i18nc("@option:check", "Show seconds");
}
QtLayouts.Layout.fillWidth: true
flat: true
title: i18nc("@title:group", "Notifications")
Item {
Kirigami.FormData.isSection: true
}
QtLayouts.ColumnLayout {
anchors.fill: parent
QtControls.CheckBox {
id: showNotification
text: i18nc("@option:check", "Show notification");
onClicked: {
if (checked) {
notificationText.forceActiveFocus();
}
}
}
QtLayouts.RowLayout {
QtControls.Label {
enabled: showNotification.checked
text: i18nc("@label:textbox", "Text:")
}
QtControls.TextField {
id: notificationText
QtLayouts.Layout.fillWidth: true
enabled: showNotification.checked
RowLayout {
Layout.fillWidth: true
Kirigami.FormData.label: i18nc("@title:label", "Notifications:")
QQC2.CheckBox {
id: showNotification
text: i18nc("@option:check", "Show notification text:");
onClicked: {
if (checked) {
notificationText.forceActiveFocus();
}
}
}
}
Item { // tighten layout
QtLayouts.Layout.fillHeight: true
QQC2.TextField {
id: notificationText
Layout.fillWidth: true
enabled: showNotification.checked
}
}
}
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