Compare commits
2 Commits
2d04bddde9
...
026f9b740a
Author | SHA1 | Date | |
---|---|---|---|
026f9b740a | |||
4cea131ed0 |
|
@ -7,9 +7,9 @@
|
|||
|
||||
<group name="General">
|
||||
<entry name="pollingrate" type="Int">
|
||||
<default>10</default>
|
||||
<min>2</min>
|
||||
<max>60</max>
|
||||
<default>10.0</default>
|
||||
<min>2.0</min>
|
||||
<max>60.0</max>
|
||||
</entry>
|
||||
</group>
|
||||
</kcfg>
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
import QtQuick 2.0
|
||||
import QtQuick.Layouts 1.3
|
||||
import QtQuick.Controls 2.5 as QQC2
|
||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
||||
import org.kde.kirigami 2.4 as Kirigami
|
||||
|
||||
QQC2.Pane {
|
||||
|
@ -11,14 +13,32 @@ QQC2.Pane {
|
|||
anchors.fill: parent
|
||||
wideMode: false
|
||||
|
||||
QQC2.SpinBox {
|
||||
GridLayout {
|
||||
columns: 3
|
||||
|
||||
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: Slider.SnapAlways
|
||||
Kirigami.FormData.label: i18nc("@label", "polling rate in seconds:")
|
||||
onValueChanged: {
|
||||
console.log("cfg_pollingrate: " + cfg_pollingrate);
|
||||
onMoved: {
|
||||
test.text = this.value + " seconds";
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
id: test
|
||||
text: pollingrate.value + " seconds"
|
||||
color: PlasmaCore.Theme.textColor
|
||||
}
|
||||
from: 2
|
||||
to: 60
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,8 +31,8 @@ Item {
|
|||
smooth: true
|
||||
fillMode: Image.PreserveAspectFit
|
||||
source: batteryIcon()
|
||||
Plasmoid.toolTipMainText: "battery status:"
|
||||
Plasmoid.toolTipSubText: batteryStatus()
|
||||
Plasmoid.toolTipMainText: "battery level: " + batteryLevel()
|
||||
Plasmoid.toolTipSubText: "polling rate: " + pollingrate + " seconds"
|
||||
}
|
||||
|
||||
function batteryIcon() {
|
||||
|
@ -54,7 +54,7 @@ Item {
|
|||
return "../icons/" + iconName + ".png";
|
||||
}
|
||||
|
||||
function batteryStatus() {
|
||||
function batteryLevel() {
|
||||
if(batteryPercent == -1)
|
||||
return "charging";
|
||||
else if(batteryPercent == -2)
|
||||
|
|
Loading…
Reference in New Issue
Block a user