Refine notch mode: own island modules, Super+N, fuller pages, header strip
- Notch islands and a header strip in the open notch take their own module lists (Settings → Notch → Modules); the strip scrolls sideways on wheel. - `glassmxrph notch mode` swaps notch mode and the full bar. - The left column fills its space: large media player (streams show LIVE), a full-height Performance card and a clock over the calendar. - A cog edits the tiles in the Control Center editor, then the notch returns. - The launcher uses the notch shape and keeps its mode pills inside. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5217af4f67
commit
74b6ad50ec
14 files changed
+530
-99
No files matched your search
+168
-41
@@ -5,11 +5,11 @@ import Quickshell
|
||||
import Quickshell.Io
|
||||
import Quickshell.Wayland
|
||||
import "../components"
|
||||
import "../bar"
|
||||
import "../controlcenter"
|
||||
import "../controlcenter/GridLogic.js" as Grid
|
||||
import "../core"
|
||||
import "../dashboard"
|
||||
import "../media"
|
||||
import "../services"
|
||||
import "../theme"
|
||||
import "../widgets/faces" as Faces
|
||||
@@ -35,10 +35,13 @@ PanelWindow {
|
||||
readonly property int sideWidth: 330
|
||||
readonly property int middleWidth: 440
|
||||
readonly property int columnGap: 44
|
||||
// The open notch's header: the band plus room for the divider below it.
|
||||
readonly property real header: band + 8
|
||||
readonly property int gutter: 16
|
||||
|
||||
// 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(440, middle.contentHeight + band + 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
|
||||
@@ -147,6 +150,7 @@ PanelWindow {
|
||||
precision: SystemClock.Minutes
|
||||
}
|
||||
Row {
|
||||
id: clockRow
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
y: (root.band - height) / 2
|
||||
spacing: 8
|
||||
@@ -167,13 +171,84 @@ 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
|
||||
Flickable {
|
||||
id: strip
|
||||
objectName: "notchStrip"
|
||||
x: main.x
|
||||
width: Math.max(0, clockRow.x - 24 - main.x)
|
||||
height: root.band
|
||||
visible: body.headerShown
|
||||
opacity: root.contentOpacity
|
||||
contentWidth: stripRow.implicitWidth
|
||||
contentHeight: height
|
||||
flickableDirection: Flickable.HorizontalFlick
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
clip: true
|
||||
ModuleRow {
|
||||
id: stripRow
|
||||
position: "center"
|
||||
active: ShellState.notchOpen
|
||||
modules: BarLayout.notchModules(root.screen ? root.screen.name : "", "strip")
|
||||
barScreen: root.screen
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
}
|
||||
MouseArea {
|
||||
anchors.fill: strip
|
||||
visible: strip.visible
|
||||
acceptedButtons: Qt.NoButton
|
||||
onWheel: wheel => {
|
||||
const delta = wheel.angleDelta.y !== 0 ? wheel.angleDelta.y : wheel.angleDelta.x;
|
||||
strip.contentX = Math.max(0, Math.min(strip.contentWidth - strip.width, strip.contentX - delta * 0.6));
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
objectName: "notchEditControls"
|
||||
x: main.x + root.sideWidth + root.columnGap + root.middleWidth - width
|
||||
y: (root.band - height) / 2
|
||||
width: 30
|
||||
height: 30
|
||||
radius: 15
|
||||
visible: body.headerShown
|
||||
opacity: root.contentOpacity
|
||||
color: cogArea.containsMouse ? Theme.hover : Theme.transparent
|
||||
Accessible.role: Accessible.Button
|
||||
Accessible.name: "Edit controls"
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
text: Icons.available ? "" : "⚙"
|
||||
font.family: Icons.available ? Icons.family : ""
|
||||
font.pixelSize: 16
|
||||
color: Theme.textSecondary
|
||||
}
|
||||
MouseArea {
|
||||
id: cogArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: ShellState.editControlCenter()
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
x: main.x
|
||||
y: root.header
|
||||
width: main.width
|
||||
height: 1
|
||||
visible: body.headerShown
|
||||
opacity: root.contentOpacity
|
||||
color: Theme.hairline
|
||||
}
|
||||
|
||||
// Main view ----------------------------------------------------------
|
||||
Item {
|
||||
id: main
|
||||
x: (root.bodyWidth - root.mainWidth) / 2 + root.pad
|
||||
y: root.band
|
||||
y: root.header + root.gutter
|
||||
width: root.mainWidth - 2 * root.pad
|
||||
height: root.targetHeight - root.band - root.pad
|
||||
height: root.targetHeight - root.header - root.gutter - root.pad
|
||||
visible: opacity > 0
|
||||
opacity: root.computer ? 0 : root.contentOpacity
|
||||
Behavior on opacity {
|
||||
@@ -210,32 +285,28 @@ PanelWindow {
|
||||
}
|
||||
}
|
||||
// Media
|
||||
Item {
|
||||
width: pager.width
|
||||
NotchMedia {
|
||||
width: pager.width - 16
|
||||
height: pager.height
|
||||
MediaCard {
|
||||
anchors.centerIn: parent
|
||||
width: parent.width - 20
|
||||
compact: true
|
||||
color: Theme.transparent
|
||||
border.width: 0
|
||||
}
|
||||
active: ShellState.notchOpen && pager.page === 0
|
||||
}
|
||||
// Performance: click for the full view.
|
||||
Item {
|
||||
id: perf
|
||||
width: pager.width
|
||||
width: pager.width - 16
|
||||
height: pager.height
|
||||
readonly property var disk: (MetricsService.snapshot.storage || []).find(s => s.available) || ({})
|
||||
readonly property var gpu: MetricsService.gpu || ({})
|
||||
readonly property var rows: [["CPU", [MetricsService.value(MetricsService.cpu.temperature, " °C"), MetricsService.value(MetricsService.cpu.frequency / 1000, " GHz", 2)].filter(v => v !== "—").join(" · ") || "—"], ["GPU", Number.isFinite(gpu.percent) ? Math.round(gpu.percent) + "%" + (Number.isFinite(gpu.temperature) ? " · " + Math.round(gpu.temperature) + " °C" : "") : "—"], ["Memory", MetricsService.bytes(MetricsService.ram.used) + " / " + MetricsService.bytes(MetricsService.ram.total)], ["Network", "↓ " + MetricsService.bytes(MetricsService.network.download) + "/s ↑ " + MetricsService.bytes(MetricsService.network.upload) + "/s"]]
|
||||
Demand {
|
||||
service: MetricsService
|
||||
active: ShellState.notchOpen && pager.page === 1
|
||||
}
|
||||
Rectangle {
|
||||
anchors.centerIn: parent
|
||||
width: parent.width - 20
|
||||
height: perfColumn.implicitHeight + 36
|
||||
radius: Math.max(12, Theme.radius * 0.75)
|
||||
anchors.fill: parent
|
||||
anchors.topMargin: 6
|
||||
anchors.bottomMargin: 6
|
||||
radius: Math.max(16, Theme.radius)
|
||||
color: perfArea.containsMouse ? Theme.hover : Theme.surfaceVariant
|
||||
border.width: 1
|
||||
border.color: Theme.hairline
|
||||
@@ -245,17 +316,16 @@ PanelWindow {
|
||||
}
|
||||
}
|
||||
Column {
|
||||
id: perfColumn
|
||||
anchors.centerIn: parent
|
||||
width: parent.width - 36
|
||||
spacing: 18
|
||||
width: parent.width - 40
|
||||
spacing: 22
|
||||
Item {
|
||||
width: parent.width
|
||||
height: 22
|
||||
height: 24
|
||||
Text {
|
||||
text: "Your computer"
|
||||
color: Theme.text
|
||||
font.pixelSize: 15
|
||||
font.pixelSize: 17
|
||||
font.weight: Font.DemiBold
|
||||
}
|
||||
Text {
|
||||
@@ -263,35 +333,61 @@ PanelWindow {
|
||||
text: Icons.available ? "" : "›"
|
||||
font.family: Icons.available ? Icons.family : ""
|
||||
color: Theme.textSecondary
|
||||
font.pixelSize: 18
|
||||
font.pixelSize: 20
|
||||
}
|
||||
}
|
||||
Row {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
spacing: 14
|
||||
spacing: 10
|
||||
Gauge {
|
||||
size: 76
|
||||
size: (perf.width - 40 - 20) / 3
|
||||
value: MetricsService.cpu.percent
|
||||
caption: "CPU"
|
||||
}
|
||||
Gauge {
|
||||
size: 76
|
||||
size: (perf.width - 40 - 20) / 3
|
||||
value: MetricsService.ram.percent
|
||||
caption: "Memory"
|
||||
}
|
||||
Gauge {
|
||||
size: 76
|
||||
size: (perf.width - 40 - 20) / 3
|
||||
value: perf.disk.percent
|
||||
caption: "Disk"
|
||||
}
|
||||
}
|
||||
Text {
|
||||
Column {
|
||||
width: parent.width
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
readonly property var gpu: MetricsService.gpu || ({})
|
||||
text: Number.isFinite(gpu.percent) ? "GPU " + Math.round(gpu.percent) + "%" + (Number.isFinite(gpu.temperature) ? " · " + Math.round(gpu.temperature) + " °C" : "") : "Click for details"
|
||||
color: Theme.textSecondary
|
||||
font.pixelSize: 12
|
||||
Repeater {
|
||||
model: perf.rows
|
||||
Item {
|
||||
required property var modelData
|
||||
required property int index
|
||||
width: parent.width
|
||||
height: 38
|
||||
Rectangle {
|
||||
visible: parent.index > 0
|
||||
width: parent.width
|
||||
height: 1
|
||||
color: Theme.hairline
|
||||
}
|
||||
Text {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: parent.modelData[0]
|
||||
color: Theme.textSecondary
|
||||
font.pixelSize: 13
|
||||
}
|
||||
Text {
|
||||
anchors.right: parent.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: parent.modelData[1]
|
||||
color: Theme.text
|
||||
font.pixelSize: 13
|
||||
font.features: {
|
||||
"tnum": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
MouseArea {
|
||||
@@ -306,12 +402,35 @@ PanelWindow {
|
||||
}
|
||||
// Calendar
|
||||
Item {
|
||||
width: pager.width
|
||||
width: pager.width - 16
|
||||
height: pager.height
|
||||
Column {
|
||||
id: dateHead
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
y: 6
|
||||
Text {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
text: Qt.formatDateTime(clock.date, ConfigService.ready && !ConfigService.data.bar.clock.use24Hour ? "h:mm" : "HH:mm")
|
||||
color: Theme.text
|
||||
font.pixelSize: 54
|
||||
font.weight: Font.Light
|
||||
font.features: {
|
||||
"tnum": 1
|
||||
}
|
||||
}
|
||||
Text {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
text: Qt.formatDateTime(clock.date, "dddd, d MMMM")
|
||||
color: Theme.textSecondary
|
||||
font.pixelSize: 14
|
||||
}
|
||||
}
|
||||
Faces.CalendarFace {
|
||||
anchors.centerIn: parent
|
||||
width: parent.width - 20
|
||||
height: Math.min(parent.height, 300)
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.top: dateHead.bottom
|
||||
anchors.topMargin: 14
|
||||
anchors.bottom: parent.bottom
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -358,8 +477,9 @@ PanelWindow {
|
||||
}
|
||||
Rectangle {
|
||||
x: root.sideWidth + root.columnGap / 2
|
||||
y: -root.gutter
|
||||
width: 1
|
||||
height: parent.height
|
||||
height: parent.height + root.gutter
|
||||
color: Theme.hairline
|
||||
}
|
||||
|
||||
@@ -485,8 +605,9 @@ PanelWindow {
|
||||
}
|
||||
Rectangle {
|
||||
x: root.sideWidth + root.columnGap + root.middleWidth + root.columnGap / 2
|
||||
y: -root.gutter
|
||||
width: 1
|
||||
height: parent.height
|
||||
height: parent.height + root.gutter
|
||||
color: Theme.hairline
|
||||
}
|
||||
|
||||
@@ -514,7 +635,7 @@ PanelWindow {
|
||||
x: root.pad
|
||||
y: root.band
|
||||
width: root.bodyWidth - 2 * root.pad
|
||||
height: root.bodyHeight - root.band - root.pad
|
||||
height: Math.max(0, root.bodyHeight - root.band - root.pad)
|
||||
visible: opacity > 0
|
||||
opacity: root.computer ? root.contentOpacity : 0
|
||||
Behavior on opacity {
|
||||
@@ -573,6 +694,12 @@ PanelWindow {
|
||||
function page(index: int): void {
|
||||
pager.go(index);
|
||||
}
|
||||
function editControls(): void {
|
||||
ShellState.editControlCenter();
|
||||
}
|
||||
function toggleMode(): bool {
|
||||
return ShellState.toggleNotchMode();
|
||||
}
|
||||
function view(name: string): void {
|
||||
ShellState.notchView = name === "computer" ? "computer" : "main";
|
||||
}
|
||||
|
||||
@@ -0,0 +1,177 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
import QtQuick
|
||||
import Quickshell.Widgets
|
||||
import "../components"
|
||||
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.
|
||||
Item {
|
||||
id: root
|
||||
property bool active: false
|
||||
// Streams report no length or absurd ones; show them as live.
|
||||
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))
|
||||
Demand {
|
||||
service: MediaService
|
||||
counter: "progressConsumers"
|
||||
active: root.active
|
||||
}
|
||||
Demand {
|
||||
service: CavaService
|
||||
counter: "widgetConsumers"
|
||||
active: root.active
|
||||
}
|
||||
Column {
|
||||
anchors.centerIn: parent
|
||||
width: parent.width - 24
|
||||
spacing: 14
|
||||
ClippingRectangle {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: root.artSize
|
||||
height: root.artSize
|
||||
radius: 24
|
||||
color: Theme.fill
|
||||
border.width: 1
|
||||
border.color: Theme.hairline
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
visible: art.status !== Image.Ready
|
||||
text: Icons.available ? "" : "♪"
|
||||
font.family: Icons.available ? Icons.family : ""
|
||||
font.pixelSize: root.artSize * 0.32
|
||||
color: Theme.textSecondary
|
||||
}
|
||||
Image {
|
||||
id: art
|
||||
anchors.fill: parent
|
||||
source: MediaService.artwork
|
||||
sourceSize: Qt.size(500, 500)
|
||||
fillMode: Image.PreserveAspectCrop
|
||||
asynchronous: true
|
||||
retainWhileLoading: true
|
||||
opacity: status === Image.Ready ? 1 : 0
|
||||
Behavior on opacity {
|
||||
NumberAnimation {
|
||||
duration: Theme.duration
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Column {
|
||||
width: parent.width
|
||||
spacing: 3
|
||||
Text {
|
||||
width: parent.width
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
text: MediaService.title
|
||||
color: Theme.text
|
||||
font.pixelSize: 18
|
||||
font.weight: Font.DemiBold
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
Text {
|
||||
width: parent.width
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
text: MediaService.artist
|
||||
color: Theme.textSecondary
|
||||
font.pixelSize: 13
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
}
|
||||
Column {
|
||||
visible: root.hasPlayer
|
||||
width: parent.width
|
||||
GlassSlider {
|
||||
objectName: "notchSeek"
|
||||
width: parent.width
|
||||
from: 0
|
||||
to: root.live ? 1 : Math.max(1, MediaService.length)
|
||||
value: root.live ? 0 : MediaService.position
|
||||
enabled: MediaService.seekable && !root.live
|
||||
opacity: root.live ? 0.4 : 1
|
||||
onMoved: MediaService.seek(value)
|
||||
}
|
||||
Item {
|
||||
width: parent.width
|
||||
height: 14
|
||||
Text {
|
||||
text: root.live ? "" : MediaService.time(MediaService.position)
|
||||
color: Theme.textSecondary
|
||||
font.pixelSize: 11
|
||||
font.features: {
|
||||
"tnum": 1
|
||||
}
|
||||
}
|
||||
Text {
|
||||
anchors.right: parent.right
|
||||
text: root.live ? "LIVE" : MediaService.time(MediaService.length)
|
||||
color: Theme.textSecondary
|
||||
font.pixelSize: 11
|
||||
font.features: {
|
||||
"tnum": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Row {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
spacing: 22
|
||||
DashButton {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
objectName: "notchPrevious"
|
||||
size: 44
|
||||
glyph: ""
|
||||
fallback: "⏮"
|
||||
interactive: root.hasPlayer && MediaService.player.canControl && MediaService.player.canGoPrevious
|
||||
onClicked: MediaService.previous()
|
||||
Accessible.name: "Previous track"
|
||||
}
|
||||
DashButton {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
objectName: "notchToggle"
|
||||
size: 60
|
||||
accented: true
|
||||
glyph: MediaService.playing ? "" : ""
|
||||
fallback: MediaService.playing ? "⏸" : "▶"
|
||||
interactive: root.hasPlayer && MediaService.player.canControl && MediaService.player.canTogglePlaying
|
||||
onClicked: MediaService.toggle()
|
||||
Accessible.name: MediaService.playing ? "Pause" : "Play"
|
||||
}
|
||||
DashButton {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
objectName: "notchNext"
|
||||
size: 44
|
||||
glyph: ""
|
||||
fallback: "⏭"
|
||||
interactive: root.hasPlayer && MediaService.player.canControl && MediaService.player.canGoNext
|
||||
onClicked: MediaService.next()
|
||||
Accessible.name: "Next track"
|
||||
}
|
||||
}
|
||||
// Fixed-height wrapper keeps Cava frames from re-laying out the column.
|
||||
Item {
|
||||
width: parent.width
|
||||
height: 30
|
||||
Row {
|
||||
anchors.fill: parent
|
||||
spacing: 3
|
||||
opacity: MediaService.playing ? 1 : 0.25
|
||||
Repeater {
|
||||
model: 24
|
||||
Rectangle {
|
||||
required property int index
|
||||
anchors.bottom: parent.bottom
|
||||
width: (root.width - 24 - 23 * 3) / 24
|
||||
radius: 2
|
||||
height: Math.max(3, 30 * (MediaService.playing ? (CavaService.bars[index] || 0) : 0.05))
|
||||
color: Qt.alpha(Theme.accentVivid, 0.85)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user