Files
glassMxrph/quickshell/settings/pages/Notch.qml
T
mxandClaude Opus 5.5 73de4b06a8 Give notch mode its own control layout and backgroundless islands
- The notch's cog edits a separate tile layout (notch.controls); normal
  mode keeps the Control Center's. Reset follows the Control Center again.
- Notch islands draw no bar behind their modules.
- The notch strip picker comes first in Settings → Notch, and an empty
  strip offers a shortcut to it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 17:08:46 +01:00

120 lines
4.5 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: "Notch strip"
description: "Left of the clock in the open notch, e.g. AI usage or the screen recorder"
icon: "󰹑"
key: "strip"
}
ModulePicker {
title: "Left island"
icon: "󰁍"
key: "left"
}
ModulePicker {
title: "Right island"
icon: "󰁔"
key: "right"
}
}
SettingNote {
text: "Super+N switches between notch mode and the full bar. The middle column uses your Control Center tiles; the cog in the open notch edits the notch's own layout, separate from the Control Center. Reset there to follow the Control Center again."
}
}