Open the launcher inside the notch in notch mode

The launcher now works like a notification there: the notch pill widens
at its own height, the clock and now playing keep the left end, and a
search field with the top matches as a row of icons fills the right.
Enter launches the highlighted match, Tab and arrows move along the row,
Escape clears then closes, and a click elsewhere closes it. The bar
window takes the keyboard while it is open. Clipboard history and emoji
still open the launcher window, which now only shows for those modes.
NotchGlance moves to components so the launcher and notch can share it
without importing each other.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mxandClaude Opus 5.5 committed 2026-11-14 15:00:05 +01:00
1 parent bb429cb9d9
commit 5e56abd877
7 files changed
+321 -32

No files matched your search

+10
View File
@@ -1,6 +1,7 @@
import QtQuick import QtQuick
import QtQuick.Shapes import QtQuick.Shapes
import Quickshell import Quickshell
import Quickshell.Hyprland
import Quickshell.Wayland import Quickshell.Wayland
import "../components" import "../components"
import "../notch" import "../notch"
@@ -33,6 +34,15 @@ PanelWindow {
exclusionMode: ExclusionMode.Normal exclusionMode: ExclusionMode.Normal
exclusiveZone: BarDrawers.bottom exclusiveZone: BarDrawers.bottom
WlrLayershell.namespace: "glassMxrph-bar" WlrLayershell.namespace: "glassMxrph-bar"
// The notch's search takes the keyboard while it is open on this screen;
// a click anywhere else closes it.
readonly property bool searching: notch && ShellState.notchSearch && ScreenService.current(ShellState.launcherScreen) === screen
WlrLayershell.keyboardFocus: searching ? WlrKeyboardFocus.Exclusive : WlrKeyboardFocus.None
HyprlandFocusGrab {
windows: [root]
active: root.searching
onCleared: ShellState.launcherOpen = false
}
Component.onCompleted: TrayService.registerBar(root) Component.onCompleted: TrayService.registerBar(root)
Component.onDestruction: TrayService.unregisterBar(root) Component.onDestruction: TrayService.unregisterBar(root)
GlassPanel { GlassPanel {
File renamed without changes.
+3
View File
@@ -129,6 +129,9 @@ Singleton {
// "emoji" is the Emoji Picker. // "emoji" is the Emoji Picker.
// Changing it on an open launcher switches in place. // Changing it on an open launcher switches in place.
property string launcherMode: "apps" property string launcherMode: "apps"
// Notch mode searches apps in the notch pill itself, the way a notification
// widens it; clipboard history and emoji still open the launcher window.
readonly property bool notchSearch: notchMode && launcherOpen && launcherMode === "apps"
function activeScreen() { function activeScreen() {
return ScreenService.active; return ScreenService.active;
} }
+39 -29
View File
@@ -8,7 +8,7 @@ import "../components"
import "../services" import "../services"
import "../theme" import "../theme"
import "../core" import "../core"
import "../notch"
// Spotlight-style launcher: opens as a single search bar in the upper third. // Spotlight-style launcher: opens as a single search bar in the upper third.
// Typing shows ranked results below it; the magnifying glass (or ↓ in an // Typing shows ranked results below it; the magnifying glass (or ↓ in an
@@ -29,12 +29,12 @@ PanelWindow {
left: true left: true
right: true right: true
} }
visible: ShellState.launcherOpen || panel.opacity > 0.01 || (notch && progress > 0.001) visible: root.open || panel.opacity > 0.01 || (notch && progress > 0.001)
color: Theme.transparent color: Theme.transparent
exclusionMode: ExclusionMode.Ignore exclusionMode: ExclusionMode.Ignore
WlrLayershell.namespace: "glassMxrph-launcher" WlrLayershell.namespace: "glassMxrph-launcher"
WlrLayershell.layer: WlrLayer.Overlay WlrLayershell.layer: WlrLayer.Overlay
WlrLayershell.keyboardFocus: ShellState.launcherOpen ? WlrKeyboardFocus.Exclusive : WlrKeyboardFocus.None WlrLayershell.keyboardFocus: root.open ? WlrKeyboardFocus.Exclusive : WlrKeyboardFocus.None
readonly property var options: ConfigService.ready ? ConfigService.data.launcher : ({ readonly property var options: ConfigService.ready ? ConfigService.data.launcher : ({
width: 680, width: 680,
maxResults: 50, maxResults: 50,
@@ -55,13 +55,13 @@ PanelWindow {
description: entry.genericName || entry.comment || entry.id, description: entry.genericName || entry.comment || entry.id,
entry: entry entry: entry
})) }))
readonly property var clipboardResults: clipboardMode && ShellState.launcherOpen ? ClipboardService.filter(query).map(e => ({ readonly property var clipboardResults: clipboardMode && root.open ? ClipboardService.filter(query).map(e => ({
id: e.id, id: e.id,
title: e.text.replace(/\s+/g, " ").trim(), title: e.text.replace(/\s+/g, " ").trim(),
description: "", description: "",
clip: e clip: e
})) : [] })) : []
readonly property var emojiResults: emojiMode && ShellState.launcherOpen ? EmojiService.filter(query).map(e => ({ readonly property var emojiResults: emojiMode && root.open ? EmojiService.filter(query).map(e => ({
id: e.emoji, id: e.emoji,
title: e.name, title: e.name,
description: "", description: "",
@@ -83,26 +83,29 @@ PanelWindow {
// Notch mode: the launcher drops out of the notch at the top edge. The // Notch mode: the launcher drops out of the notch at the top edge. The
// panel's top corners sit above the screen and concave ears join it there. // panel's top corners sit above the screen and concave ears join it there.
readonly property bool notch: ShellState.notchMode readonly property bool notch: ShellState.notchMode
// Notch mode searches apps inside the notch itself (NotchSearch); this
// window only opens there for clipboard history and emoji.
readonly property bool open: ShellState.launcherOpen && !ShellState.notchSearch
// Notch mode morphs the collapsed notch into the launcher, as the notch // Notch mode morphs the collapsed notch into the launcher, as the notch
// panel does: solid shape throughout, width leading the height a little, // panel does: solid shape throughout, width leading the height a little,
// contents fading in once it is mostly open and out first. // contents fading in once it is mostly open and out first.
property real progress: ShellState.launcherOpen ? 1 : 0 property real progress: root.open ? 1 : 0
Behavior on progress { Behavior on progress {
enabled: root.notch enabled: root.notch
NumberAnimation { NumberAnimation {
id: morph id: morph
duration: ShellState.launcherOpen ? Theme.notchOpenDuration * 2 : Theme.notchCloseDuration * 1.3 duration: root.open ? Theme.notchOpenDuration * 2 : Theme.notchCloseDuration * 1.3
easing.type: Easing.BezierSpline easing.type: Easing.BezierSpline
easing.bezierCurve: ShellState.launcherOpen ? [0.2, 0, 0, 1, 1, 1] : [0.3, 0, 0.8, 0.15, 1, 1] easing.bezierCurve: root.open ? [0.2, 0, 0, 1, 1, 1] : [0.3, 0, 0.8, 0.15, 1, 1]
} }
} }
readonly property bool settled: ShellState.launcherOpen && !morph.running readonly property bool settled: root.open && !morph.running
readonly property real wp: Math.min(1, progress * 1.15) readonly property real wp: Math.min(1, progress * 1.15)
readonly property real contentOpacity: Math.max(0, Math.min(1, (progress - 0.55) / 0.4)) readonly property real contentOpacity: Math.max(0, Math.min(1, (progress - 0.55) / 0.4))
// Open height, held while closing so clearing the results does not jump it. // Open height, held while closing so clearing the results does not jump it.
property real heldHeight: barHeight + bodyHeight property real heldHeight: barHeight + bodyHeight
Binding on heldHeight { Binding on heldHeight {
when: ShellState.launcherOpen when: root.open
value: root.barHeight + root.bodyHeight value: root.barHeight + root.bodyHeight
restoreMode: Binding.RestoreNone restoreMode: Binding.RestoreNone
} }
@@ -135,7 +138,7 @@ PanelWindow {
running: root.notch && root.visible && root.drawnFrames < 3 running: root.notch && root.visible && root.drawnFrames < 3
onTriggered: root.drawnFrames++ onTriggered: root.drawnFrames++
} }
readonly property bool covering: visible && drawnFrames >= 3 && (ShellState.launcherOpen || progress > 0.02) readonly property bool covering: visible && drawnFrames >= 3 && (root.open || progress > 0.02)
Timer { Timer {
id: unsnap id: unsnap
interval: 120 interval: 120
@@ -180,6 +183,19 @@ PanelWindow {
else else
launchError = ApplicationsService.error; launchError = ApplicationsService.error;
} }
// Fresh state each time the window opens.
function reset() {
if (!open)
return;
search.text = "";
browsing = false;
launchError = "";
selectedIndex = 0;
ClipboardService.refresh();
if (emojiMode)
EmojiService.load();
Qt.callLater(() => search.forceActiveFocus());
}
function toggleBrowse() { function toggleBrowse() {
if (clipboardMode || emojiMode) { if (clipboardMode || emojiMode) {
ShellState.launcherMode = "apps"; ShellState.launcherMode = "apps";
@@ -202,21 +218,15 @@ PanelWindow {
Connections { Connections {
target: ShellState target: ShellState
function onLauncherOpenChanged() { function onLauncherOpenChanged() {
if (ShellState.launcherOpen) { root.reset();
search.text = ""; }
root.browsing = false; function onNotchSearchChanged() {
root.launchError = ""; root.reset();
root.selectedIndex = 0;
ClipboardService.refresh();
if (root.emojiMode)
EmojiService.load();
Qt.callLater(() => search.forceActiveFocus());
}
} }
function onLauncherModeChanged() { function onLauncherModeChanged() {
if (root.emojiMode) if (root.emojiMode)
EmojiService.load(); EmojiService.load();
if (!ShellState.launcherOpen) if (!root.open)
return; return;
root.snapping = true; root.snapping = true;
unsnap.restart(); unsnap.restart();
@@ -229,13 +239,13 @@ PanelWindow {
} }
AppSearch { AppSearch {
id: apps id: apps
enabled: ShellState.launcherOpen && root.showList && !root.commandMode enabled: root.open && root.showList && !root.commandMode
query: search.text query: search.text
limit: root.options.maxResults limit: root.options.maxResults
} }
CommandSearch { CommandSearch {
id: commands id: commands
enabled: ShellState.launcherOpen && root.commandMode enabled: root.open && root.commandMode
query: search.text query: search.text
limit: root.options.maxResults limit: root.options.maxResults
} }
@@ -326,10 +336,10 @@ PanelWindow {
ear: BarDrawers.ear ear: BarDrawers.ear
radius: panel.radius radius: panel.radius
// Docked colour; the open fill only if the launcher follows "glassy when open". // Docked colour; the open fill only if the launcher follows "glassy when open".
fillColor: ShellState.launcherOpen ? Theme.notchLauncherFill : Theme.notchFill fillColor: root.open ? Theme.notchLauncherFill : Theme.notchFill
Behavior on fillColor { Behavior on fillColor {
ColorAnimation { ColorAnimation {
duration: ShellState.launcherOpen ? Theme.notchColorDuration : Math.min(Theme.notchColorDuration, Theme.notchCloseDuration) duration: root.open ? Theme.notchColorDuration : Math.min(Theme.notchColorDuration, Theme.notchCloseDuration)
} }
} }
} }
@@ -355,14 +365,14 @@ PanelWindow {
x: Math.round((root.width - width) / 2) x: Math.round((root.width - width) / 2)
y: root.notch ? 0 : Math.round(root.height * 0.22) y: root.notch ? 0 : Math.round(root.height * 0.22)
// Notch mode grows out of the collapsed notch and shrinks back into it. // Notch mode grows out of the collapsed notch and shrinks back into it.
width: root.notch ? ShellState.notchPillWidth + (root.targetWidth - ShellState.notchPillWidth) * root.wp : ShellState.launcherOpen ? root.targetWidth : Math.min(320, root.targetWidth) width: root.notch ? ShellState.notchPillWidth + (root.targetWidth - ShellState.notchPillWidth) * root.wp : root.open ? root.targetWidth : Math.min(320, root.targetWidth)
height: root.notch ? BarDrawers.bottom + (root.heldHeight - BarDrawers.bottom) * root.progress : root.barHeight + root.bodyHeight height: root.notch ? BarDrawers.bottom + (root.heldHeight - BarDrawers.bottom) * root.progress : root.barHeight + root.bodyHeight
color: root.notch ? Theme.transparent : Qt.alpha(Theme.surface, surfaceOpacity) color: root.notch ? Theme.transparent : Qt.alpha(Theme.surface, surfaceOpacity)
border.width: root.notch ? 0 : 1 border.width: root.notch ? 0 : 1
plain: root.notch plain: root.notch
radius: Math.min(Theme.radius + 6, root.barHeight / 2) radius: Math.min(Theme.radius + 6, root.barHeight / 2)
opacity: root.notch ? root.contentOpacity : ShellState.launcherOpen ? 1 : 0 opacity: root.notch ? root.contentOpacity : root.open ? 1 : 0
scale: ShellState.launcherOpen || root.notch ? 1 : 1 - 0.04 * Theme.intensity scale: root.open || root.notch ? 1 : 1 - 0.04 * Theme.intensity
clip: true clip: true
Behavior on width { Behavior on width {
enabled: !root.notch enabled: !root.notch
+233
View File
@@ -0,0 +1,233 @@
pragma ComponentBehavior: Bound
import QtQuick
import "../core"
import "../services"
import "../theme"
// The launcher in notch mode: a search field and a row of top matches inside
// the widened notch, the way a notification shows there. Enter launches the
// highlighted match, Tab and the arrow keys move along the row, Escape clears
// and then closes. Clipboard history and emoji open the launcher window.
Item {
id: root
property bool active: false
readonly property string query: input.text.trim()
readonly property bool commandMode: query.startsWith(">")
readonly property int maxShown: 6
readonly property var results: (commandMode ? commands.results : apps.results).slice(0, maxShown)
property int selectedIndex: 0
property string launchError: ""
readonly property var selected: results[selectedIndex] || null
onResultsChanged: selectedIndex = 0
onActiveChanged: {
input.text = "";
launchError = "";
selectedIndex = 0;
if (active)
Qt.callLater(() => input.forceActiveFocus());
}
AppSearch {
id: apps
enabled: root.active && root.query !== "" && !root.commandMode
query: root.query
limit: root.maxShown
}
CommandSearch {
id: commands
enabled: root.active && root.commandMode
query: root.query
limit: root.maxShown
}
function select(offset) {
if (results.length)
selectedIndex = (selectedIndex + offset + results.length) % results.length;
}
function activate(index) {
const result = results[index];
if (!result)
return;
if (result.command) {
const command = CommandRegistry.commands.find(c => c.id === result.id);
if (!command || !command.stay)
ShellState.launcherOpen = false;
CommandRegistry.execute(result.id);
} else if (ApplicationsService.launch(result.entry, null))
ShellState.launcherOpen = false;
else
launchError = ApplicationsService.error;
}
// Swallows clicks so they reach the field, not the pill behind it.
MouseArea {
anchors.fill: parent
onClicked: input.forceActiveFocus()
}
Text {
id: glass
x: 14
anchors.verticalCenter: parent.verticalCenter
text: Icons.available ? "󰍉" : "⌕"
font.family: Icons.available ? Icons.family : ""
font.pixelSize: 17
color: Theme.textSecondary
}
// Typed text, then the highlighted match's name in grey after it.
Item {
id: field
anchors.left: glass.right
anchors.leftMargin: 10
anchors.right: strip.left
anchors.rightMargin: 12
anchors.verticalCenter: parent.verticalCenter
height: 24
clip: true
TextInput {
id: input
objectName: "notchSearchInput"
anchors.verticalCenter: parent.verticalCenter
width: Math.max(1, Math.min(contentWidth + 2, field.width))
color: Theme.text
selectionColor: Theme.accent
selectedTextColor: Theme.text
font.pixelSize: 15
maximumLength: 256
onTextEdited: root.launchError = ""
Keys.onEscapePressed: {
if (text !== "")
clear();
else
ShellState.launcherOpen = false;
}
Keys.onTabPressed: root.select(1)
Keys.onBacktabPressed: root.select(-1)
Keys.onDownPressed: root.select(1)
Keys.onUpPressed: root.select(-1)
Keys.onRightPressed: event => {
if (cursorPosition === text.length && root.results.length)
root.select(1);
else
event.accepted = false;
}
Keys.onLeftPressed: event => {
if (cursorPosition === text.length && root.selectedIndex > 0)
root.select(-1);
else
event.accepted = false;
}
Keys.onReturnPressed: root.activate(root.selectedIndex)
Keys.onEnterPressed: root.activate(root.selectedIndex)
}
Text {
anchors.verticalCenter: parent.verticalCenter
x: input.text === "" ? 0 : input.width + 8
width: Math.max(0, field.width - x)
elide: Text.ElideRight
font.pixelSize: 15
color: root.launchError ? Theme.urgent : Theme.textSecondary
text: root.launchError ? root.launchError : input.text === "" ? "Search apps" : root.selected ? "— " + root.selected.title : "No matches"
}
}
// Top matches; the highlighted one launches on Enter.
Row {
id: strip
anchors.right: modes.left
anchors.rightMargin: 10
anchors.verticalCenter: parent.verticalCenter
spacing: 4
Repeater {
model: root.results
Rectangle {
id: tile
required property var modelData
required property int index
readonly property bool current: index === root.selectedIndex
width: 34
height: 34
radius: 10
color: current ? Qt.alpha(Theme.accent, 0.35) : tileArea.containsMouse ? Theme.hover : Theme.transparent
border.width: current ? 1 : 0
border.color: Qt.alpha(Theme.accent, 0.8)
Accessible.role: Accessible.Button
Accessible.name: modelData.title
Image {
id: tileIcon
anchors.centerIn: parent
width: 24
height: 24
source: tile.modelData.entry ? ApplicationsService.icon(tile.modelData.entry) : ""
sourceSize: Qt.size(48, 48)
asynchronous: true
smooth: true
mipmap: true
}
Text {
anchors.centerIn: parent
visible: tileIcon.status !== Image.Ready
text: tile.modelData.command ? (Icons.available ? "󰒓" : ">") : tile.modelData.title.charAt(0).toUpperCase()
font.family: Icons.available ? Icons.family : ""
font.pixelSize: 15
color: Theme.text
}
MouseArea {
id: tileArea
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onEntered: root.selectedIndex = tile.index
onClicked: root.activate(tile.index)
}
}
}
}
// Clipboard history and emoji open the full launcher window.
Row {
id: modes
anchors.right: parent.right
anchors.rightMargin: 12
anchors.verticalCenter: parent.verticalCenter
spacing: 4
Repeater {
model: [
{
mode: "clipboard",
glyph: "󰅌",
fallback: "C",
name: "Clipboard history"
},
{
mode: "emoji",
glyph: "󰞅",
fallback: ":)",
name: "Emoji"
}
]
Rectangle {
id: mode
required property var modelData
width: 28
height: 28
radius: 14
color: modeArea.containsMouse ? Theme.hover : Theme.fill
border.width: 1
border.color: Theme.hairline
Accessible.role: Accessible.Button
Accessible.name: modelData.name
Text {
anchors.centerIn: parent
text: Icons.available ? mode.modelData.glyph : mode.modelData.fallback
font.family: Icons.available ? Icons.family : ""
font.pixelSize: 14
color: Theme.text
}
MouseArea {
id: modeArea
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: ShellState.openLauncher(mode.modelData.mode)
}
}
}
}
}
+1
View File
@@ -3,3 +3,4 @@ singleton LauncherState 1.0 LauncherState.qml
AppSearch 1.0 AppSearch.qml AppSearch 1.0 AppSearch.qml
CommandSearch 1.0 CommandSearch.qml CommandSearch 1.0 CommandSearch.qml
Launcher 1.0 Launcher.qml Launcher 1.0 Launcher.qml
NotchSearch 1.0 NotchSearch.qml
+35 -3
View File
@@ -2,13 +2,15 @@ pragma ComponentBehavior: Bound
import QtQuick import QtQuick
import "../components" import "../components"
import "../core" import "../core"
import "../launcher"
import "../services" import "../services"
import "../theme" import "../theme"
// The collapsed notch: a glass island hanging from the screen's top edge with // The collapsed notch: a glass island hanging from the screen's top edge with
// concave ears, showing the time, plus cover art and a small visualizer while // concave ears, showing the time, plus cover art and a small visualizer while
// audio plays. Clicking it opens the notch panel. A new notification widens // audio plays. Clicking it opens the notch panel. A new notification widens
// it: the clock and media keep the left end, the banner takes the right. // it: the clock and media keep the left end, the banner takes the right. The
// launcher opens the same way, with the search where the banner would be.
Item { Item {
id: root id: root
property var barScreen property var barScreen
@@ -24,11 +26,13 @@ Item {
if (latest) if (latest)
notice = latest; notice = latest;
} }
readonly property bool showing: !!latest && owner && visible readonly property bool searching: ShellState.notchSearch && ScreenService.current(ShellState.launcherScreen) === barScreen && visible
readonly property bool showing: !!latest && owner && visible && !searching
// Holds the last banner while the notch closes around it. // Holds the last banner while the notch closes around it.
property var notice: null property var notice: null
readonly property int noticeWidth: 340 readonly property int noticeWidth: 340
readonly property real bodyWidth: ShellState.notchPillWidth + (showing ? noticeWidth : 0) readonly property int searchWidth: 520
readonly property real bodyWidth: ShellState.notchPillWidth + (searching ? searchWidth : showing ? noticeWidth : 0)
implicitWidth: bodyWidth + 2 * BarDrawers.ear implicitWidth: bodyWidth + 2 * BarDrawers.ear
implicitHeight: BarDrawers.bottom implicitHeight: BarDrawers.bottom
Behavior on implicitWidth { Behavior on implicitWidth {
@@ -203,6 +207,34 @@ Item {
} }
} }
} }
Item {
objectName: "notchSearch"
x: lead.x + lead.width
width: Math.max(0, root.width - BarDrawers.ear - x)
height: root.height
clip: true
opacity: root.searching ? 1 : 0
visible: width > 1 && opacity > 0
Behavior on opacity {
NumberAnimation {
duration: root.searching ? Theme.notchDuration * 1.6 : Theme.notchDuration * 0.6
easing.type: Easing.OutCubic
}
}
Rectangle {
anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter
width: 1
height: parent.height * 0.5
color: Theme.hairline
}
// Laid out at full width so it does not reflow while the notch grows.
NotchSearch {
width: root.searchWidth
height: parent.height
active: root.searching
}
}
// 0 (critical) stays until dismissed. Each banner's time counts from its // 0 (critical) stays until dismissed. Each banner's time counts from its
// arrival, so older ones revealed by an expiry leave on schedule; hovering // arrival, so older ones revealed by an expiry leave on schedule; hovering
// restarts the full time. // restarts the full time.