Grow the launcher out of the notch like the notch panel
In notch mode the launcher now morphs from the collapsed notch with the notch's own curve and open/close speeds: the shape stays solid, width leads the height, and the search fades in once it is mostly open. The notch's time and media fade out as it grows and back in as it closes, and the pill stays hidden until the launcher has shrunk home. The pill's contents move to NotchGlance so both can draw them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f65c475455
commit
52a0e29959
5 files changed
+126
-66
No files matched your search
@@ -112,6 +112,6 @@ PanelWindow {
|
|||||||
width: implicitWidth
|
width: implicitWidth
|
||||||
height: implicitHeight
|
height: implicitHeight
|
||||||
// The open notch window draws over this spot on its own screen.
|
// The open notch window draws over this spot on its own screen.
|
||||||
visible: root.notch && !(ShellState.notchWindow && ShellState.notchWindow.visible && ShellState.notchWindow.screen === root.screen) && !(ShellState.launcherOpen && ScreenService.current(ShellState.launcherScreen) === root.screen) && !(ShellState.wallpaperWindow && ShellState.wallpaperWindow.visible && ShellState.wallpaperWindow.screen === root.screen)
|
visible: root.notch && !(ShellState.notchWindow && ShellState.notchWindow.visible && ShellState.notchWindow.screen === root.screen) && !(ShellState.launcherWindow && ShellState.launcherWindow.visible && ShellState.launcherWindow.screen === root.screen) && !(ShellState.wallpaperWindow && ShellState.wallpaperWindow.visible && ShellState.wallpaperWindow.screen === root.screen)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -71,6 +71,7 @@ Singleton {
|
|||||||
readonly property real notchPillWidth: MediaService.playing ? 236 : 128
|
readonly property real notchPillWidth: MediaService.playing ? 236 : 128
|
||||||
property var notchScreen: null
|
property var notchScreen: null
|
||||||
property var notchWindow: null
|
property var notchWindow: null
|
||||||
|
property var launcherWindow: null
|
||||||
// "main" is the three-column panel; "computer" is the full Performance view.
|
// "main" is the three-column panel; "computer" is the full Performance view.
|
||||||
property string notchView: "main"
|
property string notchView: "main"
|
||||||
function openNotch() {
|
function openNotch() {
|
||||||
|
|||||||
@@ -8,6 +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
|
||||||
@@ -28,7 +29,7 @@ PanelWindow {
|
|||||||
left: true
|
left: true
|
||||||
right: true
|
right: true
|
||||||
}
|
}
|
||||||
visible: ShellState.launcherOpen || panel.opacity > 0.01
|
visible: ShellState.launcherOpen || 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"
|
||||||
@@ -79,6 +80,36 @@ 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 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
|
||||||
|
Behavior on progress {
|
||||||
|
enabled: root.notch
|
||||||
|
NumberAnimation {
|
||||||
|
id: morph
|
||||||
|
duration: ShellState.launcherOpen ? 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]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
readonly property bool settled: ShellState.launcherOpen && !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
|
||||||
|
value: root.barHeight + root.bodyHeight
|
||||||
|
restoreMode: Binding.RestoreNone
|
||||||
|
}
|
||||||
|
Behavior on heldHeight {
|
||||||
|
enabled: root.notch && root.settled && !root.snapping
|
||||||
|
NumberAnimation {
|
||||||
|
duration: Theme.duration
|
||||||
|
easing.type: Easing.OutCubic
|
||||||
|
}
|
||||||
|
}
|
||||||
// Pills sit inside the search bar in notch mode, smaller.
|
// Pills sit inside the search bar in notch mode, smaller.
|
||||||
readonly property int notchPill: 36
|
readonly property int notchPill: 36
|
||||||
readonly property real maxBodyHeight: Math.min(460, root.height * 0.78 - barHeight - (notch ? 0 : root.height * 0.22))
|
readonly property real maxBodyHeight: Math.min(460, root.height * 0.78 - barHeight - (notch ? 0 : root.height * 0.22))
|
||||||
@@ -146,8 +177,14 @@ PanelWindow {
|
|||||||
selectedIndex = 0;
|
selectedIndex = 0;
|
||||||
search.forceActiveFocus();
|
search.forceActiveFocus();
|
||||||
}
|
}
|
||||||
Component.onCompleted: LauncherState.window = root
|
Component.onCompleted: {
|
||||||
Component.onDestruction: LauncherState.window = null
|
LauncherState.window = root;
|
||||||
|
ShellState.launcherWindow = root;
|
||||||
|
}
|
||||||
|
Component.onDestruction: {
|
||||||
|
LauncherState.window = null;
|
||||||
|
ShellState.launcherWindow = null;
|
||||||
|
}
|
||||||
Connections {
|
Connections {
|
||||||
target: ShellState
|
target: ShellState
|
||||||
function onLauncherOpenChanged() {
|
function onLauncherOpenChanged() {
|
||||||
@@ -270,7 +307,6 @@ PanelWindow {
|
|||||||
visible: root.notch
|
visible: root.notch
|
||||||
x: panel.x - BarDrawers.ear
|
x: panel.x - BarDrawers.ear
|
||||||
y: 0
|
y: 0
|
||||||
opacity: panel.opacity
|
|
||||||
bodyWidth: panel.width
|
bodyWidth: panel.width
|
||||||
bodyHeight: panel.height
|
bodyHeight: panel.height
|
||||||
ear: BarDrawers.ear
|
ear: BarDrawers.ear
|
||||||
@@ -283,42 +319,53 @@ PanelWindow {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// The collapsed notch's time and media, fading out as the launcher grows
|
||||||
|
// out of it and back in as it shrinks home.
|
||||||
|
NotchGlance {
|
||||||
|
visible: root.notch && opacity > 0
|
||||||
|
x: Math.round((root.width - width) / 2)
|
||||||
|
y: Math.round((BarDrawers.bottom - height) / 2)
|
||||||
|
opacity: Math.max(0, 1 - root.progress / 0.3)
|
||||||
|
}
|
||||||
GlassPanel {
|
GlassPanel {
|
||||||
id: panel
|
id: panel
|
||||||
objectName: "launcherSurface"
|
objectName: "launcherSurface"
|
||||||
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: ShellState.launcherOpen ? root.targetWidth : root.notch ? ShellState.notchPillWidth : Math.min(320, root.targetWidth)
|
width: root.notch ? ShellState.notchPillWidth + (root.targetWidth - ShellState.notchPillWidth) * root.wp : ShellState.launcherOpen ? root.targetWidth : Math.min(320, root.targetWidth)
|
||||||
height: root.notch && !ShellState.launcherOpen ? BarDrawers.bottom : 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: ShellState.launcherOpen ? 1 : 0
|
opacity: root.notch ? root.contentOpacity : ShellState.launcherOpen ? 1 : 0
|
||||||
scale: ShellState.launcherOpen || root.notch ? 1 : 1 - 0.04 * Theme.intensity
|
scale: ShellState.launcherOpen || root.notch ? 1 : 1 - 0.04 * Theme.intensity
|
||||||
clip: true
|
clip: true
|
||||||
Behavior on width {
|
Behavior on width {
|
||||||
|
enabled: !root.notch
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: !root.notch ? Theme.duration : ShellState.launcherOpen ? Theme.notchOpenDuration : Theme.notchCloseDuration
|
duration: Theme.duration
|
||||||
easing.type: Easing.OutCubic
|
easing.type: Easing.OutCubic
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Behavior on height {
|
Behavior on height {
|
||||||
enabled: !root.snapping
|
enabled: !root.notch && !root.snapping
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: !root.notch ? Theme.duration : ShellState.launcherOpen ? Theme.notchOpenDuration : Theme.notchCloseDuration
|
duration: Theme.duration
|
||||||
easing.type: Easing.OutCubic
|
easing.type: Easing.OutCubic
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Behavior on opacity {
|
Behavior on opacity {
|
||||||
|
enabled: !root.notch
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: !root.notch ? Theme.duration : ShellState.launcherOpen ? Theme.notchOpenDuration : Theme.notchCloseDuration
|
duration: Theme.duration
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Behavior on scale {
|
Behavior on scale {
|
||||||
|
enabled: !root.notch
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: !root.notch ? Theme.duration : ShellState.launcherOpen ? Theme.notchOpenDuration : Theme.notchCloseDuration
|
duration: Theme.duration
|
||||||
easing.type: Easing.OutCubic
|
easing.type: Easing.OutCubic
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,63 @@
|
|||||||
|
pragma ComponentBehavior: Bound
|
||||||
|
import QtQuick
|
||||||
|
import Quickshell
|
||||||
|
import Quickshell.Widgets
|
||||||
|
import "../services"
|
||||||
|
import "../theme"
|
||||||
|
|
||||||
|
// What the collapsed notch shows: the time, plus cover art and a small
|
||||||
|
// visualizer while audio plays. Shared by the pill and by the launcher, which
|
||||||
|
// fades it out as it grows out of the notch.
|
||||||
|
Row {
|
||||||
|
id: root
|
||||||
|
property bool playing: MediaService.playing
|
||||||
|
spacing: 10
|
||||||
|
ClippingRectangle {
|
||||||
|
visible: root.playing
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
width: 22
|
||||||
|
height: 22
|
||||||
|
radius: 6
|
||||||
|
color: Theme.fill
|
||||||
|
Image {
|
||||||
|
anchors.fill: parent
|
||||||
|
source: MediaService.artwork
|
||||||
|
sourceSize: Qt.size(44, 44)
|
||||||
|
fillMode: Image.PreserveAspectCrop
|
||||||
|
asynchronous: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Text {
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
text: Qt.formatDateTime(clock.date, ConfigService.ready && !ConfigService.data.bar.clock.use24Hour ? "h:mm" : "HH:mm")
|
||||||
|
color: Theme.text
|
||||||
|
font.pixelSize: 14
|
||||||
|
font.weight: Font.DemiBold
|
||||||
|
font.features: {
|
||||||
|
"tnum": 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Row {
|
||||||
|
visible: root.playing
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
height: 16
|
||||||
|
spacing: 2
|
||||||
|
Repeater {
|
||||||
|
model: 8
|
||||||
|
Rectangle {
|
||||||
|
required property int index
|
||||||
|
// Every third Cava band, so the eight span the spectrum.
|
||||||
|
readonly property real level: CavaService.bars[index * 3] || 0
|
||||||
|
width: 3
|
||||||
|
height: Math.max(3, 16 * level)
|
||||||
|
y: 16 - height
|
||||||
|
radius: 1.5
|
||||||
|
color: Theme.accent
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
SystemClock {
|
||||||
|
id: clock
|
||||||
|
precision: SystemClock.Minutes
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,5 @@
|
|||||||
pragma ComponentBehavior: Bound
|
pragma ComponentBehavior: Bound
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import Quickshell
|
|
||||||
import Quickshell.Widgets
|
|
||||||
import "../components"
|
import "../components"
|
||||||
import "../core"
|
import "../core"
|
||||||
import "../services"
|
import "../services"
|
||||||
@@ -40,10 +38,6 @@ Item {
|
|||||||
easing.bezierCurve: [0.2, 0, 0, 1, 1, 1]
|
easing.bezierCurve: [0.2, 0, 0, 1, 1, 1]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SystemClock {
|
|
||||||
id: clock
|
|
||||||
precision: SystemClock.Minutes
|
|
||||||
}
|
|
||||||
Demand {
|
Demand {
|
||||||
service: CavaService
|
service: CavaService
|
||||||
counter: "widgetConsumers"
|
counter: "widgetConsumers"
|
||||||
@@ -63,54 +57,9 @@ Item {
|
|||||||
width: ShellState.notchPillWidth
|
width: ShellState.notchPillWidth
|
||||||
height: root.height
|
height: root.height
|
||||||
}
|
}
|
||||||
Row {
|
NotchGlance {
|
||||||
id: content
|
|
||||||
anchors.centerIn: lead
|
anchors.centerIn: lead
|
||||||
spacing: 10
|
playing: root.playing
|
||||||
ClippingRectangle {
|
|
||||||
visible: root.playing
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
width: 22
|
|
||||||
height: 22
|
|
||||||
radius: 6
|
|
||||||
color: Theme.fill
|
|
||||||
Image {
|
|
||||||
anchors.fill: parent
|
|
||||||
source: MediaService.artwork
|
|
||||||
sourceSize: Qt.size(44, 44)
|
|
||||||
fillMode: Image.PreserveAspectCrop
|
|
||||||
asynchronous: true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Text {
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
text: Qt.formatDateTime(clock.date, ConfigService.ready && !ConfigService.data.bar.clock.use24Hour ? "h:mm" : "HH:mm")
|
|
||||||
color: Theme.text
|
|
||||||
font.pixelSize: 14
|
|
||||||
font.weight: Font.DemiBold
|
|
||||||
font.features: {
|
|
||||||
"tnum": 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Row {
|
|
||||||
visible: root.playing
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
height: 16
|
|
||||||
spacing: 2
|
|
||||||
Repeater {
|
|
||||||
model: 8
|
|
||||||
Rectangle {
|
|
||||||
required property int index
|
|
||||||
// Every third Cava band, so the eight span the spectrum.
|
|
||||||
readonly property real level: CavaService.bars[index * 3] || 0
|
|
||||||
width: 3
|
|
||||||
height: Math.max(3, 16 * level)
|
|
||||||
y: 16 - height
|
|
||||||
radius: 1.5
|
|
||||||
color: Theme.accent
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|||||||
Reference in new issue
Block a user