Add glassMxrph shell sources

Initial commit of the Quickshell desktop suite: bar, dock, launcher,
settings, Control Center, dashboard, OSD, lock screen, desktop widgets,
plugin host with the vendored Noctalia/Omarchy compatibility layer,
helpers, packaging, tests and phase documentation.

Includes the optimization work so far: usage widgets and dashboard
gauges no longer animate continuously, desktop widgets pause while
covered, system controls stop flickering on background polls, dock app
matching uses an indexed catalog, and workspace ghosts are created only
for occupied slots.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mxandClaude Opus 5.5 committed 2026-10-07 22:36:17 +02:00
commit 99e64a7713
433 files changed
+57792

No files matched your search

+60
View File
@@ -0,0 +1,60 @@
import QtQuick
import QtQuick.Layouts
import "../theme"
// Small Control Center tile: round toggle, title and state; the whole tile toggles.
ControlCard {
id: root
property string glyph
property string fallback
property string detail
property bool checked: false
signal clicked
padding: 10
heading: false
opacity: enabled ? 1 : 0.55
color: area.containsMouse && enabled ? Theme.hover : Theme.fill
Accessible.role: Accessible.CheckBox
Accessible.name: title
Accessible.checked: checked
MouseArea {
id: area
parent: root
z: -1
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: root.clicked()
}
RowLayout {
Layout.fillWidth: true
spacing: 10
CCToggle {
glyph: root.glyph
fallback: root.fallback
checked: root.checked
enabled: root.enabled
onClicked: root.clicked()
}
ColumnLayout {
Layout.fillWidth: true
spacing: 0
Text {
text: root.title
color: Theme.text
font.pixelSize: 12
font.weight: Font.DemiBold
elide: Text.ElideRight
Layout.fillWidth: true
}
Text {
text: root.detail
visible: text !== ""
color: Theme.textSecondary
font.pixelSize: 11
elide: Text.ElideRight
Layout.fillWidth: true
}
}
}
}
+43
View File
@@ -0,0 +1,43 @@
import QtQuick
import "../components"
import "../theme"
// Round icon toggle; filled with the accent while on.
Item {
id: root
property string glyph
property string fallback
property bool checked: false
property int size: 34
signal clicked
implicitWidth: size
implicitHeight: size
opacity: enabled ? 1 : 0.45
Accessible.role: Accessible.CheckBox
Accessible.checked: checked
GlassIcon {
anchors.fill: parent
size: root.size
radius: root.size / 2
glyph: root.glyph
fallback: root.fallback
active: root.checked
color: root.checked ? Theme.accent : area.containsMouse ? Theme.hover : Theme.surfaceVariant
border.width: root.checked ? 0 : 1
border.color: Theme.hairline
scale: area.pressed ? 0.92 : 1
Behavior on scale {
NumberAnimation {
duration: Theme.duration / 2
easing.type: Easing.OutCubic
}
}
}
MouseArea {
id: area
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: root.clicked()
}
}
+35
View File
@@ -0,0 +1,35 @@
import QtQuick
import QtQuick.Layouts
import "../theme"
// Rounded Control Center module (macOS style); also embedded by Settings pages.
Rectangle {
id: root
default property alias controls: body.data
property string title
property bool heading: title !== ""
property int padding: 12
implicitWidth: 360
implicitHeight: body.implicitHeight + padding * 2
radius: Math.max(12, Theme.radius * 0.75)
color: Theme.fill
border.width: 1
border.color: Theme.hairline
ColumnLayout {
id: body
anchors {
left: parent.left
right: parent.right
top: parent.top
margins: root.padding
}
spacing: 10
Text {
visible: root.heading
text: root.title
color: Theme.text
font.pixelSize: 13
font.weight: Font.DemiBold
}
}
}
+302
View File
@@ -0,0 +1,302 @@
pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import Quickshell
import Quickshell.Io
import Quickshell.Wayland
import "../components"
import "../services"
import "../core"
import "../theme"
// macOS-style Control Center. The layer surface is sized to the panel so
// compositor glass (HyprGlass) shapes its edges to the panel, not the screen.
// qmllint disable uncreatable-type
PanelWindow {
id: root
screen: ScreenService.current(ShellState.controlCenterScreen)
anchors {
top: true
right: true
}
readonly property int screenWidth: screen ? screen.width : 1920
readonly property int screenHeight: screen ? screen.height : 1080
// Drops out of the bar's right side; the right ear stays on its straight edge.
readonly property real rightInset: BarDrawers.margin + BarDrawers.radius
// Panel position on the output, for tests and diagnostics.
readonly property real panelScreenX: screenWidth - rightInset - width + panel.ear
readonly property real panelScreenY: BarDrawers.bottom
// The layer starts at the screen top so the bar join is inside its box.
// Margins is present at runtime but unresolved in 0.3.1 qmltypes.
// qmllint disable unqualified unresolved-type
margins {
right: root.rightInset
}
// qmllint enable unqualified unresolved-type
implicitWidth: Math.round(panel.width)
implicitHeight: Math.round(BarDrawers.bottom + panel.contentHeight)
visible: ShellState.controlCenterOpen || panel.shown
color: Theme.transparent
exclusionMode: ExclusionMode.Ignore
WlrLayershell.layer: WlrLayer.Overlay
WlrLayershell.namespace: "glassMxrph-controlcenter"
WlrLayershell.keyboardFocus: ShellState.controlCenterOpen ? WlrKeyboardFocus.Exclusive : WlrKeyboardFocus.None
Component.onCompleted: ShellState.controlCenterWindow = root
Component.onDestruction: ShellState.controlCenterWindow = null
// Connectivity and the small tiles share one block (connectivity left, tiles
// stacked right), placed where the first of them appears; other modules
// span the full width in their configured order.
readonly property var smallTiles: ["dnd", "nightLight", "profiles"]
readonly property var blocks: {
if (!ConfigService.ready)
return [];
const ids = ConfigService.data.controlCenter.modules.filter(m => m.enabled && !!ControlRegistry.entry(m.id)).map(m => m.id);
const grouped = ids.filter(id => id === "connectivity" || smallTiles.includes(id));
const result = [];
let placed = false;
for (const id of ids) {
if (!grouped.includes(id)) {
result.push({
kind: "full",
ids: [id]
});
} else if (!placed) {
placed = true;
const tiles = grouped.filter(g => g !== "connectivity");
if (!grouped.includes("connectivity"))
result.push({
kind: "grid",
ids: tiles
});
else if (tiles.length === 0)
result.push({
kind: "full",
ids: ["connectivity"]
});
else
result.push({
kind: "split",
ids: tiles
});
}
}
return result;
}
component ModuleSlot: Loader {
property string moduleId
Layout.fillWidth: true
Layout.preferredWidth: 1
active: ShellState.controlCenterOpen
source: moduleId ? ControlRegistry.entry(moduleId).source : ""
}
component HeaderButton: Rectangle {
id: headerButton
property string glyph
property string fallback
signal clicked
implicitWidth: 28
implicitHeight: 28
radius: 14
color: headerArea.containsMouse ? Qt.alpha(Theme.text, 0.12) : Theme.transparent
Accessible.role: Accessible.Button
GlassIcon {
anchors.centerIn: parent
size: 28
glyphSize: 14
glyph: headerButton.glyph
fallback: headerButton.fallback
color: Theme.transparent
border.width: 0
glyphColor: Theme.textSecondary
}
MouseArea {
id: headerArea
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: headerButton.clicked()
}
}
// Hyprland routes every pointer event to a layer with exclusive keyboard
// focus, so clicks outside the panel arrive here with out-of-bounds
// coordinates. Qt Quick still delivers them to items extending past the
// window, so this catcher (behind the panel) dismisses on outside clicks.
MouseArea {
objectName: "controlCenterOutside"
x: -20000
y: -20000
width: 40000
height: 40000
onPressed: ShellState.controlCenterOpen = false
}
BarDrawer {
id: panel
objectName: "controlCenterSurface"
readonly property real targetWidth: Math.min(ConfigService.ready ? ConfigService.data.controlCenter.width : 400, root.screenWidth - 2 * root.rightInset - 2 * ear)
readonly property real targetHeight: Math.min(content.implicitHeight + 28, root.screenHeight - BarDrawers.bottom - 20)
y: BarDrawers.bottom
open: ShellState.controlCenterOpen
contentWidth: targetWidth
contentHeight: targetHeight
drawerId: "controlcenter"
screenName: root.screen ? root.screen.name : ""
screenX: root.screenWidth - root.rightInset - width
focus: open
onOpenChanged: if (open)
forceActiveFocus()
Keys.onEscapePressed: {
if (PowerService.pending)
PowerService.cancel();
else
ShellState.controlCenterOpen = false;
}
Behavior on contentHeight {
enabled: panel.settled
NumberAnimation {
duration: Theme.duration
easing.type: Easing.OutCubic
}
}
MouseArea {
anchors.fill: parent
}
ScrollView {
anchors.fill: parent
anchors.margins: 14
clip: true
contentWidth: panel.targetWidth - 28
ColumnLayout {
id: content
width: panel.targetWidth - 28
spacing: 10
RowLayout {
Layout.fillWidth: true
Layout.leftMargin: 4
spacing: 2
Text {
text: "Control Center"
color: Theme.text
font.pixelSize: 14
font.weight: Font.DemiBold
Layout.fillWidth: true
}
HeaderButton {
glyph: "󰒓"
fallback: "⚙"
onClicked: ShellState.openSettings("controlcenter")
Accessible.name: "Control Center settings"
}
HeaderButton {
glyph: "󰅖"
fallback: "×"
onClicked: ShellState.controlCenterOpen = false
Accessible.name: "Close Control Center"
}
}
Repeater {
model: root.blocks
Item {
id: block
required property var modelData
Layout.fillWidth: true
implicitHeight: block.modelData.kind === "full" ? full.implicitHeight : block.modelData.kind === "split" ? split.implicitHeight : grid.implicitHeight
ModuleSlot {
id: full
visible: block.modelData.kind === "full"
width: parent.width
moduleId: block.modelData.kind === "full" ? block.modelData.ids[0] : ""
active: visible && ShellState.controlCenterOpen
}
RowLayout {
id: split
visible: block.modelData.kind === "split"
width: parent.width
spacing: 10
ModuleSlot {
moduleId: "connectivity"
active: split.visible && ShellState.controlCenterOpen
Layout.fillHeight: true
}
ColumnLayout {
Layout.fillWidth: true
Layout.preferredWidth: 1
Layout.alignment: Qt.AlignTop
spacing: 10
Repeater {
model: block.modelData.kind === "split" ? block.modelData.ids : []
ModuleSlot {
required property string modelData
moduleId: modelData
}
}
}
}
GridLayout {
id: grid
visible: block.modelData.kind === "grid"
width: parent.width
columns: 2
columnSpacing: 10
rowSpacing: 10
Repeater {
model: block.modelData.kind === "grid" ? block.modelData.ids : []
ModuleSlot {
required property string modelData
moduleId: modelData
}
}
}
}
}
Text {
visible: SystemService.acting
text: "Updating system controls…"
color: Theme.textSecondary
font.pixelSize: 11
Layout.fillWidth: true
Layout.leftMargin: 4
}
Text {
visible: !!SystemService.error
text: SystemService.error
color: Theme.urgent
font.pixelSize: 11
wrapMode: Text.Wrap
Layout.fillWidth: true
Layout.leftMargin: 4
}
GlassButton {
visible: root.blocks.length === 0
text: "Add modules"
onClicked: ShellState.openSettings("controlcenter")
}
}
}
}
IpcHandler {
target: "controlcenter"
function toggle(): void {
ShellState.toggleControlCenter();
}
function open(): void {
ShellState.openControlCenter();
}
function close(): void {
ShellState.controlCenterOpen = false;
}
function status(): string {
return JSON.stringify({
opened: ShellState.controlCenterOpen,
screen: root.screen ? root.screen.name : "",
busy: SystemService.busy,
error: SystemService.error,
pendingPower: PowerService.pending
});
}
}
}
@@ -0,0 +1,44 @@
pragma Singleton
import QtQuick
import Quickshell
Singleton {
function entry(id) {
return Object.prototype.hasOwnProperty.call(modules, id) ? modules[id] : null;
}
readonly property var modules: ({
metrics: {title:"System Metrics", source:Qt.resolvedUrl("modules/Metrics.qml")},
connectivity: {
title: "Connectivity",
source: Qt.resolvedUrl("modules/Connectivity.qml")
},
audio: {
title: "Audio",
source: Qt.resolvedUrl("modules/Audio.qml")
},
brightness: {
title: "Brightness",
source: Qt.resolvedUrl("modules/Brightness.qml")
},
nightLight: {
title: "Night Light",
source: Qt.resolvedUrl("modules/NightLight.qml")
},
dnd: {
title: "Do Not Disturb",
source: Qt.resolvedUrl("modules/Dnd.qml")
},
profiles: {
title: "Power profile",
source: Qt.resolvedUrl("modules/Profiles.qml")
},
media: {
title: "Media",
source: Qt.resolvedUrl("modules/Media.qml")
},
power: {
title: "Power",
source: Qt.resolvedUrl("modules/Power.qml")
}
})
}
+28
View File
@@ -0,0 +1,28 @@
import QtQuick
import QtQuick.Layouts
import "../components"
import "../theme"
GlassButton {
id: root
property string title
property string detail
implicitHeight: 74
contentItem: ColumnLayout {
spacing: 4
Text {
text: root.title
color: root.accented ? Theme.accentText : Theme.text
font.weight: Font.DemiBold
Layout.fillWidth: true
elide: Text.ElideRight
}
Text {
text: root.detail
color: root.accented ? Theme.accentText : Theme.textSecondary
font.pixelSize: 11
Layout.fillWidth: true
elide: Text.ElideRight
}
}
}
+158
View File
@@ -0,0 +1,158 @@
pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Layouts
import ".."
import "../../components"
import "../../services"
import "../../theme"
// Output and microphone levels; the chevron reveals device selection.
ControlCard {
id: root
property bool detailed: false
property bool expanded: detailed
RowLayout {
Layout.fillWidth: true
Text {
text: "Sound"
color: Theme.text
font.pixelSize: 13
font.weight: Font.DemiBold
Layout.fillWidth: true
}
Rectangle {
objectName: "audioDevices"
visible: !root.detailed && AudioService.available
implicitWidth: 24
implicitHeight: 24
radius: 12
color: chevron.containsMouse ? Qt.alpha(Theme.text, 0.12) : Theme.transparent
Accessible.name: root.expanded ? "Hide audio devices" : "Show audio devices"
Accessible.role: Accessible.Button
Text {
anchors.centerIn: parent
text: "›"
color: Theme.textSecondary
font.pixelSize: 18
rotation: root.expanded ? 90 : 0
Behavior on rotation {
NumberAnimation {
duration: Theme.duration
easing.type: Easing.OutCubic
}
}
}
MouseArea {
id: chevron
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: root.expanded = !root.expanded
}
}
}
Repeater {
model: [false, true]
RowLayout {
id: channel
required property bool modelData
readonly property var node: modelData ? AudioService.source : AudioService.sink
readonly property bool muted: !!node && !!node.audio && node.audio.muted
Layout.fillWidth: true
spacing: 10
CCToggle {
objectName: channel.modelData ? "microphoneMute" : "volumeMute"
size: 28
glyph: channel.modelData ? (channel.muted ? "󰍭" : "󰍬") : (channel.muted ? "󰖁" : "󰕾")
fallback: channel.muted ? "×" : (channel.modelData ? "M" : "♪")
checked: channel.muted
enabled: !!channel.node && !!channel.node.audio
onClicked: AudioService.mute(channel.modelData)
Accessible.name: channel.modelData ? "Mute microphone" : "Mute output"
}
GlassBarSlider {
objectName: channel.modelData ? "microphoneSlider" : "volumeSlider"
Layout.fillWidth: true
from: 0
to: 1
stepSize: 0.01
enabled: !!channel.node && !!channel.node.audio
value: channel.node && channel.node.audio ? channel.node.audio.volume : 0
onMoved: AudioService.volume(channel.modelData, value)
Accessible.name: channel.modelData ? "Microphone level" : "Output volume"
}
Text {
text: channel.node && channel.node.audio ? Math.round(channel.node.audio.volume * 100) + "%" : "—"
color: Theme.textSecondary
font.pixelSize: 11
horizontalAlignment: Text.AlignRight
Layout.preferredWidth: 34
}
}
}
Repeater {
model: root.expanded ? [false, true] : []
ColumnLayout {
id: devices
required property bool modelData
readonly property var nodes: modelData ? AudioService.inputs : AudioService.outputs
readonly property var current: modelData ? AudioService.source : AudioService.sink
Layout.fillWidth: true
spacing: 2
Text {
text: devices.modelData ? "INPUT" : "OUTPUT"
color: Theme.textSecondary
font.pixelSize: 10
font.weight: Font.DemiBold
font.letterSpacing: 1.1
Layout.topMargin: 4
}
Repeater {
model: devices.nodes
Rectangle {
id: device
required property var modelData
required property int index
readonly property bool selected: modelData === devices.current
Layout.fillWidth: true
implicitHeight: 30
radius: 8
color: deviceArea.containsMouse ? Qt.alpha(Theme.text, 0.08) : Theme.transparent
RowLayout {
anchors.fill: parent
anchors.leftMargin: 6
anchors.rightMargin: 6
spacing: 8
Text {
text: device.selected ? "✓" : ""
color: Theme.accent
font.pixelSize: 12
Layout.preferredWidth: 14
}
Text {
text: device.modelData.description || device.modelData.name
color: device.selected ? Theme.text : Qt.alpha(Theme.text, 0.8)
font.pixelSize: 12
font.weight: device.selected ? Font.DemiBold : Font.Normal
elide: Text.ElideRight
Layout.fillWidth: true
}
}
MouseArea {
id: deviceArea
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: AudioService.select(devices.modelData, device.index)
}
}
}
}
}
Text {
visible: !AudioService.available
text: "PipeWire is unavailable"
color: Theme.textSecondary
font.pixelSize: 11
}
}
@@ -0,0 +1,44 @@
import QtQuick
import QtQuick.Layouts
import ".."
import "../../components"
import "../../services"
import "../../theme"
ControlCard {
id: root
readonly property var info: SystemService.state.brightness || ({
available: false
})
title: "Display"
GlassBarSlider {
objectName: "brightnessSlider"
Layout.fillWidth: true
glyph: "󰃠"
fallback: "☀"
from: 1
to: 100
stepSize: 1
value: root.info.value || 1
enabled: !!root.info.available && !SystemService.acting
onPressedChanged: if (!pressed && enabled) {
SystemService.action("brightness", value, false);
value = Qt.binding(() => root.info.value || 1);
}
Keys.onReleased: event => {
if (event.key === Qt.Key_Left || event.key === Qt.Key_Right) {
SystemService.action("brightness", value, false);
value = Qt.binding(() => root.info.value || 1);
}
}
Accessible.name: "Display brightness"
}
Text {
visible: !root.info.available
text: root.info.notice || "No brightness provider"
color: Theme.textSecondary
font.pixelSize: 11
wrapMode: Text.Wrap
Layout.fillWidth: true
}
}
@@ -0,0 +1,89 @@
pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Layouts
import ".."
import "../../services"
import "../../core"
import "../../theme"
// Wi-Fi, Bluetooth and live throughput; labels open the matching Settings page.
ControlCard {
id: root
Component.onCompleted: MetricsService.consumers++
Component.onDestruction: MetricsService.consumers--
component Entry: RowLayout {
id: entry
property alias toggle: toggle
property string title
property string detail
property string page
Layout.fillWidth: true
spacing: 10
CCToggle {
id: toggle
}
Item {
Layout.fillWidth: true
implicitHeight: labels.implicitHeight
ColumnLayout {
id: labels
anchors.left: parent.left
anchors.right: parent.right
spacing: 0
Text {
text: entry.title
color: Theme.text
font.pixelSize: 12
font.weight: Font.DemiBold
elide: Text.ElideRight
Layout.fillWidth: true
}
Text {
text: entry.detail
color: Theme.textSecondary
font.pixelSize: 11
elide: Text.ElideRight
Layout.fillWidth: true
}
}
MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: ShellState.openSettings(entry.page)
}
}
}
Entry {
title: "Wi-Fi"
detail: !NetworkService.available ? "No Wi-Fi adapter" : !NetworkService.backend.wifiHardwareEnabled ? "Hardware blocked" : NetworkService.enabled ? NetworkService.summary : "Off"
page: "network"
toggle.objectName: "wifiToggle"
toggle.glyph: NetworkService.enabled ? "󰖩" : "󰖪"
toggle.fallback: "W"
toggle.checked: NetworkService.available && NetworkService.enabled
toggle.enabled: NetworkService.available && NetworkService.backend.wifiHardwareEnabled
toggle.onClicked: NetworkService.toggle()
toggle.Accessible.name: "Wi-Fi"
}
Entry {
title: "Bluetooth"
detail: !BluetoothService.adapter ? "No adapter" : !BluetoothService.canToggle ? "Hardware blocked" : BluetoothService.summary
page: "bluetooth"
toggle.objectName: "bluetoothToggle"
toggle.glyph: BluetoothService.enabled ? "󰂯" : "󰂲"
toggle.fallback: "B"
toggle.checked: BluetoothService.enabled
toggle.enabled: BluetoothService.canToggle
toggle.onClicked: BluetoothService.toggle()
toggle.Accessible.name: "Bluetooth"
}
Entry {
title: "Network"
detail: "↓ " + MetricsService.bytes(MetricsService.network.download) + "/s ↑ " + MetricsService.bytes(MetricsService.network.upload) + "/s"
page: "metrics"
toggle.glyph: "󰛳"
toggle.fallback: "N"
toggle.onClicked: ShellState.openSettings("network")
toggle.Accessible.name: "Network settings"
}
}
+18
View File
@@ -0,0 +1,18 @@
import QtQuick
import ".."
import "../../services"
CCTile {
readonly property var info: SystemService.state.dnd || ({
available: false
})
objectName: "dndToggle"
title: "Do Not Disturb"
detail: !info.available ? "No SwayNC running" : info.enabled ? "On" : "Off"
glyph: "󰽥"
fallback: "☾"
// Shows acknowledged provider state; a failed request leaves it unchanged.
checked: !!info.enabled
enabled: !!info.available && !SystemService.acting
onClicked: SystemService.action("dnd", !info.enabled, false)
}
@@ -0,0 +1,11 @@
import QtQuick
import "../../media"
import "../../theme"
// Shared player and controls, styled as a Control Center module.
MediaCard {
compact: true
radius: Math.max(12, Theme.radius * 0.75)
color: Theme.fill
border.color: Theme.hairline
}
@@ -0,0 +1,10 @@
import QtQuick
import "../../metrics"
import "../../theme"
MetricsCard {
compact: true
radius: Math.max(12, Theme.radius * 0.75)
color: Theme.fill
border.color: Theme.hairline
}
@@ -0,0 +1,18 @@
import QtQuick
import ".."
import "../../services"
CCTile {
readonly property var info: SystemService.state.nightLight || ({
available: false
})
objectName: "nightLightToggle"
title: "Night Light"
detail: !info.available ? "No gamma provider" : info.enabled ? "On" : "Off"
glyph: "󰖔"
fallback: "N"
// Shows acknowledged provider state; a failed request leaves it unchanged.
checked: !!info.enabled
enabled: !!info.available && !SystemService.acting
onClicked: SystemService.action("nightLight", !info.enabled, false)
}
@@ -0,0 +1,91 @@
pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Layouts
import ".."
import "../../components"
import "../../services"
import "../../theme"
ControlCard {
id: root
Component.onDestruction: PowerService.cancel()
RowLayout {
Layout.fillWidth: true
spacing: 4
Repeater {
model: [
{
id: "lock",
glyph: "󰌾"
},
{
id: "logout",
glyph: "󰍃"
},
{
id: "suspend",
glyph: "󰤄"
},
{
id: "reboot",
glyph: "󰜉"
},
{
id: "shutdown",
glyph: "󰐥"
}
]
ColumnLayout {
id: action
required property var modelData
readonly property string label: modelData.id === "logout" ? "Log out" : modelData.id === "shutdown" ? "Shut down" : modelData.id.charAt(0).toUpperCase() + modelData.id.slice(1)
Layout.fillWidth: true
Layout.preferredWidth: 1
spacing: 4
CCToggle {
objectName: "power-" + action.modelData.id
Layout.alignment: Qt.AlignHCenter
size: 38
glyph: action.modelData.glyph
fallback: action.label.charAt(0)
checked: PowerService.pending === action.modelData.id
enabled: (action.modelData.id === "lock" && ConfigService.ready && ConfigService.data.lock.enabled) || (!!SystemService.state.power && !!SystemService.state.power[action.modelData.id] && !SystemService.acting)
onClicked: PowerService.request(action.modelData.id)
Accessible.name: action.label
}
Text {
text: action.label
color: Theme.textSecondary
font.pixelSize: 10
elide: Text.ElideRight
horizontalAlignment: Text.AlignHCenter
Layout.fillWidth: true
}
}
}
}
RowLayout {
visible: PowerService.pending !== ""
Layout.fillWidth: true
spacing: 8
Text {
text: "Confirm " + PowerService.pending + "? Unsaved work may be lost."
color: Theme.text
font.pixelSize: 12
wrapMode: Text.Wrap
Layout.fillWidth: true
}
GlassButton {
objectName: "powerCancel"
text: "Cancel"
onClicked: PowerService.cancel()
}
GlassButton {
objectName: "powerConfirm"
text: "Confirm"
accented: true
enabled: !SystemService.acting
onClicked: PowerService.confirm()
}
}
}
@@ -0,0 +1,23 @@
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
}
+6
View File
@@ -0,0 +1,6 @@
singleton ControlRegistry 1.0 ControlRegistry.qml
ControlCenter 1.0 ControlCenter.qml
ControlCard 1.0 ControlCard.qml
SystemTile 1.0 SystemTile.qml
CCToggle 1.0 CCToggle.qml
CCTile 1.0 CCTile.qml