import QtQuick import "." as M import "../services" as S M.BarIcon { 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"; } 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]); } } }