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
+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
CommandSearch 1.0 CommandSearch.qml
Launcher 1.0 Launcher.qml
NotchSearch 1.0 NotchSearch.qml