diff --git a/package/contents/ui/CompactItem.qml b/package/contents/ui/CompactItem.qml index 9b7bb39..f23233f 100644 --- a/package/contents/ui/CompactItem.qml +++ b/package/contents/ui/CompactItem.qml @@ -57,7 +57,7 @@ GridLayout { Layout.minimumWidth: iconAndText.vertical ? 0 : sizehelperText.paintedWidth Layout.maximumWidth: iconAndText.vertical ? Infinity : Layout.minimumWidth - Layout.minimumHeight: iconAndText.vertical ? sizehelperText.paintedHeight : 0 + Layout.minimumHeight: iconAndText.vertical ? sizehelperText.paintedHeight : (main.onDesktop ? sizehelperText.paintedHeight : 0) Layout.maximumHeight: iconAndText.vertical ? Layout.minimumHeight : Infinity Text { diff --git a/package/contents/ui/CompactRepresentation.qml b/package/contents/ui/CompactRepresentation.qml index 5ea60b4..61caf29 100644 --- a/package/contents/ui/CompactRepresentation.qml +++ b/package/contents/ui/CompactRepresentation.qml @@ -63,13 +63,15 @@ Loader { anchors.bottomMargin: - defaultWidgetSize * 0.05 verticalAlignment: Text.AlignBottom width: parent.width + font.pixelSize: lastReloadedNotifier.height fontSizeMode: Text.Fit - font.pointSize: -1 - minimumPixelSize: 1 + minimumPixelSize: 10 color: Kirigami.Theme.highlightColor text: lastReloadedText elide: Text.ElideRight + wrapMode: Text.NoWrap visible: false + z: 1 } @@ -78,6 +80,7 @@ Loader { anchors.fill: parent visible: false running: false + z: 1 states: [ State { @@ -120,7 +123,7 @@ Loader { onEntered: { if (showLastReloadedTime) { - lastReloadedNotifier.visible = !plasmoid.expanded + lastReloadedNotifier.visible = !main.expanded } } @@ -147,7 +150,7 @@ Loader { PlasmaCore.ToolTipArea { id: toolTipArea anchors.fill: parent - active: !plasmoid.expanded + active: !main.expanded interactive: true mainText: main.currentPlace.alias subText: main.toolTipSubText diff --git a/package/contents/ui/config/ConfigAppearance.qml b/package/contents/ui/config/ConfigAppearance.qml index 763601a..b956c47 100644 --- a/package/contents/ui/config/ConfigAppearance.qml +++ b/package/contents/ui/config/ConfigAppearance.qml @@ -58,118 +58,84 @@ KCM.SimpleKCM { id: layoutTypeGroup } - GridLayout { - anchors.left: parent.left - anchors.right: parent.right - columns: 3 - - Item { - width: 2 - height: 10 - Layout.columnSpan: 3 + Kirigami.FormLayout { + Kirigami.Separator { + Kirigami.FormData.isSection: true + Kirigami.FormData.label: i18n("Layout") } - Label { - text: i18n("Layout") - Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft - font.bold: true - Layout.columnSpan: 3 - } - Label { - text: i18n("Layout type") + ":" - Layout.alignment: Qt.AlignVCenter | Qt.AlignRight - } RadioButton { + Kirigami.FormData.label: i18n("Layout type") + ":" id: layoutTypeRadioHorizontal + Layout.row: 0 + Layout.column: 0 ButtonGroup.group: layoutTypeGroup text: i18n("Horizontal") onCheckedChanged: if (checked) cfg_layoutType = 0; } - Label { - text: i18n("NOTE: Setting layout type for in-tray plasmoid has no effect.") - Layout.rowSpan: 3 - Layout.preferredWidth: 250 - wrapMode: Text.WordWrap - } - Item { - width: 2 - height: 2 - Layout.rowSpan: 2 - } RadioButton { id: layoutTypeRadioVertical + Layout.row: 1 + Layout.column: 0 ButtonGroup.group: layoutTypeGroup text: i18n("Vertical") onCheckedChanged: if (checked) cfg_layoutType = 1; } RadioButton { id: layoutTypeRadioCompact + Layout.row: 2 + Layout.column: 0 ButtonGroup.group: layoutTypeGroup text: i18n("Compact") onCheckedChanged: if (checked) cfg_layoutType = 2; } - Item { - width: 2 - height: 20 - Layout.columnSpan: 3 - } - Label { - text: i18n("In-Tray Settings") - Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft - font.bold: true - Layout.columnSpan: 3 + text: i18n("NOTE: Setting layout type for in-tray plasmoid has no effect.") + font: Kirigami.Theme.smallFont + Layout.preferredWidth: 250 + wrapMode: Text.WordWrap } - - Label { - id: timeoutLabel - text: i18n("Active timeout") + ":" - Layout.alignment: Qt.AlignVCenter | Qt.AlignRight - height: inTrayActiveTimeoutSec.height - // anchors.verticalCenter: inTrayActiveTimeoutSec.verticalCenter + Kirigami.Separator { + Kirigami.FormData.isSection: true + Kirigami.FormData.label: i18n("In-Tray Settings") } - Item { + + RowLayout { + Kirigami.FormData.label: i18n("Active timeout") + ":" + spacing: Kirigami.Units.smallSpacing SpinBox { id: inTrayActiveTimeoutSec Layout.alignment: Qt.AlignVCenter stepSize: 10 from: 10 to: 8000 - anchors.verticalCenter: parent.verticalCenter // suffix: i18nc("Abbreviation for seconds", "sec") } Label { text: i18nc("Abbreviation for seconds", "sec") - anchors.verticalCenter: parent.verticalCenter - anchors.left:inTrayActiveTimeoutSec.right - anchors.leftMargin: 4 } } + Label { text: i18n("NOTE: After this timeout widget will be hidden in system tray until refreshed. You can always set the widget to be always \"Shown\" in system tray \"Entries\" settings.") - Layout.rowSpan: 3 + font: Kirigami.Theme.smallFont Layout.preferredWidth: 250 wrapMode: Text.WordWrap } - Item { - width: 2 - height: 20 - Layout.columnSpan: 3 + Kirigami.FormData.isSection: true } - Label { - text: i18n("Widget font style") + ":" - Layout.alignment: Qt.AlignVCenter | Qt.AlignRight - } ComboBox { + Kirigami.FormData.label: i18n("Widget font style") + ":" id: fontFamilyComboBox Layout.fillWidth: true currentIndex: 0 - Layout.minimumWidth: Kirigami.Units.gridUnit * 10 + //Layout.minimumWidth: Kirigami.Units.gridUnit * 10 + Layout.preferredWidth: 300 model: fontsModel textRole: "text" @@ -180,41 +146,28 @@ KCM.SimpleKCM { } } } - Item { - width: 2 - height: 20 - Layout.columnSpan: 3 - } - Label { - text: i18n("Show last reloaded time") + ":" - Layout.alignment: Qt.AlignVCenter | Qt.AlignRight + Item { + Kirigami.FormData.isSection: true } CheckBox { + Kirigami.FormData.label: i18n("Show last reloaded time") + ":" id: showLastReloadedTime Layout.fillWidth: true Layout.alignment: Qt.AlignLeft } Item { - width: 2 - height: 20 - Layout.columnSpan: 3 + Kirigami.FormData.isSection: true } - Label { - text: i18n("Widget font size") + ":" - Layout.alignment: Qt.AlignVCenter | Qt.AlignRight - // anchors.verticalCenter: widgetFontSize.verticalCenter - - - } - Item { + RowLayout { + Kirigami.FormData.label: i18n("Widget font size") + ":" + spacing: Kirigami.Units.smallSpacing SpinBox { id: widgetFontSize Layout.alignment: Qt.AlignVCenter - anchors.verticalCenter: parent.verticalCenter // decimals: 0 stepSize: 1 from: 4 @@ -225,8 +178,6 @@ KCM.SimpleKCM { } } Label { - anchors.verticalCenter: parent.verticalCenter - anchors.left:widgetFontSize.right text: i18nc("pixels", "px") } } diff --git a/package/contents/ui/config/ConfigGeneral.qml b/package/contents/ui/config/ConfigGeneral.qml index 4ff4979..4cd9ae9 100644 --- a/package/contents/ui/config/ConfigGeneral.qml +++ b/package/contents/ui/config/ConfigGeneral.qml @@ -193,62 +193,60 @@ KCM.SimpleKCM { // ConfigGeneral home page ColumnLayout { - id: rhsColumn - width: parent.width - spacing: 2 + spacing: 0 - Label { - text: i18n("Plasmoid version") + ": " + plasmoid.metaData.version - Layout.alignment: Qt.AlignRight - } - - Label { + Kirigami.Heading { text: i18n("Location") - font.bold: true - Layout.alignment: Qt.AlignLeft + type: Kirigami.Heading.Type.Primary + level: 3 + Layout.alignment: Qt.AlignCenter } - HorizontalHeaderView { - id: myhorizontalHeader - // anchors.left: mytableView.left - // anchors.leftMargin: 0 - // anchors.topMargin: 2 - // anchors.top: parent.top - // anchors.right: parent.right - // anchors.rightMargin: 2 + Kirigami.Separator { + Layout.fillWidth: true + Layout.margins: Kirigami.Units.largeSpacing + } - syncView: mytableView - clip: true - model: ListModel { - Component.onCompleted: { - append({ display: i18n("Source") }); - append({ display: i18n("Place Identifier") }); - append({ display: i18n("Displayed as") }); - append({ display: i18n("Action") }); - // append({ display: ("TBA") }); - } + HorizontalHeaderView { + id: myhorizontalHeader + // anchors.left: mytableView.left + // anchors.leftMargin: 0 + // anchors.topMargin: 2 + // anchors.top: parent.top + // anchors.right: parent.right + // anchors.rightMargin: 2 + + syncView: mytableView + clip: true + model: ListModel { + Component.onCompleted: { + append({ display: i18n("Source") }); + append({ display: i18n("Place Identifier") }); + append({ display: i18n("Displayed as") }); + append({ display: i18n("Action") }); + // append({ display: ("TBA") }); } } + } ScrollView { id: placesTable width: parent.width clip: true - Layout.preferredHeight: 180 + Layout.maximumHeight: 180 Layout.preferredWidth: parent.width - Layout.columnSpan: 2 - TableView { anchors.fill: parent - property var columnWidths: [10, 40, 25, 22] + property var columnWidths: [15, 35, 25, 25] columnWidthProvider: function (column) { - let aw = placesTable.width - placesTable.effectiveScrollBarWidth - return parseInt(aw * columnWidths[column] / 100 ) - + let minW = 500 + let horizontalMargin = placesTable.effectiveScrollBarWidth !== 0 ? placesTable.effectiveScrollBarWidth : Kirigami.Units.smallSpacing + let aw = (placesTable.width > minW ? placesTable.width : minW) - horizontalMargin + return parseInt(aw * columnWidths[column] / 100) } implicitHeight: 200 - implicitWidth: 600 + implicitWidth: 500 clip: true interactive: true rowSpacing: 1 @@ -268,6 +266,7 @@ KCM.SimpleKCM { DelegateChoice { column: 0 delegate: Rectangle { + implicitHeight: Kirigami.Units.gridUnit * 2 color: (row % 2) === 0 ? backgroundColor : alternateBackgroundColor Text { anchors.fill: parent @@ -315,83 +314,91 @@ KCM.SimpleKCM { DelegateChoice { column: 3 id: myChoice3 - delegate: GridLayout { - columnSpacing: 1 - Text { - id: myrowValue - visible: false - text: display - } - Button { - id:myButton1 - icon.name: 'go-up' - enabled: row === 0 ? false : true - MouseArea { - anchors.fill: parent - onClicked: { - if (row > 0) { - placesModel.moveRow(row, row - 1, 1) - placesModelChanged() + delegate: Rectangle { + color: (row % 2) === 0 ? backgroundColor : alternateBackgroundColor + GridLayout { + anchors.fill: parent + columnSpacing: 1 + Text { + id: myrowValue + visible: false + text: "display" + } + Button { + id:myButton1 + icon.name: 'go-up' + enabled: row === 0 ? false : true + Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter + MouseArea { + anchors.fill: parent + onClicked: { + if (row > 0) { + placesModel.moveRow(row, row - 1, 1) + placesModelChanged() + } } } } - } - Button { - id:myButton2 - icon.name: 'go-down' - enabled: row == (placesModel.rowCount - 1) ? false: true - MouseArea { - anchors.fill: parent - onClicked: { - if (row < placesModel.rowCount) { - placesModel.moveRow(row, row + 1, 1) - placesModelChanged() + Button { + id:myButton2 + icon.name: 'go-down' + enabled: row == (placesModel.rowCount - 1) ? false: true + Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter + MouseArea { + anchors.fill: parent + onClicked: { + if (row < placesModel.rowCount) { + placesModel.moveRow(row, row + 1, 1) + placesModelChanged() + } } } } - } - Button { - icon.name: 'list-remove' - MouseArea { - anchors.fill: parent - onClicked: { - placesModel.removeRow(row, 1) - placesModelChanged() + Button { + icon.name: 'list-remove' + Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter + MouseArea { + anchors.fill: parent + onClicked: { + placesModel.removeRow(row, 1) + placesModelChanged() + } } + enabled: (placesModel.rowCount > 1) } - enabled: (placesModel.rowCount > 1) - } - Button { - icon.name: 'entry-edit' - MouseArea { - anchors.fill: parent - onClicked: { - let entry = placesModel.getRow(row) - if (entry.providerId === "metno") { - let url = entry.placeIdentifier - newMetnoUrl.text = url - var data = url.match(RegExp("([+-]?[0-9]{1,5}[.]?[0-9]{0,5})","g")) - newMetnoCityLatitudeField.text = Number(data[0]).toLocaleString(Qt.locale(),"f",5) - newMetnoCityLongitudeField.text = Number(data[1]).toLocaleString(Qt.locale(),"f",5) - newMetnoCityAltitudeField.text = (data[2] === undefined) ? 0:data[2] - dbgprint("timezone ID=" + entry.timezoneID) - addMetnoCityIdDialog.timezoneID = entry.timezoneID - for (var i = 0; i < timezoneDataModel.count; i++) { - if (timezoneDataModel.get(i).id == Number(entry.timezoneID)) { - tzComboBox.currentIndex = i - break + Button { + icon.name: 'entry-edit' + Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter + MouseArea { + anchors.fill: parent + onClicked: { + let entry = placesModel.getRow(row) + if (entry.providerId === "metno") { + let url = entry.placeIdentifier + newMetnoUrl.text = url + var data = url.match(RegExp("([+-]?[0-9]{1,5}[.]?[0-9]{0,5})","g")) + newMetnoCityLatitudeField.text = Number(data[0]).toLocaleString(Qt.locale(),"f",5) + newMetnoCityLongitudeField.text = Number(data[1]).toLocaleString(Qt.locale(),"f",5) + newMetnoCityAltitudeField.text = (data[2] === undefined) ? 0:data[2] + dbgprint("timezone ID=" + entry.timezoneID) + addMetnoCityIdDialog.timezoneID = entry.timezoneID + for (var i = 0; i < timezoneDataModel.count; i++) { + if (timezoneDataModel.get(i).id == Number(entry.timezoneID)) { + tzComboBox.currentIndex = i + break + } } + newMetnoCityAlias.text = entry.placeAlias + addMetnoCityIdDialog.placeNumberID = row + addMetnoCityIdDialog.open() } - newMetnoCityAlias.text = entry.placeAlias - addMetnoCityIdDialog.placeNumberID = row - addMetnoCityIdDialog.open() - } - if (entry.providerId === "owm") { - newOwmCityIdField.text = "https://openweathermap.org/city/"+entry.placeIdentifier - newOwmCityAlias.text = entry.placeAlias - addOwmCityIdDialog.placeNumberID = row - addOwmCityIdDialog.open() + if (entry.providerId === "owm") { + newOwmCityIdField.text = "https://openweathermap.org/city/"+entry.placeIdentifier + newOwmCityAlias.text = entry.placeAlias + addOwmCityIdDialog.placeNumberID = row + addOwmCityIdDialog.open() + } } } } @@ -402,11 +409,18 @@ KCM.SimpleKCM { } } - Row { + + Kirigami.FormLayout { + + Item { + Kirigami.FormData.isSection: true + } + Button { + Kirigami.FormData.label: i18n("Add Open Weather Map Place") + ":" icon.name: 'list-add' - text: 'OWM' - width: 100 + //text: 'OWM' + //Layout.minimumWidth: Kirigami.Units.gridUnit * 6 onClicked: { addOwmCityIdDialog.placeNumberID = -1 newOwmCityIdField.text = '' @@ -417,11 +431,11 @@ KCM.SimpleKCM { } Button { + Kirigami.FormData.label: i18n("Add Met.no Map Place") + ":" icon.name: 'list-add' - text: 'metno' - width: 100 + //text: 'metno' + //Layout.minimumWidth: Kirigami.Units.gridUnit * 6 onClicked: { - newMetnoCityAlias.text = '' newMetnoCityLatitudeField.text = '' newMetnoCityLongitudeField.text = '' @@ -432,166 +446,166 @@ KCM.SimpleKCM { addMetnoCityIdDialog.open() } } - } - Label { - topPadding: 16 - bottomPadding: 6 - text: i18n("Miscellaneous") - font.bold: true - Layout.alignment: Qt.AlignLeft - } + Kirigami.Separator { + Kirigami.FormData.isSection: true + Kirigami.FormData.label: i18n("Miscellaneous") + } - Item { - id: reloadItem - width: parent.width + RowLayout { + Kirigami.FormData.label: i18n("Reload interval") + ":" + id: reloadItem + spacing: Kirigami.Units.smallSpacing - Label { - id: reloadLabel1 - anchors.verticalCenter: parent.verticalCenter - anchors.left: parent.left - text: i18n("Reload interval") + ":" - Layout.alignment: Qt.AlignLeft - rightPadding: 6 - } - SpinBox { - anchors.verticalCenter: parent.verticalCenter - anchors.left:reloadLabel1.right - id: reloadIntervalMin - stepSize: 10 + SpinBox { + id: reloadIntervalMin + stepSize: 10 - from: 20 - to: 120 - // suffix: i18nc("Abbreviation for minutes", "min") + from: 20 + to: 120 + // suffix: i18nc("Abbreviation for minutes", "min") + } + Label { + text: i18nc("Abbreviation for minutes", "min") + leftPadding: 6 + } } - Label { - anchors.verticalCenter: parent.verticalCenter - anchors.left:reloadIntervalMin.right - text: i18nc("Abbreviation for minutes", "min") - leftPadding: 6 + + CheckBox { + Kirigami.FormData.label: "Debug" + id: debugLogging + checked: false + Layout.alignment: Qt.AlignLeft + visible: false } - } - CheckBox { - id: debugLogging - checked: false - text: "Debug" - Layout.alignment: Qt.AlignLeft - visible: false + Label { + Kirigami.FormData.label: i18n("Plasmoid version") + ":" + text: plasmoid.metaData.version + Layout.alignment: Qt.AlignRight + } } - } - Item { - anchors.bottom: parent.bottom - Rectangle { - anchors.fill: parent - // anchors.top: + Kirigami.Separator { + Layout.margins: Kirigami.Units.gridUnit } - Label { - id: attribution1 - anchors.bottom: attribution2.top - anchors.bottomMargin: 2 - font: Kirigami.Theme.smallFont - text: i18n("Met.no weather forecast data provided by The Norwegian Meteorological Institute.") - MouseArea { - cursorShape: Qt.PointingHandCursor - anchors.fill: attribution1 - hoverEnabled: true + ColumnLayout { + spacing: 0 - onClicked: { - Qt.openUrlExternally('https://www.met.no/en/About-us') - } + Label { + id: attribution1 + font: Kirigami.Theme.smallFont + text: i18n("Met.no weather forecast data provided by The Norwegian Meteorological Institute.") + Layout.fillHeight: true + Layout.fillWidth: true + wrapMode: Text.WordWrap + MouseArea { + cursorShape: Qt.PointingHandCursor + anchors.fill: attribution1 + + hoverEnabled: true + + onClicked: { + Qt.openUrlExternally('https://www.met.no/en/About-us') + } - onEntered: { - attribution1.font.underline = true - } + onEntered: { + attribution1.font.underline = true + } - onExited: { - attribution1.font.underline = false + onExited: { + attribution1.font.underline = false + } } } - } - Label { - id: attribution2 - anchors.bottom: attribution3.top - anchors.bottomMargin: 2 - font: Kirigami.Theme.smallFont - text: i18n("Sunrise/sunset data provided by Sunrise - Sunset.") - MouseArea { - cursorShape: Qt.PointingHandCursor - anchors.fill: attribution2 - hoverEnabled: true - - onClicked: { - Qt.openUrlExternally('https://sunrise-sunset.org/about') - } + Label { + id: attribution2 + font: Kirigami.Theme.smallFont + text: i18n("Sunrise/sunset data provided by Sunrise - Sunset.") + Layout.fillHeight: true + Layout.fillWidth: true + wrapMode: Text.WordWrap + MouseArea { + cursorShape: Qt.PointingHandCursor + anchors.fill: attribution2 + + hoverEnabled: true + + onClicked: { + Qt.openUrlExternally('https://sunrise-sunset.org/about') + } - onEntered: { - attribution2.font.underline = true - } + onEntered: { + attribution2.font.underline = true + } - onExited: { - attribution2.font.underline = false + onExited: { + attribution2.font.underline = false + } } } - } - Label { - id: attribution3 - anchors.bottom: attribution4.top - anchors.bottomMargin: 2 - font: Kirigami.Theme.smallFont - text: i18n("OWM weather forecast data provided by OpenWeather.") - MouseArea { - cursorShape: Qt.PointingHandCursor - anchors.fill: attribution3 - hoverEnabled: true - - onClicked: { - Qt.openUrlExternally('https://openweathermap.org/about-us') - } + Label { + id: attribution3 + font: Kirigami.Theme.smallFont + text: i18n("OWM weather forecast data provided by OpenWeather.") + Layout.fillHeight: true + Layout.fillWidth: true + wrapMode: Text.WordWrap + MouseArea { + cursorShape: Qt.PointingHandCursor + anchors.fill: attribution3 + + hoverEnabled: true + + onClicked: { + Qt.openUrlExternally('https://openweathermap.org/about-us') + } - onEntered: { - attribution3.font.underline = true - } + onEntered: { + attribution3.font.underline = true + } - onExited: { - attribution3.font.underline = false + onExited: { + attribution3.font.underline = false + } } } - } - Label { - id: attribution4 - anchors.bottom: parent.bottom - anchors.bottomMargin: 2 - font: Kirigami.Theme.smallFont - text: i18n("Weather icons created by Erik Flowers.") - MouseArea { - cursorShape: Qt.PointingHandCursor - anchors.fill: attribution4 - - hoverEnabled: true - onClicked: { - Qt.openUrlExternally('https://erikflowers.github.io/weather-icons/') - } + Label { + id: attribution4 + font: Kirigami.Theme.smallFont + text: i18n("Weather icons created by Erik Flowers.") + Layout.fillHeight: true + Layout.fillWidth: true + wrapMode: Text.WordWrap + MouseArea { + cursorShape: Qt.PointingHandCursor + anchors.fill: attribution4 + + hoverEnabled: true + + onClicked: { + Qt.openUrlExternally('https://erikflowers.github.io/weather-icons/') + } - onEntered: { - attribution4.font.underline = true - } + onEntered: { + attribution4.font.underline = true + } - onExited: { - attribution4.font.underline = false + onExited: { + attribution4.font.underline = false + } } } } } // changePlaceAliasDialog - Dialog { + /*Dialog { id: changePlaceAliasDialog title: i18n("Change Displayed As") @@ -610,7 +624,7 @@ KCM.SimpleKCM { placeholderText: i18n("Enter place alias") width: parent.width } - } + }*/ // addOwmCityIdDialog Dialog { @@ -1295,8 +1309,6 @@ KCM.SimpleKCM { } } - - Loader { id: saveSearchedData property int rowNumber diff --git a/package/contents/ui/config/ConfigUnits.qml b/package/contents/ui/config/ConfigUnits.qml index 5f13616..ccc82a0 100644 --- a/package/contents/ui/config/ConfigUnits.qml +++ b/package/contents/ui/config/ConfigUnits.qml @@ -2,6 +2,7 @@ import QtQuick import QtQuick.Controls import QtQuick.Layouts import org.kde.kcmutils as KCM +import org.kde.kirigami as Kirigami KCM.SimpleKCM { @@ -94,35 +95,24 @@ KCM.SimpleKCM { id: timezoneTypeGroup } - GridLayout { - columns: 2 + Kirigami.FormLayout { - Label { - text: i18n("Temperature") + ":" - Layout.alignment: Qt.AlignVCenter | Qt.AlignRight - } RadioButton { + Kirigami.FormData.label: i18n("Temperature") + ":" + id: temperatureTypeRadioCelsius ButtonGroup.group: temperatureTypeGroup text: i18n("°C") onCheckedChanged: if (checked) cfg_temperatureType = 0 } - Item { - width: 2 - height: 2 - Layout.rowSpan: 1 - } + RadioButton { id: temperatureTypeRadioFahrenheit ButtonGroup.group: temperatureTypeGroup text: i18n("°F") onCheckedChanged: if (checked) cfg_temperatureType = 1 } - Item { - width: 2 - height: 2 - Layout.rowSpan: 1 - } + RadioButton { id: temperatureTypeRadioKelvin ButtonGroup.group: temperatureTypeGroup @@ -131,32 +121,25 @@ KCM.SimpleKCM { } Item { - width: 2 - height: 10 - Layout.columnSpan: 2 + Kirigami.FormData.isSection: true } - Label { - text: i18n("Pressure") + ":" - Layout.alignment: Qt.AlignVCenter | Qt.AlignRight - } RadioButton { + Kirigami.FormData.label: i18n("Pressure") + ":" + id: pressureTypeRadioHpa ButtonGroup.group: pressureTypeGroup text: i18n("hPa") onCheckedChanged: if (checked) cfg_pressureType = 0 } - Item { - width: 2 - height: 2 - Layout.rowSpan: 2 - } + RadioButton { id: pressureTypeRadioInhg ButtonGroup.group: pressureTypeGroup text: i18n("inHg") onCheckedChanged: if (checked) cfg_pressureType = 1 } + RadioButton { id: pressureTypeRadioMmhg ButtonGroup.group: pressureTypeGroup @@ -165,32 +148,25 @@ KCM.SimpleKCM { } Item { - width: 2 - height: 10 - Layout.columnSpan: 2 + Kirigami.FormData.isSection: true } - Label { - text: i18n("Wind speed") + ":" - Layout.alignment: Qt.AlignVCenter | Qt.AlignRight - } RadioButton { + Kirigami.FormData.label: i18n("Wind speed") + ":" + id: windSpeedTypeRadioMps ButtonGroup.group: windSpeedTypeGroup text: i18n("m/s") onCheckedChanged: if (checked) cfg_windSpeedType = 0 } - Item { - width: 2 - height: 2 - Layout.rowSpan: 2 - } + RadioButton { id: windSpeedTypeRadioMph ButtonGroup.group: windSpeedTypeGroup text: i18n("mph") onCheckedChanged: if (checked) cfg_windSpeedType = 1 } + RadioButton { id: windSpeedTypeRadioKmh ButtonGroup.group: windSpeedTypeGroup @@ -199,37 +175,25 @@ KCM.SimpleKCM { } Item { - width: 2 - height: 10 - Layout.columnSpan: 2 + Kirigami.FormData.isSection: true } - Label { - text: i18n("Timezone") + ":" - Layout.alignment: Qt.AlignVCenter | Qt.AlignRight - } RadioButton { + Kirigami.FormData.label: i18n("Timezone") + ":" + id: timezoneTypeRadioUserLocalTime ButtonGroup.group: timezoneTypeGroup text: i18n("My local-time") onCheckedChanged: if (checked) cfg_timezoneType = 0 } - Item { - width: 2 - height: 2 - Layout.rowSpan: 1 - } + RadioButton { id: timezoneTypeRadioUtc ButtonGroup.group: timezoneTypeGroup text: i18n("UTC") onCheckedChanged: if (checked) cfg_timezoneType = 1 } - Item { - width: 2 - height: 2 - Layout.rowSpan: 1 - } + RadioButton { id: timezoneTypeRadioLocationLocal ButtonGroup.group: timezoneTypeGroup