reorganize repo: move shell sources into shell/, test scripts into test/
This commit is contained in:
parent
344c1f8512
commit
d6cd2f173a
60 changed files with 2 additions and 2 deletions
29
shell/modules/PowerProfile.qml
Normal file
29
shell/modules/PowerProfile.qml
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
import QtQuick
|
||||
import "." as M
|
||||
|
||||
M.BarIcon {
|
||||
id: root
|
||||
tooltip: "Power profile: " + (M.PowerProfileService.profile || "unknown")
|
||||
|
||||
color: M.PowerProfileService.profile === "performance" ? M.Theme.base09 : M.PowerProfileService.profile === "power-saver" ? M.Theme.base0B : root.accentColor
|
||||
|
||||
icon: {
|
||||
if (M.PowerProfileService.profile === "performance")
|
||||
return "\uF0E7";
|
||||
if (M.PowerProfileService.profile === "power-saver")
|
||||
return "\uF06C";
|
||||
if (M.PowerProfileService.profile === "balanced")
|
||||
return "\uF24E";
|
||||
return "\uF0E7";
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: {
|
||||
const cycle = ["performance", "balanced", "power-saver"];
|
||||
const idx = cycle.indexOf(M.PowerProfileService.profile);
|
||||
M.PowerProfileService.set(cycle[(idx + 1) % cycle.length]);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue