Commit f2647dee authored by Filip Fila's avatar Filip Fila 🌆

[comic] Modernize configuration windows

Summary:
All 3 comic's configuration windows (General, Appearance, Advanced) have been ported to QQC2 and Kirigami.FormLayout. Other changes include:

- the icon for the Appearance category is now consistent this with the icon used for this category elsewhere
- improving the wording of options
- removing the sections in Appearance and Advanced tabs
- making it explicit that the navigation buttons can always be shown or only on hover

Test Plan:
Before (General):
{F6696131}

After (General):
{F6700511}

Before (Appearance):
{F6696133}

After (Appearance):
{F6700512}

Before (Advanced):
{F6696136}

After (Advanced):
{F6700515}

Reviewers: rooty, ngraham, #vdg, #plasma

Reviewed By: ngraham, #vdg

Subscribers: abetts, mart, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D19802
parent 66241071
......@@ -28,7 +28,7 @@ ConfigModel {
}
ConfigCategory {
name: i18nc("@title", "Appearance")
icon: "image"
icon: "preferences-desktop-color"
source: "configAppearance.qml"
}
ConfigCategory {
......
......@@ -17,14 +17,17 @@
*/
import QtQuick 2.0
import QtQuick.Controls 1.1 as Controls
import QtQuick.Controls 2.5 as Controls
import QtQuick.Layouts 1.1 as Layouts
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.kirigami 2.5 as Kirigami
Layouts.ColumnLayout {
Kirigami.FormLayout {
id: root
anchors.left: parent.left
anchors.right: parent.right
signal configurationChanged
......@@ -41,42 +44,23 @@ Layouts.ColumnLayout {
maxComicLimit.value = plasmoid.nativeInterface.maxComicLimit;
}
Controls.GroupBox {
Layouts.Layout.fillWidth: true
flat: true
Layouts.RowLayout {
Kirigami.FormData.label: i18nc("@label:spinbox", "Comic cache:")
title: i18nc("@title:group", "Cache")
Layouts.RowLayout {
Layouts.Layout.alignment: Qt.AlignRight
Controls.Label {
text: i18nc("@label:spinbox", "Comic cache:")
}
Controls.SpinBox {
id: maxComicLimit
Layouts.Layout.minimumWidth: units.gridUnit * 8
suffix: i18nc("@item:valuesuffix spacing to number + unit", " strips per comic")
stepSize: 1
onValueChanged: root.configurationChanged();
}
Controls.SpinBox {
id: maxComicLimit
stepSize: 1
onValueChanged: root.configurationChanged();
}
}
Controls.GroupBox {
Layouts.Layout.fillWidth: true
flat: true
title: i18nc("@title:group", "Error Handling")
Layouts.ColumnLayout {
Controls.CheckBox {
id: showErrorPicture
text: i18nc("@option:check", "Display error when getting comic failed")
onCheckedChanged: root.configurationChanged();
}
Controls.Label {
text: i18ncp("@item:valuesuffix spacing to number + unit", "strip per comic", "strips per comic")
}
}
Item {
Layouts.Layout.fillHeight: true
Controls.CheckBox {
id: showErrorPicture
text: i18nc("@option:check", "Display error when downloading comic fails")
onCheckedChanged: root.configurationChanged();
}
}
......@@ -17,14 +17,17 @@
*/
import QtQuick 2.1
import QtQuick.Controls 1.1 as Controls
import QtQuick.Controls 2.5 as Controls
import QtQuick.Layouts 1.1 as Layouts
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.kirigami 2.5 as Kirigami
Layouts.ColumnLayout {
Kirigami.FormLayout {
id: root
anchors.left: parent.left
anchors.right: parent.right
signal configurationChanged
......@@ -47,53 +50,46 @@ Layouts.ColumnLayout {
showUrl.checked = plasmoid.nativeInterface.showComicUrl;
}
Controls.CheckBox {
id: showComicTitle
Kirigami.FormData.label: i18nc ("Heading for showing various elements of a comic", "Show:")
text: i18nc("@option:check", "Comic title")
onCheckedChanged: root.configurationChanged();
}
Controls.GroupBox {
Layouts.Layout.fillWidth: true
flat: true
title: i18nc("@title:group", "Navigation")
Controls.CheckBox {
id: showIdentifier
text: i18nc("@option:check", "Comic identifier")
onCheckedChanged: root.configurationChanged();
}
Layouts.ColumnLayout {
Controls.CheckBox {
id: showArrowsOnOver
text: i18nc("@option:check", "Show arrows only on mouse-over")
onCheckedChanged: root.configurationChanged();
}
}
Controls.CheckBox {
id: showAuthor
text: i18nc("@option:check", "Comic author")
onCheckedChanged: root.configurationChanged();
}
Controls.GroupBox {
Layouts.Layout.fillWidth: true
flat: true
Controls.CheckBox {
id: showUrl
text: i18nc("@option:check", "Comic URL")
onCheckedChanged: root.configurationChanged();
}
title: i18nc("@title:group", "Information")
Item {
Kirigami.FormData.isSection: true
}
Layouts.ColumnLayout {
Controls.CheckBox {
id: showComicTitle
text: i18nc("@option:check", "Show comic title")
onCheckedChanged: root.configurationChanged();
}
Controls.CheckBox {
id: showIdentifier
text: i18nc("@option:check", "Show comic identifier")
onCheckedChanged: root.configurationChanged();
}
Controls.CheckBox {
id: showAuthor
text: i18nc("@option:check", "Show comic author")
onCheckedChanged: root.configurationChanged();
}
Controls.CheckBox {
id: showUrl
text: i18nc("@option:check", "Show comic URL")
onCheckedChanged: root.configurationChanged();
}
}
Controls.RadioButton {
id: alwaysShowArrows
Kirigami.FormData.label: i18n ("Show navigation buttons:")
text: i18nc("@option:check", "Always")
checked: !showArrowsOnOver.checked
onCheckedChanged: root.configurationChanged();
}
Item {
Layouts.Layout.fillHeight: true
Controls.RadioButton {
id: showArrowsOnOver
text: i18nc("@option:check", "Only on hover")
onCheckedChanged: root.configurationChanged();
}
}
......@@ -17,14 +17,16 @@
*/
import QtQuick 2.0
import QtQuick.Controls 1.1 as Controls
import QtQuick.Controls 2.5 as Controls
import QtQuick.Layouts 1.1 as Layouts
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.kirigami 2.5 as Kirigami
Layouts.ColumnLayout {
Kirigami.FormLayout {
id: root
anchors.left: parent.left
anchors.right: parent.right
signal configurationChanged
......@@ -52,83 +54,71 @@ Layouts.ColumnLayout {
providerUpdateInterval.value = plasmoid.nativeInterface.providerUpdateInterval
}
Controls.GroupBox {
Layouts.Layout.fillWidth: true
flat: true
title: i18nc("@title:group", "Comic")
Layouts.ColumnLayout {
Layouts.ColumnLayout {
id: providerColumn
Repeater {
model: plasmoid.nativeInterface.availableComicsModel
delegate: Controls.CheckBox {
id: checkbox
text: model.display
checked: model.checked
property string plugin: model.plugin
Component.onCompleted: {
checkbox.checked = plasmoid.nativeInterface.tabIdentifiers.indexOf(model.plugin) !== -1
}
onCheckedChanged: root.configurationChanged();
}
Item {
Kirigami.FormData.isSection: true
}
Layouts.ColumnLayout {
id: providerColumn
Kirigami.FormData.label: i18nc("@title:group", "Comics:")
Kirigami.FormData.buddyFor: children[1] // 0 is the Repeater
Repeater {
model: plasmoid.nativeInterface.availableComicsModel
delegate: Controls.CheckBox {
id: checkbox
text: model.display
checked: model.checked
property string plugin: model.plugin
Component.onCompleted: {
checkbox.checked = plasmoid.nativeInterface.tabIdentifiers.indexOf(model.plugin) !== -1
}
}
Item {
Layouts.Layout.fillWidth: true
Layouts.Layout.fillHeight: true
Layouts.Layout.minimumHeight: units.gridUnit * 2
}
Controls.Button {
iconName: "get-hot-new-stuff"
text: i18nc("@action:button", "Get New Comics...")
onClicked: plasmoid.nativeInterface.getNewComics();
}
Controls.CheckBox {
id: middleClickCheckBox
text: i18nc("@option:check", "Middle-click on the comic to show it at its original size")
onCheckedChanged: root.configurationChanged();
}
}
}
Controls.GroupBox {
Layouts.Layout.fillWidth: true
flat: true
title: i18nc("@title:group", "Update")
Controls.Button {
icon.name: "get-hot-new-stuff"
text: i18nc("@action:button", "Get New Comics...")
onClicked: plasmoid.nativeInterface.getNewComics();
}
Layouts.ColumnLayout {
Layouts.RowLayout {
Layouts.Layout.alignment: Qt.AlignRight
Controls.Label {
text: i18nc("@label:spinbox", "Automatically update comic plugins:")
}
Controls.SpinBox {
id: providerUpdateInterval
Layouts.Layout.minimumWidth: units.gridUnit * 8
suffix: i18nc("@item:valuesuffix spacing to number + unit", " days")
stepSize: 1
onValueChanged: root.configurationChanged();
}
}
Layouts.RowLayout {
Layouts.Layout.alignment: Qt.AlignRight
Controls.Label {
text: i18nc("@label:spinbox", "Check for new comic strips:")
}
Controls.SpinBox {
id: checkNewComicStripsInterval
Layouts.Layout.minimumWidth: units.gridUnit * 8
suffix: i18nc("@item:valuesuffix spacing to number + unit (minutes)", " min")
stepSize: 1
onValueChanged: root.configurationChanged();
}
}
}
Controls.CheckBox {
id: middleClickCheckBox
text: i18nc("@option:check", "Middle-click on comic to display at original size")
onCheckedChanged: root.configurationChanged();
}
Item {
Layouts.Layout.fillHeight: true
Kirigami.FormData.isSection: true
}
Layouts.RowLayout {
Kirigami.FormData.label: i18nc("@label:spinbox", "Check for new plugins every:")
Controls.SpinBox {
id: providerUpdateInterval
stepSize: 1
onValueChanged: root.configurationChanged();
}
Controls.Label {
text: i18ncp("@item:valuesuffix spacing to number + unit", "day", "days")
}
}
Layouts.RowLayout {
Kirigami.FormData.label: i18nc("@label:spinbox", "Check for new comics every:")
Controls.SpinBox {
id: checkNewComicStripsInterval
stepSize: 1
onValueChanged: root.configurationChanged();
}
Controls.Label {
text: i18ncp("@item:valuesuffix spacing to number + unit (minutes)", "minute", "minutes")
}
}
}
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