headsetcontrol-battery-widget/package/contents/ui/configGeneral.qml

68 lines
1.4 KiB
QML
Raw Normal View History

2024-01-19 00:54:33 +00:00
import QtQuick 2.0
2024-01-19 01:57:59 +00:00
import QtQuick.Layouts 1.3
2024-01-19 00:54:33 +00:00
import QtQuick.Controls 2.5 as QQC2
2024-01-19 01:57:59 +00:00
import org.kde.plasma.core 2.0 as PlasmaCore
2024-01-19 00:54:33 +00:00
import org.kde.kirigami 2.4 as Kirigami
QQC2.Pane {
id: root
property alias cfg_pollingrate: pollingrate.value
2024-01-20 10:36:02 +00:00
property alias cfg_batteryheight: batteryheight.value
2024-01-19 00:54:33 +00:00
Kirigami.FormLayout {
anchors.fill: parent
wideMode: false
2024-01-19 01:57:59 +00:00
GridLayout {
columns: 3
2024-01-20 10:36:02 +00:00
rows: 2
rowSpacing: 10
2024-01-19 01:57:59 +00:00
2024-01-20 10:36:02 +00:00
// first row
2024-01-19 01:57:59 +00:00
Text {
text: "polling rate:"
color: PlasmaCore.Theme.textColor
}
QQC2.Slider {
id: pollingrate
value: 10.0
from: 2.0
to: 60.0
stepSize: 2.0
snapMode: QQC2.Slider.SnapAlways
2024-01-19 01:57:59 +00:00
onMoved: {
2024-01-19 18:43:45 +00:00
pollingratevalue.text = this.value + " seconds";
2024-01-19 01:57:59 +00:00
}
}
Text {
2024-01-19 18:43:45 +00:00
id: pollingratevalue
2024-01-19 01:57:59 +00:00
text: pollingrate.value + " seconds"
color: PlasmaCore.Theme.textColor
2024-01-19 00:54:33 +00:00
}
2024-01-20 10:36:02 +00:00
// 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
}
2024-01-19 00:54:33 +00:00
}
}
}