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:
mxandClaude Opus 5.5 committed 2026-11-19 00:52:59 +01:00
1 parent a0de1d2c41
commit fc272e45b2
4 files changed
+137 -57

No files matched your search

+13
View File
@@ -92,6 +92,19 @@ Singleton {
else else
openNotch(); openNotch();
} }
// Opens the notch straight onto a full view ("computer" or "equalizer");
// asked again on that view, it closes. With the full bar, the matching
// dashboard tab opens instead.
function toggleNotchView(view) {
if (!notchMode)
return toggleDashboard(view === "computer" ? "performance" : "media");
if (notchOpen && notchView === view) {
notchOpen = false;
return;
}
openNotch();
notchView = view;
}
onNotchModeChanged: if (!notchMode) onNotchModeChanged: if (!notchMode)
notchOpen = false notchOpen = false
// Super+N: swaps between notch mode and the full bar. // Super+N: swaps between notch mode and the full bar.
+88 -54
View File
@@ -18,7 +18,8 @@ import "../widgets/faces" as Faces
// notch at the top edge into three columns: a dashboard pager on the left // notch at the top edge into three columns: a dashboard pager on the left
// (Media, Performance, Calendar; the wheel moves between them), the Control // (Media, Performance, Calendar; the wheel moves between them), the Control
// Center tiles and weather in the middle, and notifications on the right. // 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. // The layer is sized to the shape so HyprGlass follows its outline.
// qmllint disable uncreatable-type // qmllint disable uncreatable-type
PanelWindow { PanelWindow {
@@ -29,6 +30,12 @@ PanelWindow {
readonly property real screenHeight: screen ? screen.height : 1080 readonly property real screenHeight: screen ? screen.height : 1080
readonly property var options: ConfigService.ready ? ConfigService.data.notch : null readonly property var options: ConfigService.ready ? ConfigService.data.notch : null
readonly property bool computer: ShellState.notchView === "computer" 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 ear: BarDrawers.ear
readonly property real band: BarDrawers.bottom readonly property real band: BarDrawers.bottom
readonly property int pad: 22 readonly property int pad: 22
@@ -42,11 +49,11 @@ PanelWindow {
// Open size of each view, then the morph between the pill and that size. // 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 mainWidth: 2 * sideWidth + middleWidth + 2 * columnGap + 2 * pad
readonly property real mainHeight: Math.max(600, middle.contentHeight + header + gutter + pad) readonly property real mainHeight: Math.max(600, middle.contentHeight + header + gutter + pad)
readonly property Item computerItem: computerLoader.item as Item readonly property Item detailItem: (equalizer ? equalizerView.item : computerView.item) as Item
readonly property real computerWidth: (computerItem ? computerItem.implicitWidth : 800) + 2 * pad readonly property real detailWidth: (detailItem ? detailItem.implicitWidth : equalizer ? 400 : 800) + 2 * pad
readonly property real computerHeight: band + 44 + (computerItem ? computerItem.implicitHeight : 400) + pad readonly property real detailHeight: band + 44 + (detailItem ? detailItem.implicitHeight : 400) + pad
readonly property real openWidth: Math.min(screenWidth - 2 * (BarDrawers.margin + ear) - 40, computer ? computerWidth : mainWidth) readonly property real openWidth: Math.min(screenWidth - 2 * (BarDrawers.margin + ear) - 40, detail ? detailWidth : mainWidth)
readonly property real openHeight: Math.min(screenHeight - 40, computer ? computerHeight : mainHeight) readonly property real openHeight: Math.min(screenHeight - 40, detail ? detailHeight : mainHeight)
property real progress: ShellState.notchOpen ? 1 : 0 property real progress: ShellState.notchOpen ? 1 : 0
Behavior on progress { Behavior on progress {
NumberAnimation { NumberAnimation {
@@ -187,7 +194,7 @@ PanelWindow {
Keys.onEscapePressed: { Keys.onEscapePressed: {
if (middle.editing) if (middle.editing)
middle.editing = false; middle.editing = false;
else if (root.computer) else if (root.detail)
ShellState.notchView = "main"; ShellState.notchView = "main";
else else
ShellState.notchOpen = false; ShellState.notchOpen = false;
@@ -227,7 +234,7 @@ PanelWindow {
// Header: chosen bar modules left of the clock (the wheel scrolls them // Header: chosen bar modules left of the clock (the wheel scrolls them
// sideways), the tile editor cog, and a divider under it all. // 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 { Flickable {
id: strip id: strip
objectName: "notchStrip" objectName: "notchStrip"
@@ -332,7 +339,7 @@ PanelWindow {
width: root.mainWidth - 2 * root.pad width: root.mainWidth - 2 * root.pad
height: root.targetHeight - root.header - root.gutter - root.pad height: root.targetHeight - root.header - root.gutter - root.pad
visible: opacity > 0 visible: opacity > 0
opacity: root.computer ? 0 : root.contentOpacity opacity: root.detail ? 0 : root.contentOpacity
Behavior on opacity { Behavior on opacity {
enabled: root.settled enabled: root.settled
NumberAnimation { NumberAnimation {
@@ -1010,55 +1017,75 @@ PanelWindow {
} }
} }
// "Your computer": the dashboard's Performance tab ------------------- // Full views: "Your computer" (the dashboard's Performance tab) and
Item { // the dashboard's EasyEffects equalizer ------------------------------
DetailView {
id: computerView id: computerView
x: root.pad view: "computer"
y: root.band title: "Your computer"
width: root.bodyWidth - 2 * root.pad source: DashboardRegistry.entry("performance").source
height: Math.max(0, root.bodyHeight - root.band - root.pad) }
visible: opacity > 0 DetailView {
opacity: root.computer ? root.contentOpacity : 0 id: equalizerView
Behavior on opacity { view: "equalizer"
enabled: root.settled title: "Equalizer"
NumberAnimation { source: Qt.resolvedUrl("../dashboard/Equalizer.qml")
duration: Theme.notchDuration }
} }
// 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 Rectangle {
objectName: "notchBack" objectName: detailView.view === "computer" ? "notchBack" : "notchBack-" + detailView.view
width: backLabel.implicitWidth + 28 width: backLabel.implicitWidth + 28
height: 30 height: 30
radius: 15 radius: 15
color: backArea.containsMouse ? Theme.hover : Theme.fill color: backArea.containsMouse ? Theme.hover : Theme.fill
border.width: 1 border.width: 1
border.color: Theme.hairline border.color: Theme.hairline
Text { Text {
id: backLabel id: backLabel
anchors.centerIn: parent anchors.centerIn: parent
text: (Icons.available ? "󰅁 " : "‹ ") + "Your computer" text: (Icons.available ? "󰅁 " : "‹ ") + detailView.title
color: Theme.text color: Theme.text
font.pixelSize: 13 font.pixelSize: 13
font.weight: Font.DemiBold font.weight: Font.DemiBold
}
MouseArea {
id: backArea
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: ShellState.notchView = "main"
}
} }
Loader { MouseArea {
id: computerLoader id: backArea
y: 44 anchors.fill: parent
anchors.horizontalCenter: parent.horizontalCenter hoverEnabled: true
active: ShellState.notchOpen && root.computer cursorShape: Qt.PointingHandCursor
source: DashboardRegistry.entry("performance").source onClicked: ShellState.notchView = "main"
onLoaded: item.current = Qt.binding(() => ShellState.notchOpen && root.computer)
} }
} }
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 { IpcHandler {
@@ -1082,7 +1109,14 @@ PanelWindow {
return ShellState.toggleNotchMode(); return ShellState.toggleNotchMode();
} }
function view(name: string): void { 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 { function status(): string {
return JSON.stringify({ return JSON.stringify({
+33 -1
View File
@@ -2,12 +2,14 @@ pragma ComponentBehavior: Bound
import QtQuick import QtQuick
import Quickshell.Widgets import Quickshell.Widgets
import "../components" import "../components"
import "../core"
import "../dashboard" import "../dashboard"
import "../services" import "../services"
import "../theme" import "../theme"
// The notch's Media page: large artwork, track, seek bar, transport and a // 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 { Item {
id: root id: root
property bool active: false property bool active: false
@@ -15,6 +17,7 @@ Item {
readonly property bool live: MediaService.length <= 0 || MediaService.length > 7 * 86400 readonly property bool live: MediaService.length <= 0 || MediaService.length > 7 * 86400
readonly property bool hasPlayer: !!MediaService.player readonly property bool hasPlayer: !!MediaService.player
readonly property real artSize: Math.max(120, Math.min(width - 40, height - 250, 250)) 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 { Demand {
service: MediaService service: MediaService
counter: "progressConsumers" 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 { Column {
width: parent.width width: parent.width
+3 -2
View File
@@ -51,7 +51,8 @@ case "${1:-run}" in
exec quickshell ipc --path "$project_dir/quickshell" call dashboard toggle "${2:-}" exec quickshell ipc --path "$project_dir/quickshell" call dashboard toggle "${2:-}"
;; ;;
notch) notch)
# glassmxrph notch [toggle|open|close|mode]; mode swaps notch mode and the full bar # glassmxrph notch [toggle|open|close|mode|computer|equalizer]; mode swaps notch mode and the full bar,
# computer/equalizer open the notch straight onto that view (or the dashboard tab with the full bar)
action=${2:-toggle} action=${2:-toggle}
[ "$action" = mode ] && action=toggleMode [ "$action" = mode ] && action=toggleMode
exec quickshell ipc --path "$project_dir/quickshell" call notch "$action" exec quickshell ipc --path "$project_dir/quickshell" call notch "$action"
@@ -79,5 +80,5 @@ case "${1:-run}" in
settings|close|status) settings|close|status)
exec quickshell ipc --path "$project_dir/quickshell" call shell "$1" exec quickshell ipc --path "$project_dir/quickshell" call shell "$1"
;; ;;
*) echo 'Usage: glassmxrph [run|wallpaper|launcher|overview|clipboard|emoji|dashboard [TAB]|notch [toggle|mode]|plugin ACTION|controlcenter|lock|widgets|osd ACTION|notifications ACTION|settings|close|status|doctor]' >&2; exit 2 ;; *) echo 'Usage: glassmxrph [run|wallpaper|launcher|overview|clipboard|emoji|dashboard [TAB]|notch [toggle|mode|computer|equalizer]|plugin ACTION|controlcenter|lock|widgets|osd ACTION|notifications ACTION|settings|close|status|doctor]' >&2; exit 2 ;;
esac esac