Commit aef3f429 authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

Use consistent layouting in applets' config UI

* use ColumnLayout as root item for page
* make GroupBoxes take full width
* do not repeat page title as a group box title
parent 3d50367b
......@@ -25,12 +25,8 @@ import QtQuick.Layouts 1.1
import org.kde.kquickcontrols 2.0 as KQuickControls
QtControls.GroupBox {
width: childrenRect.width
height: childrenRect.height
flat: true
title: i18nc("@title:group", "Appearance")
ColumnLayout {
id: generalConfigPage
property alias cfg_showGrid: showGridCheckBox.checked
property alias cfg_showOffLeds: showOffLedsCheckBox.checked
......@@ -43,26 +39,40 @@ QtControls.GroupBox {
property alias cfg_useCustomColorForGrid: useCustomColorForGridCheckBox.checked
property alias cfg_customColorForGrid: customColorForGrid.color
ColumnLayout {
QtControls.CheckBox {
id: showGridCheckBox
text: i18nc("@option:check", "Draw grid")
}
QtControls.CheckBox {
id: showOffLedsCheckBox
text: i18nc("@option:check", "Show inactive LEDs")
}
QtControls.CheckBox {
id: showSecondsCheckBox
text: i18nc("@option:check", "Display seconds")
}
QtControls.CheckBox {
id: showBcdFormatCheckBox
text: i18nc("@option:check", "Display in BCD format (decimal)")
}
QtControls.Label {
text: i18nc("@title:group", "Colors")
QtControls.GroupBox {
Layout.fillWidth: true
flat: true
title: i18nc("@title:group", "Display")
ColumnLayout {
anchors.fill: parent
QtControls.CheckBox {
id: showGridCheckBox
text: i18nc("@option:check", "Draw grid")
}
QtControls.CheckBox {
id: showOffLedsCheckBox
text: i18nc("@option:check", "Show inactive LEDs")
}
QtControls.CheckBox {
id: showSecondsCheckBox
text: i18nc("@option:check", "Display seconds")
}
QtControls.CheckBox {
id: showBcdFormatCheckBox
text: i18nc("@option:check", "Display in BCD format (decimal)")
}
}
}
QtControls.GroupBox {
Layout.fillWidth: true
flat: true
title: i18nc("@title:group", "Colors")
GridLayout {
columns: 2;
QtControls.CheckBox {
......@@ -93,4 +103,8 @@ QtControls.GroupBox {
}
}
}
Item { // tighten layout
Layout.fillHeight: true
}
}
......@@ -23,10 +23,8 @@ import QtQuick.Layouts 1.1 as Layouts
import org.kde.plasma.core 2.0 as PlasmaCore
Item {
Layouts.ColumnLayout {
id: root
width: childrenRect.width
height: childrenRect.height
signal configurationChanged
......@@ -43,43 +41,42 @@ Item {
maxComicLimit.value = plasmoid.nativeInterface.maxComicLimit;
}
Controls.GroupBox {
Layouts.Layout.fillWidth: true
flat: true
Layouts.ColumnLayout {
id: mainColumn
title: i18nc("@title:group", "Cache")
Controls.GroupBox {
Layouts.Layout.fillWidth: true
title: i18nc("@title:group", "Cache")
flat: true
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("spacing to number + unit", " strips per comic")
stepSize: 1
onValueChanged: root.configurationChanged();
}
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("spacing to number + unit", " strips per comic")
stepSize: 1
onValueChanged: root.configurationChanged();
}
}
Controls.GroupBox {
Layouts.Layout.fillWidth: true
}
Controls.GroupBox {
Layouts.Layout.fillWidth: true
flat: true
title: i18nc("@title:group", "Error Handling")
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();
}
Layouts.ColumnLayout {
Controls.CheckBox {
id: showErrorPicture
text: i18nc("@option:check", "Display error when getting comic failed")
onCheckedChanged: root.configurationChanged();
}
}
}
Item {
Layouts.Layout.fillHeight: true
}
}
......@@ -23,10 +23,8 @@ import QtQuick.Layouts 1.1 as Layouts
import org.kde.plasma.core 2.0 as PlasmaCore
Item {
Layouts.ColumnLayout {
id: root
width: childrenRect.width
height: childrenRect.height
signal configurationChanged
......@@ -49,51 +47,53 @@ Item {
showUrl.checked = plasmoid.nativeInterface.showComicUrl;
}
Layouts.ColumnLayout {
id: mainColumn
Controls.GroupBox {
Layouts.Layout.fillWidth: true
Controls.GroupBox {
Layouts.Layout.fillWidth: true
flat: true
title: i18nc("@title:group", "Appearance")
flat: true
title: i18nc("@title:group", "Navigation")
Layouts.ColumnLayout {
Controls.CheckBox {
id: showArrowsOnOver
text: i18nc("@option:check", "Show arrows only on mouse-over")
onCheckedChanged: root.configurationChanged();
}
Layouts.ColumnLayout {
Controls.CheckBox {
id: showArrowsOnOver
text: i18nc("@option:check", "Show arrows only on mouse-over")
onCheckedChanged: root.configurationChanged();
}
}
Controls.GroupBox {
Layouts.Layout.fillWidth: true
title: i18nc("@title:group", "Information")
flat: 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.GroupBox {
Layouts.Layout.fillWidth: true
flat: true
title: i18nc("@title:group", "Information")
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();
}
}
}
Item {
Layouts.Layout.fillHeight: true
}
}
......@@ -23,10 +23,8 @@ import QtQuick.Layouts 1.1 as Layouts
import org.kde.plasma.core 2.0 as PlasmaCore
Item {
Layouts.ColumnLayout {
id: root
width: childrenRect.width
height: childrenRect.height
signal configurationChanged
......@@ -54,83 +52,83 @@ Item {
providerUpdateInterval.value = plasmoid.nativeInterface.providerUpdateInterval
}
Layouts.ColumnLayout {
id: mainColumn
Controls.GroupBox {
Layouts.Layout.fillWidth: true
flat: true
Controls.GroupBox {
Layouts.Layout.fillWidth: true
title: i18nc("@title:group", "Comic")
flat: true
title: i18nc("@title:group", "Comic")
Layouts.ColumnLayout {
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();
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 {
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();
}
}
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
}
Controls.GroupBox {
Layouts.Layout.fillWidth: true
flat: true
title: i18nc("@title:group", "Update")
flat: true
title: i18nc("@title:group", "Update")
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("spacing to number + unit", " days")
stepSize: 1
onValueChanged: root.configurationChanged();
}
Layouts.ColumnLayout {
Layouts.RowLayout {
Layouts.Layout.alignment: Qt.AlignRight
Controls.Label {
text: i18nc("@label:spinbox", "Automatically update comic plugins:")
}
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("spacing to number + unit (minutes)", " min")
stepSize: 1
onValueChanged: root.configurationChanged();
}
Controls.SpinBox {
id: providerUpdateInterval
Layouts.Layout.minimumWidth: units.gridUnit * 8
suffix: i18nc("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("spacing to number + unit (minutes)", " min")
stepSize: 1
onValueChanged: root.configurationChanged();
}
}
}
}
Item {
Layouts.Layout.fillHeight: true
}
}
......@@ -22,7 +22,7 @@ import QtQuick.Layouts 1.1
import org.kde.plasma.private.dict 1.0
Item {
ColumnLayout {
id: root
property string cfg_dictionary: ""
......@@ -35,52 +35,47 @@ Item {
id: syspal
}
ColumnLayout {
width: parent.width
height: parent.height
Label {
Layout.fillWidth: true
text: i18nc("@label:listbox", "Available dictionaries:")
}
Label {
Layout.fillWidth: true
text: i18nc("@label:listbox", "Available dictionaries:")
}
ScrollView {
Layout.fillWidth: true
Layout.fillHeight: true
ScrollView {
Layout.fillWidth: true
Layout.fillHeight: true
frameVisible: true
frameVisible: true
ListView {
width: parent.width
model: dictionariesModel
ListView {
delegate: Item {
width: parent.width
model: dictionariesModel
delegate: Item {
width: parent.width
height: pathText.height
Rectangle {
id: highlight
anchors.fill: parent
visible: model.id == root.cfg_dictionary
color: syspal.highlight
}
height: pathText.height
Rectangle {
id: highlight
anchors.fill: parent
visible: model.id == root.cfg_dictionary
color: syspal.highlight
}
RowLayout {
id: textLayout
anchors.fill: parent
RowLayout {
id: textLayout
anchors.fill: parent
/*Text { text: model.id }*/
Text {
id: pathText
Layout.fillWidth: true
text: model.description
color: model.id == root.cfg_dictionary ? syspal.highlightedText : syspal.text
}
}
MouseArea {
anchors.fill: parent
onClicked: root.cfg_dictionary = model.id
/*Text { text: model.id }*/
Text {
id: pathText
Layout.fillWidth: true
text: model.description
color: model.id == root.cfg_dictionary ? syspal.highlightedText : syspal.text
}
}
MouseArea {
anchors.fill: parent
onClicked: root.cfg_dictionary = model.id
}
}
}
}
......
......@@ -27,10 +27,8 @@ import QtQuick.Layouts 1.0 as QtLayouts
import QtQuick.Dialogs 1.2 as QtDialogs
import org.kde.kquickcontrols 2.0 as KQC
Item {
QtLayouts.ColumnLayout {
id: appearancePage
width: childrenRect.width
height: childrenRect.height
property alias cfg_boardSize: sizeSpinBox.value
property alias cfg_boardColor: pieceColorPicker.color
......@@ -40,91 +38,81 @@ Item {
property alias cfg_useImage: useImageCheckBox.checked
property alias cfg_imagePath: imagePathTextField.text
QtLayouts.ColumnLayout {
QtControls.GroupBox {
title: i18nc("@title:group", "Appearance")
flat: true
QtLayouts.GridLayout {
columns: 2
QtLayouts.GridLayout {
columns: 2
anchors.left: parent.left
anchors.leftMargin: units.largeSpacing
QtControls.ExclusiveGroup {
id: plainPiecesGroup
}
QtControls.Label {
text: i18nc("@label:spinbox", "Size:")
QtLayouts.Layout.alignment: Qt.AlignRight
}
QtControls.Label {
text: i18nc("@label:spinbox", "Size:")
QtLayouts.Layout.alignment: Qt.AlignRight
}
QtControls.SpinBox {
id: sizeSpinBox
}
QtControls.SpinBox {
id: sizeSpinBox
}
QtControls.Label {
text: i18nc("@label:chooser", "Piece color:")
QtLayouts.Layout.alignment: Qt.AlignRight
}
QtControls.Label {
text: i18nc("@label:chooser", "Piece color:")
QtLayouts.Layout.alignment: Qt.AlignRight
}
KQC.ColorButton {
id: pieceColorPicker
}
KQC.ColorButton {
id: pieceColorPicker
}
QtControls.Label {
text: i18nc("@label:chooser", "Number color:")