Open the equalizer from the notch's album art, and add notch view commands
Clicking the artwork on the notch's Media page swaps in the dashboard's EasyEffects equalizer as a full view, the way Performance opens "Your computer". `glassmxrph notch equalizer|computer` opens the notch straight onto either view (or the matching dashboard tab with the full bar). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a0de1d2c41
commit
fc272e45b2
4 files changed
+137
-57
No files matched your search
+88
-54
@@ -18,7 +18,8 @@ import "../widgets/faces" as Faces
|
||||
// notch at the top edge into three columns: a dashboard pager on the left
|
||||
// (Media, Performance, Calendar; the wheel moves between them), the Control
|
||||
// Center tiles and weather in the middle, and notifications on the right.
|
||||
// Clicking Performance swaps in the full "Your computer" view.
|
||||
// Clicking Performance swaps in the full "Your computer" view, and clicking
|
||||
// the album art swaps in the EasyEffects equalizer.
|
||||
// The layer is sized to the shape so HyprGlass follows its outline.
|
||||
// qmllint disable uncreatable-type
|
||||
PanelWindow {
|
||||
@@ -29,6 +30,12 @@ PanelWindow {
|
||||
readonly property real screenHeight: screen ? screen.height : 1080
|
||||
readonly property var options: ConfigService.ready ? ConfigService.data.notch : null
|
||||
readonly property bool computer: ShellState.notchView === "computer"
|
||||
readonly property bool equalizer: ShellState.notchView === "equalizer"
|
||||
// A full view replaces the three columns.
|
||||
readonly property bool detail: computer || equalizer
|
||||
readonly property bool equalizerShown: ShellState.notchOpen && equalizer
|
||||
onEqualizerShownChanged: if (equalizerShown)
|
||||
EasyEffectsService.refresh()
|
||||
readonly property real ear: BarDrawers.ear
|
||||
readonly property real band: BarDrawers.bottom
|
||||
readonly property int pad: 22
|
||||
@@ -42,11 +49,11 @@ PanelWindow {
|
||||
// Open size of each view, then the morph between the pill and that size.
|
||||
readonly property real mainWidth: 2 * sideWidth + middleWidth + 2 * columnGap + 2 * pad
|
||||
readonly property real mainHeight: Math.max(600, middle.contentHeight + header + gutter + pad)
|
||||
readonly property Item computerItem: computerLoader.item as Item
|
||||
readonly property real computerWidth: (computerItem ? computerItem.implicitWidth : 800) + 2 * pad
|
||||
readonly property real computerHeight: band + 44 + (computerItem ? computerItem.implicitHeight : 400) + pad
|
||||
readonly property real openWidth: Math.min(screenWidth - 2 * (BarDrawers.margin + ear) - 40, computer ? computerWidth : mainWidth)
|
||||
readonly property real openHeight: Math.min(screenHeight - 40, computer ? computerHeight : mainHeight)
|
||||
readonly property Item detailItem: (equalizer ? equalizerView.item : computerView.item) as Item
|
||||
readonly property real detailWidth: (detailItem ? detailItem.implicitWidth : equalizer ? 400 : 800) + 2 * pad
|
||||
readonly property real detailHeight: band + 44 + (detailItem ? detailItem.implicitHeight : 400) + pad
|
||||
readonly property real openWidth: Math.min(screenWidth - 2 * (BarDrawers.margin + ear) - 40, detail ? detailWidth : mainWidth)
|
||||
readonly property real openHeight: Math.min(screenHeight - 40, detail ? detailHeight : mainHeight)
|
||||
property real progress: ShellState.notchOpen ? 1 : 0
|
||||
Behavior on progress {
|
||||
NumberAnimation {
|
||||
@@ -187,7 +194,7 @@ PanelWindow {
|
||||
Keys.onEscapePressed: {
|
||||
if (middle.editing)
|
||||
middle.editing = false;
|
||||
else if (root.computer)
|
||||
else if (root.detail)
|
||||
ShellState.notchView = "main";
|
||||
else
|
||||
ShellState.notchOpen = false;
|
||||
@@ -227,7 +234,7 @@ PanelWindow {
|
||||
|
||||
// Header: chosen bar modules left of the clock (the wheel scrolls them
|
||||
// sideways), the tile editor cog, and a divider under it all.
|
||||
readonly property bool headerShown: !root.computer && root.contentOpacity > 0
|
||||
readonly property bool headerShown: !root.detail && root.contentOpacity > 0
|
||||
Flickable {
|
||||
id: strip
|
||||
objectName: "notchStrip"
|
||||
@@ -332,7 +339,7 @@ PanelWindow {
|
||||
width: root.mainWidth - 2 * root.pad
|
||||
height: root.targetHeight - root.header - root.gutter - root.pad
|
||||
visible: opacity > 0
|
||||
opacity: root.computer ? 0 : root.contentOpacity
|
||||
opacity: root.detail ? 0 : root.contentOpacity
|
||||
Behavior on opacity {
|
||||
enabled: root.settled
|
||||
NumberAnimation {
|
||||
@@ -1010,55 +1017,75 @@ PanelWindow {
|
||||
}
|
||||
}
|
||||
|
||||
// "Your computer": the dashboard's Performance tab -------------------
|
||||
Item {
|
||||
// Full views: "Your computer" (the dashboard's Performance tab) and
|
||||
// the dashboard's EasyEffects equalizer ------------------------------
|
||||
DetailView {
|
||||
id: computerView
|
||||
x: root.pad
|
||||
y: root.band
|
||||
width: root.bodyWidth - 2 * root.pad
|
||||
height: Math.max(0, root.bodyHeight - root.band - root.pad)
|
||||
visible: opacity > 0
|
||||
opacity: root.computer ? root.contentOpacity : 0
|
||||
Behavior on opacity {
|
||||
enabled: root.settled
|
||||
NumberAnimation {
|
||||
duration: Theme.notchDuration
|
||||
}
|
||||
view: "computer"
|
||||
title: "Your computer"
|
||||
source: DashboardRegistry.entry("performance").source
|
||||
}
|
||||
DetailView {
|
||||
id: equalizerView
|
||||
view: "equalizer"
|
||||
title: "Equalizer"
|
||||
source: Qt.resolvedUrl("../dashboard/Equalizer.qml")
|
||||
}
|
||||
}
|
||||
|
||||
// A full view: a back pill over the loaded page, shown while it is the
|
||||
// notch's view.
|
||||
component DetailView: Item {
|
||||
id: detailView
|
||||
required property string view
|
||||
property string title
|
||||
property alias source: detailLoader.source
|
||||
readonly property bool shown: ShellState.notchView === view
|
||||
readonly property var item: detailLoader.item
|
||||
x: root.pad
|
||||
y: root.band
|
||||
width: root.bodyWidth - 2 * root.pad
|
||||
height: Math.max(0, root.bodyHeight - root.band - root.pad)
|
||||
visible: opacity > 0
|
||||
opacity: shown ? root.contentOpacity : 0
|
||||
Behavior on opacity {
|
||||
enabled: root.settled
|
||||
NumberAnimation {
|
||||
duration: Theme.notchDuration
|
||||
}
|
||||
Rectangle {
|
||||
id: back
|
||||
objectName: "notchBack"
|
||||
width: backLabel.implicitWidth + 28
|
||||
height: 30
|
||||
radius: 15
|
||||
color: backArea.containsMouse ? Theme.hover : Theme.fill
|
||||
border.width: 1
|
||||
border.color: Theme.hairline
|
||||
Text {
|
||||
id: backLabel
|
||||
anchors.centerIn: parent
|
||||
text: (Icons.available ? " " : "‹ ") + "Your computer"
|
||||
color: Theme.text
|
||||
font.pixelSize: 13
|
||||
font.weight: Font.DemiBold
|
||||
}
|
||||
MouseArea {
|
||||
id: backArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: ShellState.notchView = "main"
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
objectName: detailView.view === "computer" ? "notchBack" : "notchBack-" + detailView.view
|
||||
width: backLabel.implicitWidth + 28
|
||||
height: 30
|
||||
radius: 15
|
||||
color: backArea.containsMouse ? Theme.hover : Theme.fill
|
||||
border.width: 1
|
||||
border.color: Theme.hairline
|
||||
Text {
|
||||
id: backLabel
|
||||
anchors.centerIn: parent
|
||||
text: (Icons.available ? " " : "‹ ") + detailView.title
|
||||
color: Theme.text
|
||||
font.pixelSize: 13
|
||||
font.weight: Font.DemiBold
|
||||
}
|
||||
Loader {
|
||||
id: computerLoader
|
||||
y: 44
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
active: ShellState.notchOpen && root.computer
|
||||
source: DashboardRegistry.entry("performance").source
|
||||
onLoaded: item.current = Qt.binding(() => ShellState.notchOpen && root.computer)
|
||||
MouseArea {
|
||||
id: backArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: ShellState.notchView = "main"
|
||||
}
|
||||
}
|
||||
Loader {
|
||||
id: detailLoader
|
||||
y: 44
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
active: ShellState.notchOpen && detailView.shown
|
||||
onLoaded: if ("current" in item)
|
||||
item.current = Qt.binding(() => ShellState.notchOpen && detailView.shown)
|
||||
}
|
||||
}
|
||||
|
||||
IpcHandler {
|
||||
@@ -1082,7 +1109,14 @@ PanelWindow {
|
||||
return ShellState.toggleNotchMode();
|
||||
}
|
||||
function view(name: string): void {
|
||||
ShellState.notchView = name === "computer" ? "computer" : "main";
|
||||
ShellState.notchView = name === "computer" || name === "equalizer" ? name : "main";
|
||||
}
|
||||
// Open straight onto a full view; again on that view closes the notch.
|
||||
function computer(): void {
|
||||
ShellState.toggleNotchView("computer");
|
||||
}
|
||||
function equalizer(): void {
|
||||
ShellState.toggleNotchView("equalizer");
|
||||
}
|
||||
function status(): string {
|
||||
return JSON.stringify({
|
||||
|
||||
@@ -2,12 +2,14 @@ pragma ComponentBehavior: Bound
|
||||
import QtQuick
|
||||
import Quickshell.Widgets
|
||||
import "../components"
|
||||
import "../core"
|
||||
import "../dashboard"
|
||||
import "../services"
|
||||
import "../theme"
|
||||
|
||||
// The notch's Media page: large artwork, track, seek bar, transport and a
|
||||
// Cava strip, sized to fill the left column.
|
||||
// Cava strip, sized to fill the left column. Clicking the artwork opens the
|
||||
// equalizer view (when the dashboard's EasyEffects equalizer is on).
|
||||
Item {
|
||||
id: root
|
||||
property bool active: false
|
||||
@@ -15,6 +17,7 @@ Item {
|
||||
readonly property bool live: MediaService.length <= 0 || MediaService.length > 7 * 86400
|
||||
readonly property bool hasPlayer: !!MediaService.player
|
||||
readonly property real artSize: Math.max(120, Math.min(width - 40, height - 250, 250))
|
||||
readonly property bool equalizer: ConfigService.ready && !!ConfigService.data.dashboard && ConfigService.data.dashboard.easyEffects
|
||||
Demand {
|
||||
service: MediaService
|
||||
counter: "progressConsumers"
|
||||
@@ -60,6 +63,35 @@ Item {
|
||||
}
|
||||
}
|
||||
}
|
||||
// Hover hint for the equalizer.
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: Qt.alpha("black", 0.45)
|
||||
opacity: artArea.containsMouse ? 1 : 0
|
||||
Behavior on opacity {
|
||||
NumberAnimation {
|
||||
duration: Theme.notchDuration / 2
|
||||
}
|
||||
}
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
text: "Equalizer"
|
||||
color: "white"
|
||||
font.pixelSize: 15
|
||||
font.weight: Font.DemiBold
|
||||
}
|
||||
}
|
||||
MouseArea {
|
||||
id: artArea
|
||||
objectName: "notchArtwork"
|
||||
anchors.fill: parent
|
||||
enabled: root.equalizer
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: ShellState.notchView = "equalizer"
|
||||
Accessible.role: Accessible.Button
|
||||
Accessible.name: "Equalizer"
|
||||
}
|
||||
}
|
||||
Column {
|
||||
width: parent.width
|
||||
|
||||
Reference in new issue
Block a user