// The three system power profiles, as an expandable list. // // A row per profile rather than a cycling button: there are three, and cycling // through them means passing through one you did not want on a machine where // the change is immediate and audible. The same shape the audio device lists // use, so the panel reads consistently. // // The daemon owns the profile -- it survives a shell restart and anything else // on the system can change it -- so this reads back rather than assuming, the // same as monitor brightness. import QtQuick import qs.config import qs.services Column { id: root spacing: 2 Repeater { model: PowerProfiles.profiles RowButton { required property var modelData width: root.width icon: { switch (modelData) { case "power-saver": return "power-profile-power-saver-symbolic"; case "performance": return "power-profile-performance-symbolic"; default: return "power-profile-balanced-symbolic"; } } iconFallback: "preferences-system-power-symbolic" label: PowerProfiles.label(modelData) sublabel: PowerProfiles.detail(modelData) selected: modelData === PowerProfiles.active dimmed: PowerProfiles.busy onClicked: PowerProfiles.set(modelData) } } // Only when it is true. A machine that cannot deliver the profile it is set // to is the one case where the label alone is misleading. Text { visible: PowerProfiles.degraded !== "" width: root.width text: "Limited right now: " + PowerProfiles.degraded color: Theme.fgMuted font.family: Theme.fontFamily font.pixelSize: Theme.fontSizeSmall wrapMode: Text.WordWrap leftPadding: 10 topPadding: 4 } }