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

+39 -29
View File
@@ -8,7 +8,7 @@ import "../components"
import "../services"
import "../theme"
import "../core"
import "../notch"
// 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
@@ -29,12 +29,12 @@ PanelWindow {
left: 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
exclusionMode: ExclusionMode.Ignore
WlrLayershell.namespace: "glassMxrph-launcher"
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 : ({
width: 680,
maxResults: 50,
@@ -55,13 +55,13 @@ PanelWindow {
description: entry.genericName || entry.comment || entry.id,
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,
title: e.text.replace(/\s+/g, " ").trim(),
description: "",
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,
title: e.name,
description: "",
@@ -83,26 +83,29 @@ PanelWindow {
// 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.
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
// panel does: solid shape throughout, width leading the height a little,
// 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 {
enabled: root.notch
NumberAnimation {
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.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 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.
property real heldHeight: barHeight + bodyHeight
Binding on heldHeight {
when: ShellState.launcherOpen
when: root.open
value: root.barHeight + root.bodyHeight
restoreMode: Binding.RestoreNone
}
@@ -135,7 +138,7 @@ PanelWindow {
running: root.notch && root.visible && root.drawnFrames < 3
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 {
id: unsnap
interval: 120
@@ -180,6 +183,19 @@ PanelWindow {
else
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() {
if (clipboardMode || emojiMode) {
ShellState.launcherMode = "apps";
@@ -202,21 +218,15 @@ PanelWindow {
Connections {
target: ShellState
function onLauncherOpenChanged() {
if (ShellState.launcherOpen) {
search.text = "";
root.browsing = false;
root.launchError = "";
root.selectedIndex = 0;
ClipboardService.refresh();
if (root.emojiMode)
EmojiService.load();
Qt.callLater(() => search.forceActiveFocus());
}
root.reset();
}
function onNotchSearchChanged() {
root.reset();
}
function onLauncherModeChanged() {
if (root.emojiMode)
EmojiService.load();
if (!ShellState.launcherOpen)
if (!root.open)
return;
root.snapping = true;
unsnap.restart();
@@ -229,13 +239,13 @@ PanelWindow {
}
AppSearch {
id: apps
enabled: ShellState.launcherOpen && root.showList && !root.commandMode
enabled: root.open && root.showList && !root.commandMode
query: search.text
limit: root.options.maxResults
}
CommandSearch {
id: commands
enabled: ShellState.launcherOpen && root.commandMode
enabled: root.open && root.commandMode
query: search.text
limit: root.options.maxResults
}
@@ -326,10 +336,10 @@ PanelWindow {
ear: BarDrawers.ear
radius: panel.radius
// 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 {
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)
y: root.notch ? 0 : Math.round(root.height * 0.22)
// 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
color: root.notch ? Theme.transparent : Qt.alpha(Theme.surface, surfaceOpacity)
border.width: root.notch ? 0 : 1
plain: root.notch
radius: Math.min(Theme.radius + 6, root.barHeight / 2)
opacity: root.notch ? root.contentOpacity : ShellState.launcherOpen ? 1 : 0
scale: ShellState.launcherOpen || root.notch ? 1 : 1 - 0.04 * Theme.intensity
opacity: root.notch ? root.contentOpacity : root.open ? 1 : 0
scale: root.open || root.notch ? 1 : 1 - 0.04 * Theme.intensity
clip: true
Behavior on width {
enabled: !root.notch