Compare commits

..

No commits in common. "026f9b740aa51ccc9e00082f87aeabc8303477e0" and "2d04bddde96785dad1e6cd7642d2a91c750b4cd8" have entirely different histories.

3 changed files with 15 additions and 35 deletions

View File

@ -7,9 +7,9 @@
<group name="General"> <group name="General">
<entry name="pollingrate" type="Int"> <entry name="pollingrate" type="Int">
<default>10.0</default> <default>10</default>
<min>2.0</min> <min>2</min>
<max>60.0</max> <max>60</max>
</entry> </entry>
</group> </group>
</kcfg> </kcfg>

View File

@ -1,7 +1,5 @@
import QtQuick 2.0 import QtQuick 2.0
import QtQuick.Layouts 1.3
import QtQuick.Controls 2.5 as QQC2 import QtQuick.Controls 2.5 as QQC2
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.kirigami 2.4 as Kirigami import org.kde.kirigami 2.4 as Kirigami
QQC2.Pane { QQC2.Pane {
@ -13,32 +11,14 @@ QQC2.Pane {
anchors.fill: parent anchors.fill: parent
wideMode: false wideMode: false
GridLayout { QQC2.SpinBox {
columns: 3
Text {
text: "polling rate:"
color: PlasmaCore.Theme.textColor
}
QQC2.Slider {
id: pollingrate id: pollingrate
value: 10.0
from: 2.0
to: 60.0
stepSize: 2.0
snapMode: Slider.SnapAlways
Kirigami.FormData.label: i18nc("@label", "pollingrate in seconds:") Kirigami.FormData.label: i18nc("@label", "pollingrate in seconds:")
onMoved: { onValueChanged: {
test.text = this.value + " seconds"; console.log("cfg_pollingrate: " + cfg_pollingrate);
}
}
Text {
id: test
text: pollingrate.value + " seconds"
color: PlasmaCore.Theme.textColor
} }
from: 2
to: 60
} }
} }
} }

View File

@ -31,8 +31,8 @@ Item {
smooth: true smooth: true
fillMode: Image.PreserveAspectFit fillMode: Image.PreserveAspectFit
source: batteryIcon() source: batteryIcon()
Plasmoid.toolTipMainText: "battery level: " + batteryLevel() Plasmoid.toolTipMainText: "battery status:"
Plasmoid.toolTipSubText: "polling rate: " + pollingrate + " seconds" Plasmoid.toolTipSubText: batteryStatus()
} }
function batteryIcon() { function batteryIcon() {
@ -54,7 +54,7 @@ Item {
return "../icons/" + iconName + ".png"; return "../icons/" + iconName + ".png";
} }
function batteryLevel() { function batteryStatus() {
if(batteryPercent == -1) if(batteryPercent == -1)
return "charging"; return "charging";
else if(batteryPercent == -2) else if(batteryPercent == -2)