Add Clipboard and Emoji pills beside the launcher bar

Round glass pills to the right of the search bar switch the launcher to
Clipboard History or the Emoji picker and back, naming themselves in the
empty bar on hover. The launcher runtime test now runs without a second
notification server.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mxandClaude Opus 5.5 committed 2026-10-17 22:13:48 +02:00
1 parent 7f1189606c
commit 9e1ac4efe7
3 files changed
+95 -3

No files matched your search

+76 -2
View File
@@ -69,7 +69,12 @@ PanelWindow {
readonly property var results: clipboardMode ? clipboardResults : emojiMode ? emojiResults : showList ? (commandMode ? commands.results : apps.results) : showGrid ? allApps : []
property int selectedIndex: 0
property string launchError: ""
readonly property real targetWidth: Math.min(options.width, root.width - 40)
// Room is kept for the mode pills on the right of the bar.
readonly property int pillSize: 48
readonly property real pillsWidth: 2 * pillSize + 2 * 10
readonly property real targetWidth: Math.min(options.width, root.width - 40 - 2 * pillsWidth)
// A hovered mode pill names itself in the empty search bar.
property string pillHover: ""
readonly property int barHeight: 60
readonly property real maxBodyHeight: Math.min(460, root.height * 0.78 - barHeight - (root.height * 0.22))
// Clipboard mode shows the latest five rows; the rest scroll.
@@ -182,6 +187,75 @@ PanelWindow {
anchors.fill: parent
onClicked: ShellState.launcherOpen = false
}
// Mode pills beside the search bar (macOS Spotlight style): each toggles
// its launcher mode; the active one is filled.
Row {
id: pills
objectName: "launcherPills"
x: panel.x + panel.width + 10
y: panel.y + (root.barHeight - root.pillSize) / 2
spacing: 10
opacity: panel.opacity
scale: panel.scale
Repeater {
model: [
{
mode: "clipboard",
label: "Clipboard",
glyph: "󰅌",
fallback: "⎘"
},
{
mode: "emoji",
label: "Emoji",
glyph: "󰞅",
fallback: "☺"
}
]
GlassPanel {
id: pill
required property var modelData
readonly property bool active: ShellState.launcherMode === modelData.mode
objectName: "launcherPill-" + modelData.mode
width: root.pillSize
height: root.pillSize
radius: width / 2
color: active ? Theme.accent : Qt.alpha(Theme.surface, Math.min(1, surfaceOpacity + (pillArea.containsMouse ? 0.18 : 0)))
Accessible.role: Accessible.Button
Accessible.name: modelData.label
scale: pillArea.pressed ? 0.92 : 1
Behavior on scale {
NumberAnimation {
duration: Theme.duration / 2
easing.type: Easing.OutCubic
}
}
Text {
anchors.centerIn: parent
text: Icons.available ? pill.modelData.glyph : pill.modelData.fallback
font.family: Icons.available ? Icons.family : ""
font.pixelSize: 21
color: pill.active ? Theme.accentText : Theme.text
}
MouseArea {
id: pillArea
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onContainsMouseChanged: {
if (containsMouse)
root.pillHover = pill.modelData.label;
else if (root.pillHover === pill.modelData.label)
root.pillHover = "";
}
onClicked: {
ShellState.launcherMode = pill.active ? "apps" : pill.modelData.mode;
search.forceActiveFocus();
}
}
}
}
}
GlassPanel {
id: panel
objectName: "launcherSurface"
@@ -269,7 +343,7 @@ PanelWindow {
objectName: "launcherSearch"
Layout.fillWidth: true
Layout.preferredHeight: 40
placeholderText: root.clipboardMode ? "Clipboard History" : root.emojiMode ? "Search emoji" : root.browsing ? "Search applications" : "Search :3"
placeholderText: root.pillHover || (root.clipboardMode ? "Clipboard History" : root.emojiMode ? "Search emoji" : root.browsing ? "Search applications" : "Search :3")
color: Theme.text
placeholderTextColor: Theme.textSecondary
selectByMouse: true