import QtQuick import ".." import "../../services" // Clicking cycles through the available power profiles. CCTile { id: root readonly property var info: SystemService.state.profiles || ({ available: false, profiles: [] }) readonly property var profiles: info.profiles || [] readonly property string current: info.current || "" objectName: "profileTile" title: "Power profile" detail: !info.available ? "Unavailable" : current ? current.charAt(0).toUpperCase() + current.slice(1).replace(/-/g, " ") : "—" glyph: current === "power-saver" ? "󰌪" : current === "performance" ? "󰓅" : "󰾅" fallback: "P" checked: info.available && current !== "" && current !== "balanced" enabled: !!info.available && profiles.length > 1 && !SystemService.acting onClicked: SystemService.action("profile", profiles[(profiles.indexOf(current) + 1) % profiles.length], false) Accessible.name: "Power profile: " + detail }