refactor: unified BarModule base component, click-to-open panels, remove pinning

This commit is contained in:
Damocles 2026-04-25 11:52:20 +02:00
parent 034f0b6d85
commit 26476dc930
33 changed files with 273 additions and 517 deletions

View file

@ -2,29 +2,26 @@ import QtQuick
import "." as M
import "../services" as S
M.BarIcon {
M.BarModule {
id: root
tooltip: "Power profile: " + (S.PowerProfileService.profile || "unknown")
color: S.PowerProfileService.profile === "performance" ? S.Theme.base09 : S.PowerProfileService.profile === "power-saver" ? S.Theme.base0B : root.accentColor
icon: {
if (S.PowerProfileService.profile === "performance")
return "\uF0E7";
if (S.PowerProfileService.profile === "power-saver")
return "\uF06C";
if (S.PowerProfileService.profile === "balanced")
return "\uF24E";
return "\uF0E7";
onTapped: {
const cycle = ["performance", "balanced", "power-saver"];
const idx = cycle.indexOf(S.PowerProfileService.profile);
S.PowerProfileService.set(cycle[(idx + 1) % cycle.length]);
}
MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: {
const cycle = ["performance", "balanced", "power-saver"];
const idx = cycle.indexOf(S.PowerProfileService.profile);
S.PowerProfileService.set(cycle[(idx + 1) % cycle.length]);
M.BarIcon {
color: S.PowerProfileService.profile === "performance" ? S.Theme.base09 : S.PowerProfileService.profile === "power-saver" ? S.Theme.base0B : root.accentColor
icon: {
if (S.PowerProfileService.profile === "performance")
return "\uF0E7";
if (S.PowerProfileService.profile === "power-saver")
return "\uF06C";
if (S.PowerProfileService.profile === "balanced")
return "\uF24E";
return "\uF0E7";
}
anchors.verticalCenter: parent.verticalCenter
}
}