Files
glassMxrph/quickshell/settings/pages/Notch.qml
T
mxandClaude Opus 5.5 74b6ad50ec Refine notch mode: own island modules, Super+N, fuller pages, header strip
- Notch islands and a header strip in the open notch take their own module
  lists (Settings → Notch → Modules); the strip scrolls sideways on wheel.
- `glassmxrph notch mode` swaps notch mode and the full bar.
- The left column fills its space: large media player (streams show LIVE),
  a full-height Performance card and a clock over the calendar.
- A cog edits the tiles in the Control Center editor, then the notch returns.
- The launcher uses the notch shape and keeps its mode pills inside.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 16:57:23 +01:00

119 lines
4.4 KiB
QML

pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Layouts
import "../controls"
import "../../components"
import "../../core"
import "../../services"
import "../../theme"
SettingsPage {
id: root
readonly property var options: ConfigService.data.notch
// Adds or removes a bar module from one of the notch's module lists.
function toggleModule(key, id) {
const list = (options[key] || []).slice();
const at = list.indexOf(id);
if (at >= 0)
list.splice(at, 1);
else
list.push(id);
ConfigService.setValue("notch." + key, list);
}
// Chips for every bar module; filled ones are shown there, in click order.
component ModulePicker: SettingRow {
id: picker
property string key
below: Flow {
Layout.fillWidth: true
spacing: 6
Repeater {
model: ModuleRegistry.available
Rectangle {
id: chip
required property string modelData
readonly property bool on: (root.options[picker.key] || []).includes(modelData)
objectName: "notchModule-" + picker.key + "-" + modelData
implicitWidth: chipLabel.implicitWidth + 24
implicitHeight: 28
radius: 14
color: on ? (chipArea.containsMouse ? Theme.accentHover : Theme.accent) : chipArea.containsMouse ? Theme.hover : Theme.fill
border.width: on ? 0 : 1
border.color: Theme.hairline
Accessible.role: Accessible.CheckBox
Accessible.name: ModuleRegistry.title(modelData)
Accessible.checked: on
Text {
id: chipLabel
anchors.centerIn: parent
text: ModuleRegistry.title(chip.modelData)
color: chip.on ? Theme.accentText : Theme.text
font.pixelSize: 12
font.weight: Font.Medium
}
MouseArea {
id: chipArea
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: root.toggleModule(picker.key, chip.modelData)
}
}
}
}
}
SettingsSection {
title: "Notch"
description: "Splits the bar into side islands with a notch at the top centre. Super+C, Super+X and a click on the notch open it: dashboard pages on the left (scroll to switch), controls and weather in the middle, notifications on the right. The launcher drops out of it."
PreferenceToggle {
label: "Notch"
description: root.options.enabled ? "On: notch mode" : "Off: the full bar"
icon: "󰹑"
setting: "notch.enabled"
}
}
SettingsSection {
title: "Opening"
enabled: root.options.enabled
PreferenceToggle {
label: "Open on Media while audio plays"
description: "Otherwise it opens on the last page"
icon: "󰝚"
setting: "notch.mediaFirst"
}
SettingRow {
title: "Preview"
icon: "󰈈"
GlassButton {
objectName: "notchOpenButton"
text: "Open notch"
enabled: root.options.enabled
onClicked: ShellState.openNotch()
}
}
}
SettingsSection {
title: "Modules"
description: "Which bar modules show in notch mode. The strip sits left of the clock in the open notch; the mouse wheel scrolls it sideways when it overflows."
enabled: root.options.enabled
ModulePicker {
title: "Left island"
icon: "󰁍"
key: "left"
}
ModulePicker {
title: "Right island"
icon: "󰁔"
key: "right"
}
ModulePicker {
title: "Notch strip"
icon: "󰹑"
key: "strip"
}
}
SettingNote {
text: "Super+N switches between notch mode and the full bar. The middle column uses your Control Center tiles; edit them with the cog in the open notch."
}
}