move NiriIpc and PowerProfileService singletons to services/
This commit is contained in:
parent
63e93f5de0
commit
0160e4a1fb
10 changed files with 18 additions and 19 deletions
|
|
@ -4,16 +4,16 @@ import "../services" as S
|
|||
|
||||
M.BarIcon {
|
||||
id: root
|
||||
tooltip: "Power profile: " + (M.PowerProfileService.profile || "unknown")
|
||||
tooltip: "Power profile: " + (S.PowerProfileService.profile || "unknown")
|
||||
|
||||
color: M.PowerProfileService.profile === "performance" ? S.Theme.base09 : M.PowerProfileService.profile === "power-saver" ? S.Theme.base0B : root.accentColor
|
||||
color: S.PowerProfileService.profile === "performance" ? S.Theme.base09 : S.PowerProfileService.profile === "power-saver" ? S.Theme.base0B : root.accentColor
|
||||
|
||||
icon: {
|
||||
if (M.PowerProfileService.profile === "performance")
|
||||
if (S.PowerProfileService.profile === "performance")
|
||||
return "\uF0E7";
|
||||
if (M.PowerProfileService.profile === "power-saver")
|
||||
if (S.PowerProfileService.profile === "power-saver")
|
||||
return "\uF06C";
|
||||
if (M.PowerProfileService.profile === "balanced")
|
||||
if (S.PowerProfileService.profile === "balanced")
|
||||
return "\uF24E";
|
||||
return "\uF0E7";
|
||||
}
|
||||
|
|
@ -23,8 +23,8 @@ M.BarIcon {
|
|||
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]);
|
||||
const idx = cycle.indexOf(S.PowerProfileService.profile);
|
||||
S.PowerProfileService.set(cycle[(idx + 1) % cycle.length]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue