diff --git a/package/contents/config/main.xml b/package/contents/config/main.xml index 674d6c8..201e752 100644 --- a/package/contents/config/main.xml +++ b/package/contents/config/main.xml @@ -11,5 +11,10 @@ 2.0 60.0 + + 8.0 + 1.0 + 10.0 + diff --git a/package/contents/ui/configGeneral.qml b/package/contents/ui/configGeneral.qml index bd81a35..19927cd 100644 --- a/package/contents/ui/configGeneral.qml +++ b/package/contents/ui/configGeneral.qml @@ -8,6 +8,7 @@ QQC2.Pane { id: root property alias cfg_pollingrate: pollingrate.value + property alias cfg_batteryheight: batteryheight.value Kirigami.FormLayout { anchors.fill: parent @@ -15,12 +16,14 @@ QQC2.Pane { GridLayout { columns: 3 + rows: 2 + rowSpacing: 10 + // first row Text { text: "polling rate:" color: PlasmaCore.Theme.textColor } - QQC2.Slider { id: pollingrate value: 10.0 @@ -28,17 +31,37 @@ QQC2.Pane { to: 60.0 stepSize: 2.0 snapMode: QQC2.Slider.SnapAlways - Kirigami.FormData.label: i18nc("@label", "polling rate in seconds:") onMoved: { pollingratevalue.text = this.value + " seconds"; } } - Text { id: pollingratevalue text: pollingrate.value + " seconds" color: PlasmaCore.Theme.textColor } + + // second row + Text { + text: "battery height:" + color: PlasmaCore.Theme.textColor + } + QQC2.Slider { + id: batteryheight + value: 8.0 + from: 1.0 + to: 10.0 + stepSize: 1.0 + snapMode: QQC2.Slider.SnapAlways + onMoved: { + batteryheightvalue.text = this.value + } + } + Text { // dummy + id: batteryheightvalue + text: batteryheight.value + color: PlasmaCore.Theme.textColor + } } } } diff --git a/package/contents/ui/main.qml b/package/contents/ui/main.qml index b572b27..3234749 100644 --- a/package/contents/ui/main.qml +++ b/package/contents/ui/main.qml @@ -10,6 +10,7 @@ Item { id: main property int pollingrate: Plasmoid.configuration.pollingrate + property int batteryheight: Plasmoid.configuration.batteryheight property int batteryPercent: -2 PlasmaCore.DataSource { @@ -34,8 +35,8 @@ Item { id: container anchors.fill: parent anchors.rightMargin: 2 - anchors.topMargin: 2 - anchors.bottomMargin: 2 + anchors.topMargin: 10 - batteryheight + anchors.bottomMargin: 10 - batteryheight color: "transparent" border.color: PlasmaCore.Theme.textColor radius: 4