diff --git a/quickshell/bar/Bar.qml b/quickshell/bar/Bar.qml index 4ce591c..c7eca5d 100644 --- a/quickshell/bar/Bar.qml +++ b/quickshell/bar/Bar.qml @@ -106,34 +106,51 @@ PanelWindow { } } // Notch mode ------------------------------------------------------------- - GlassPanel { - id: leftIsland - // No bar behind the modules in notch mode: they float on their own. - color: Theme.transparent - border.width: 0 + // Side islands: "float" leaves the modules on the wallpaper, "pill" puts + // them on rounded pills and "notch" hangs them from the top edge like the + // centre notch. Both use the notch's fill. + readonly property string islandStyle: ConfigService.ready ? ConfigService.data.notch.islandStyle : "float" + component Island: GlassPanel { + id: island + property alias row: islandRow + property string side + readonly property bool hanging: root.islandStyle === "notch" + color: root.islandStyle === "pill" ? Theme.notchFill : Theme.transparent + border.width: root.islandStyle === "pill" ? 1 : 0 plain: true - visible: root.notch && ConfigService.ready && ConfigService.data.notch.left.length > 0 - x: root.outerMargin + visible: root.notch && ConfigService.ready && ConfigService.data.notch[side].length > 0 + // Hanging islands keep their ears on screen. + x: { + const inset = root.outerMargin + (hanging ? BarDrawers.ear : 0); + return side === "left" ? inset : root.width - inset - width; + } y: root.islandY - width: leftRow.implicitWidth + 12 + width: islandRow.implicitWidth + (root.islandStyle === "float" ? 12 : 24) height: BarDrawers.height - radius: BarDrawers.radius - ModuleRow { id: leftRow; position: "left"; active: root.notch; modules: BarLayout.notchModules(root.screen ? root.screen.name : "", "left"); barScreen: root.screen; anchors.left: parent.left; anchors.leftMargin: 6; anchors.verticalCenter: parent.verticalCenter } - } - GlassPanel { - id: rightIsland - // No bar behind the modules in notch mode: they float on their own. - color: Theme.transparent - border.width: 0 - plain: true - visible: root.notch && ConfigService.ready && ConfigService.data.notch.right.length > 0 - x: root.width - root.outerMargin - width - y: root.islandY - width: rightRow.implicitWidth + 12 - height: BarDrawers.height - radius: BarDrawers.radius - ModuleRow { id: rightRow; position: "right"; active: root.notch; modules: BarLayout.notchModules(root.screen ? root.screen.name : "", "right"); barScreen: root.screen; anchors.right: parent.right; anchors.rightMargin: 6; anchors.verticalCenter: parent.verticalCenter } + radius: root.islandStyle === "pill" ? height / 2 : BarDrawers.radius + DrawerShape { + z: -1 + visible: island.hanging + x: -BarDrawers.ear + y: -island.y + bodyWidth: island.width + bodyHeight: BarDrawers.bottom + ear: BarDrawers.ear + radius: Math.min(Theme.radius, BarDrawers.bottom / 2) + fillColor: Theme.notchFill + } + ModuleRow { + id: islandRow + position: island.side + active: root.notch + modules: BarLayout.notchModules(root.screen ? root.screen.name : "", island.side) + barScreen: root.screen + anchors.horizontalCenter: parent.horizontalCenter + anchors.verticalCenter: parent.verticalCenter + } } + Island { id: leftIsland; side: "left" } + Island { id: rightIsland; side: "right" } NotchPill { id: notchPill barScreen: root.screen diff --git a/quickshell/config/defaults.json b/quickshell/config/defaults.json index 200ecce..a6c9200 100644 --- a/quickshell/config/defaults.json +++ b/quickshell/config/defaults.json @@ -276,7 +276,8 @@ "openSpeed": 100, "closeSpeed": 100, "colorSpeed": 100, - "workspaceStyle": "bar" + "workspaceStyle": "bar", + "islandStyle": "float" }, "dashboard": { "enabled": true, diff --git a/quickshell/services/ConfigLogic.js b/quickshell/services/ConfigLogic.js index 98fce60..f75393f 100644 --- a/quickshell/services/ConfigLogic.js +++ b/quickshell/services/ConfigLogic.js @@ -90,6 +90,7 @@ function validate(c) { if(!Number.isFinite(c.notch.opacity) || c.notch.opacity<0 || c.notch.opacity>100 || typeof c.notch.color!=="string" || (c.notch.color!=="" && !/^#[0-9a-fA-F]{6}$/.test(c.notch.color)))throw Error("Invalid notch colour"); if(typeof c.notch.glassOnOpen!=="boolean" || typeof c.notch.launcherMatch!=="boolean" || ["openSpeed","closeSpeed","colorSpeed"].some(k=>!Number.isFinite(c.notch[k]) || c.notch[k]<25 || c.notch[k]>300))throw Error("Invalid notch animation"); if(!["bar","numbers","roman","kanji","dots","pacman"].includes(c.notch.workspaceStyle))throw Error("Invalid notch workspace style"); + if(!["float","pill","notch"].includes(c.notch.islandStyle))throw Error("Invalid notch island style"); if(typeof c.osd.enabled!=="boolean" || !["slide","drop","fade","shrink"].includes(c.osd.animation) || !["top-right","top-center","bottom-center"].includes(c.osd.position) || !Number.isInteger(c.osd.timeout) || c.osd.timeout<500 || c.osd.timeout>5000 || !Number.isInteger(c.osd.step) || c.osd.step<1 || c.osd.step>20)throw Error("Invalid OSD preferences"); const notes=c.notifications; if(!notes || ["enabled","doNotDisturb","criticalInDnd"].some(k=>typeof notes[k]!=="boolean") || !["slide","drop","fade","shrink"].includes(notes.animation) || !["top-right","top-center"].includes(notes.position) || !Number.isInteger(notes.timeout) || notes.timeout<1000 || notes.timeout>30000 || !Number.isInteger(notes.maxPopups) || notes.maxPopups<1 || notes.maxPopups>6)throw Error("Invalid notification preferences"); diff --git a/quickshell/settings/pages/Notch.qml b/quickshell/settings/pages/Notch.qml index a04e6ab..d88c2ca 100644 --- a/quickshell/settings/pages/Notch.qml +++ b/quickshell/settings/pages/Notch.qml @@ -64,70 +64,75 @@ SettingsPage { } 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." + description: "Splits the bar into side islands with a notch at the top centre. Super+N switches between notch mode and the full bar." PreferenceToggle { - label: "Notch" - description: root.options.enabled ? "On: notch mode" : "Off: the full bar" + label: "Notch mode" + description: root.options.enabled ? "On: islands and a notch" : "Off: the full bar" icon: "󰹑" setting: "notch.enabled" } + SettingRow { + title: "Preview" + description: "Super+C, Super+X or a click on the notch open it too" + icon: "󰈈" + GlassButton { + objectName: "notchOpenButton" + text: "Open notch" + enabled: root.options.enabled + onClicked: ShellState.openNotch() + } + } } SettingsSection { - title: "Look" - description: "0% is the normal glass. Raise the opacity towards a solid colour: e.g. 50% with a purple colour, or 100% black for OLED." + title: "Islands" + description: "The bar modules either side of the notch." enabled: root.options.enabled - PreferenceSlider { - label: "Notch opacity" - icon: "󰃟" - setting: "notch.opacity" - from: 0 - to: 100 - step: 1 - unit: "%" + PreferenceChoice { + label: "Island style" + description: "float: modules on the wallpaper; pill: rounded pills; notch: hung from the top edge like the notch. Pill and notch use the notch colour." + icon: "󰕰" + setting: "notch.islandStyle" + choices: ["float", "pill", "notch"] } + ModulePicker { + title: "Left island" + icon: "󰁍" + key: "left" + } + ModulePicker { + title: "Right island" + icon: "󰁔" + key: "right" + } + PreferenceChoice { + label: "Workspace style" + description: "\"bar\" uses the style from Settings → Bar" + icon: "󰕮" + setting: "notch.workspaceStyle" + choices: ["bar", "numbers", "roman", "kanji", "dots", "pacman"] + } + } + SettingsSection { + title: "Open notch" + description: "Dashboard pages on the left (scroll to switch), controls and weather in the middle, notifications on the right. The cog edits its tiles in place, separately from the Control Center." + enabled: root.options.enabled PreferenceToggle { - label: "Glassy when open" - description: "Keeps the colour and opacity on the docked notch; the open notch fades back to the normal glass" - icon: "󰂵" - setting: "notch.glassOnOpen" + label: "Open on Media while audio plays" + description: "Otherwise it opens on the last page" + icon: "󰝚" + setting: "notch.mediaFirst" } - PreferenceToggle { - visible: root.options.glassOnOpen - label: "Launcher keeps notch colour" - description: "Off: the launcher turns glassy when open too" - icon: "󰍉" - setting: "notch.launcherMatch" - } - PreferenceSlider { - label: "Opening speed" - description: "Notch and launcher; 100% follows the shell's animation duration" - icon: "󰓅" - setting: "notch.openSpeed" - from: 25 - to: 300 - step: 5 - unit: "%" - } - PreferenceSlider { - label: "Closing speed" - description: "100% follows the shell's animation duration" - icon: "󰾆" - setting: "notch.closeSpeed" - from: 25 - to: 300 - step: 5 - unit: "%" - } - PreferenceSlider { - label: "Colour change speed" - description: "How fast the docked colour turns glassy when opening (closing never outlasts the close)" - icon: "󰏘" - setting: "notch.colorSpeed" - from: 25 - to: 300 - step: 5 - unit: "%" + ModulePicker { + title: "Module strip" + description: "Bar modules left of the clock, e.g. AI usage or the screen recorder. The mouse wheel scrolls it when it overflows." + icon: "󰹑" + key: "strip" } + } + SettingsSection { + title: "Colour" + description: "0% opacity is the normal glass. Raise it towards a solid colour: e.g. 50% with a purple colour, or 100% black for OLED." + enabled: root.options.enabled SettingRow { title: "Notch colour" description: root.options.color ? "Custom colour" : "Glass tint (Appearance)" @@ -155,60 +160,61 @@ SettingsPage { onChosen: color => ConfigService.setValue("notch.color", color.toString()) } } - } - SettingsSection { - title: "Opening" - enabled: root.options.enabled + PreferenceSlider { + label: "Opacity" + icon: "󰃟" + setting: "notch.opacity" + from: 0 + to: 100 + step: 1 + unit: "%" + } PreferenceToggle { - label: "Open on Media while audio plays" - description: "Otherwise it opens on the last page" - icon: "󰝚" - setting: "notch.mediaFirst" + label: "Glassy when open" + description: "The open notch fades back to the normal glass; the docked notch keeps the colour" + icon: "󰂵" + setting: "notch.glassOnOpen" } - SettingRow { - title: "Preview" - icon: "󰈈" - GlassButton { - objectName: "notchOpenButton" - text: "Open notch" - enabled: root.options.enabled - onClicked: ShellState.openNotch() - } + PreferenceToggle { + visible: root.options.glassOnOpen + label: "Launcher keeps notch colour" + description: "Off: the launcher turns glassy too" + icon: "󰍉" + setting: "notch.launcherMatch" } - } - SettingsSection { - title: "Workspaces" - enabled: root.options.enabled - PreferenceChoice { - label: "Workspace style" - description: "Notch mode only; \"bar\" uses the style from Settings → Bar" + PreferenceSlider { + visible: root.options.glassOnOpen + label: "Colour change speed" + description: "How fast it turns glassy when opening (closing never outlasts the close)" icon: "󰏘" - setting: "notch.workspaceStyle" - choices: ["bar", "numbers", "roman", "kanji", "dots", "pacman"] + setting: "notch.colorSpeed" + from: 25 + to: 300 + step: 5 + unit: "%" } } 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." + title: "Animation" + description: "Notch and launcher; 100% follows the shell's animation duration." 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" + PreferenceSlider { + label: "Opening speed" + icon: "󰓅" + setting: "notch.openSpeed" + from: 25 + to: 300 + step: 5 + unit: "%" } - ModulePicker { - title: "Left island" - icon: "󰁍" - key: "left" + PreferenceSlider { + label: "Closing speed" + icon: "󰾆" + setting: "notch.closeSpeed" + from: 25 + to: 300 + step: 5 + unit: "%" } - ModulePicker { - title: "Right island" - icon: "󰁔" - key: "right" - } - } - SettingNote { - text: "Super+N switches between notch mode and the full bar. The cog in the open notch edits its tiles in place, separately from the Control Center. Follow Control Center (in that editor) mirrors the Control Center again." } }