Compare commits
8
Commits
178041edf9
...
ea8fc29544
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ea8fc29544 | ||
|
|
cc0bc0a72f | ||
|
|
de0295e18e | ||
|
|
efaace0f15 | ||
|
|
e4ca1f5d9c | ||
|
|
73de4b06a8 | ||
|
|
74b6ad50ec | ||
|
|
5217af4f67 |
No files matched your search
+55
-4
@@ -3,6 +3,7 @@ import QtQuick.Shapes
|
||||
import Quickshell
|
||||
import Quickshell.Wayland
|
||||
import "../components"
|
||||
import "../notch"
|
||||
import "../core"
|
||||
import "../services"
|
||||
import "../theme"
|
||||
@@ -18,7 +19,14 @@ PanelWindow {
|
||||
// The window reaches below the bar (input is masked to the bar) so the
|
||||
// HyprGlass layer edge is not on the bar's bottom edge, where drawers join.
|
||||
implicitHeight: BarDrawers.bottom + BarDrawers.overhang
|
||||
mask: Region { item: panel }
|
||||
// Notch mode splits the bar into a left island, the centre notch and a
|
||||
// right island; only those take input.
|
||||
readonly property bool notch: ShellState.notchMode
|
||||
mask: Region {
|
||||
item: root.notch ? leftIsland : panel
|
||||
Region { item: root.notch ? notchPill : null; intersection: Intersection.Combine }
|
||||
Region { item: root.notch ? rightIsland : null; intersection: Intersection.Combine }
|
||||
}
|
||||
color: Theme.transparent
|
||||
// Reserve the bar itself (margin + height), not the overhang below it, so
|
||||
// windows tile beneath the bar instead of under it.
|
||||
@@ -29,18 +37,22 @@ PanelWindow {
|
||||
Component.onDestruction: TrayService.unregisterBar(root)
|
||||
GlassPanel {
|
||||
id: panel
|
||||
visible: !root.notch
|
||||
x: root.outerMargin; y: root.outerMargin
|
||||
width: root.width - 2 * root.outerMargin
|
||||
height: BarDrawers.height
|
||||
radius: BarDrawers.radius
|
||||
border.width: 0
|
||||
ModuleRow { position: "left"; barScreen: root.screen; anchors.left: parent.left; anchors.leftMargin: 6; anchors.verticalCenter: parent.verticalCenter }
|
||||
ModuleRow { position: "center"; barScreen: root.screen; anchors.centerIn: parent }
|
||||
ModuleRow { position: "right"; barScreen: root.screen; anchors.right: parent.right; anchors.rightMargin: 6; anchors.verticalCenter: parent.verticalCenter }
|
||||
// In notch mode the side rows move into their islands; the notch replaces the centre.
|
||||
// Notch mode unloads these; its islands carry their own module lists.
|
||||
ModuleRow { position: "left"; active: !root.notch; barScreen: root.screen; anchors.left: parent.left; anchors.leftMargin: 6; anchors.verticalCenter: parent.verticalCenter }
|
||||
ModuleRow { position: "center"; active: !root.notch; barScreen: root.screen; anchors.centerIn: parent }
|
||||
ModuleRow { position: "right"; active: !root.notch; barScreen: root.screen; anchors.right: parent.right; anchors.rightMargin: 6; anchors.verticalCenter: parent.verticalCenter }
|
||||
}
|
||||
// Outline with openings where drawers hang from the bar.
|
||||
Shape {
|
||||
id: outline
|
||||
visible: !root.notch
|
||||
x: panel.x
|
||||
y: panel.y
|
||||
width: panel.width
|
||||
@@ -63,4 +75,43 @@ PanelWindow {
|
||||
}
|
||||
}
|
||||
}
|
||||
// Notch mode -------------------------------------------------------------
|
||||
GlassPanel {
|
||||
id: leftIsland
|
||||
// No bar behind the modules in notch mode: they float on their own.
|
||||
color: Theme.transparent
|
||||
border.width: 0
|
||||
plain: true
|
||||
visible: root.notch && ConfigService.ready && ConfigService.data.notch.left.length > 0
|
||||
x: root.outerMargin
|
||||
y: root.outerMargin
|
||||
width: leftRow.implicitWidth + 12
|
||||
height: BarDrawers.height
|
||||
radius: BarDrawers.radius
|
||||
ModuleRow { id: leftRow; position: "left"; active: root.notch; modules: BarLayout.notchModules(root.screen ? root.screen.name : "", "left"); barScreen: root.screen; anchors.left: parent.left; anchors.leftMargin: 6; anchors.verticalCenter: parent.verticalCenter }
|
||||
}
|
||||
GlassPanel {
|
||||
id: rightIsland
|
||||
// No bar behind the modules in notch mode: they float on their own.
|
||||
color: Theme.transparent
|
||||
border.width: 0
|
||||
plain: true
|
||||
visible: root.notch && ConfigService.ready && ConfigService.data.notch.right.length > 0
|
||||
x: root.width - root.outerMargin - width
|
||||
y: root.outerMargin
|
||||
width: rightRow.implicitWidth + 12
|
||||
height: BarDrawers.height
|
||||
radius: BarDrawers.radius
|
||||
ModuleRow { id: rightRow; position: "right"; active: root.notch; modules: BarLayout.notchModules(root.screen ? root.screen.name : "", "right"); barScreen: root.screen; anchors.right: parent.right; anchors.rightMargin: 6; anchors.verticalCenter: parent.verticalCenter }
|
||||
}
|
||||
NotchPill {
|
||||
id: notchPill
|
||||
barScreen: root.screen
|
||||
x: Math.round((root.width - width) / 2)
|
||||
y: 0
|
||||
width: implicitWidth
|
||||
height: implicitHeight
|
||||
// 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)
|
||||
}
|
||||
}
|
||||
@@ -21,7 +21,10 @@ PanelWindow {
|
||||
// so the drawer stays put while the pointer moves between its entries.
|
||||
readonly property var anchorObject: anchorItem
|
||||
readonly property Item placementItem: anchorObject ? (anchorObject.placement || anchorObject) : null
|
||||
readonly property point anchorPoint: placementItem && anchorWindow ? placementItem.mapToItem(anchorWindow.contentItem, 0, 0) : Qt.point(0, 0)
|
||||
// Window-relative, plus the window's screen offset for centred layers (the notch).
|
||||
readonly property real windowOffsetX: anchorWindow && anchorWindow.screenOffsetX !== undefined ? anchorWindow.screenOffsetX : 0
|
||||
readonly property point windowPoint: placementItem && anchorWindow ? placementItem.mapToItem(anchorWindow.contentItem, 0, 0) : Qt.point(0, 0)
|
||||
readonly property point anchorPoint: Qt.point(windowPoint.x + windowOffsetX, windowPoint.y)
|
||||
readonly property real availableWidth: screen ? screen.width : 1280
|
||||
readonly property real targetWidth: Math.ceil(root.kind === "window" ? windowCard.implicitWidth : tip.implicitWidth)
|
||||
readonly property real targetHeight: Math.ceil(root.kind === "window" ? windowCard.implicitHeight : tip.implicitHeight)
|
||||
|
||||
@@ -5,9 +5,12 @@ Row {
|
||||
id: root
|
||||
required property string position
|
||||
property var barScreen
|
||||
// Notch mode passes its own module entries; inactive rows load nothing.
|
||||
property var modules: null
|
||||
property bool active: true
|
||||
spacing: 8
|
||||
Repeater {
|
||||
model: BarLayout.modulesFor(root.barScreen ? root.barScreen.name : "").filter(m => m.enabled && m.position === root.position)
|
||||
model: !root.active ? [] : root.modules !== null ? root.modules : BarLayout.modulesFor(root.barScreen ? root.barScreen.name : "").filter(m => m.enabled && m.position === root.position)
|
||||
ModuleLoader { required property var modelData; moduleId: modelData.id; barScreen: root.barScreen; entry: modelData }
|
||||
}
|
||||
}
|
||||
@@ -6,21 +6,25 @@ import "../../theme"
|
||||
import "../../services"
|
||||
import "../../core"
|
||||
|
||||
// Workspace switcher. Styles (bar.workspaces.style): numbers, roman numerals,
|
||||
// Workspace switcher. Styles (bar.workspaces.style): numbers, roman numerals, kanji,
|
||||
// dots (filled = occupied, ring = empty) and pacman (after Serpantinum: pellets
|
||||
// for empty workspaces, ghosts for occupied ones, Pac-Man on the active one).
|
||||
GlassPill {
|
||||
id: root
|
||||
property var barScreen
|
||||
// Layout entry; notch islands mark theirs so the notch can use its own style.
|
||||
property var entry: ({})
|
||||
// Every bar follows the globally focused workspace, whichever monitor it is on.
|
||||
readonly property int activeId: Hyprland.focusedWorkspace ? Hyprland.focusedWorkspace.id : 0
|
||||
// Workspaces shown on other monitors get a faint outline.
|
||||
readonly property var visibleIds: Hyprland.monitors.values.map(m => m.activeWorkspace ? m.activeWorkspace.id : 0).filter(id => id > 0 && id !== activeId)
|
||||
readonly property int count: ConfigService.data.bar.workspaces.count
|
||||
readonly property string style: ConfigService.data.bar.workspaces.style || "numbers"
|
||||
readonly property string notchStyle: entry && entry.notch && ConfigService.data.notch ? ConfigService.data.notch.workspaceStyle : "bar"
|
||||
readonly property string style: notchStyle && notchStyle !== "bar" ? notchStyle : ConfigService.data.bar.workspaces.style || "numbers"
|
||||
readonly property bool textual: style === "numbers" || style === "roman" || style === "kanji"
|
||||
readonly property bool pacman: style === "pacman"
|
||||
readonly property real pacmanScale: 0.95
|
||||
readonly property int slotWidth: style === "roman" ? 38 : style === "dots" ? 22 : style === "pacman" ? 24 : 32
|
||||
readonly property int slotWidth: style === "roman" ? 38 : style === "kanji" ? (count > 10 ? 40 : 30) : style === "dots" ? 22 : style === "pacman" ? 24 : 32
|
||||
readonly property int slotHeight: height - 6
|
||||
readonly property int activeIndex: activeId >= 1 && activeId <= count ? activeId - 1 : -1
|
||||
width: count * slotWidth + 8
|
||||
@@ -36,6 +40,13 @@ GlassPill {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
// Japanese numerals: 一 … 十, then 十一 … 二十.
|
||||
function kanji(value) {
|
||||
const digits = ["", "一", "二", "三", "四", "五", "六", "七", "八", "九"];
|
||||
if (value < 10)
|
||||
return digits[value];
|
||||
return (value >= 20 ? digits[Math.floor(value / 10)] : "") + "十" + digits[value % 10];
|
||||
}
|
||||
|
||||
Repeater {
|
||||
model: root.pacman ? [] : root.visibleIds.filter(id => id <= root.count)
|
||||
@@ -84,20 +95,20 @@ GlassPill {
|
||||
width: root.slotWidth
|
||||
height: root.slotHeight
|
||||
|
||||
// Numbers and roman numerals
|
||||
// Numbers, roman numerals and kanji
|
||||
Text {
|
||||
visible: root.style === "numbers" || root.style === "roman"
|
||||
visible: root.textual
|
||||
anchors.centerIn: parent
|
||||
anchors.verticalCenterOffset: slot.occupied && !slot.active ? -2 : 0
|
||||
text: root.style === "roman" ? root.roman(slot.index + 1) : slot.index + 1
|
||||
font.pixelSize: root.style === "roman" ? 11 : 12
|
||||
text: root.style === "roman" ? root.roman(slot.index + 1) : root.style === "kanji" ? root.kanji(slot.index + 1) : slot.index + 1
|
||||
font.pixelSize: root.style === "roman" ? 11 : root.style === "kanji" ? 13 : 12
|
||||
font.weight: root.style === "roman" ? Font.DemiBold : Font.Normal
|
||||
font.letterSpacing: root.style === "roman" ? 0.5 : 0
|
||||
color: slot.urgent ? Theme.urgent : slot.active ? Theme.accentText : Theme.text
|
||||
opacity: slot.active || slot.occupied ? 1 : 0.5
|
||||
}
|
||||
Rectangle {
|
||||
visible: (root.style === "numbers" || root.style === "roman") && slot.occupied && !slot.active
|
||||
visible: root.textual && slot.occupied && !slot.active
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin: 1
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
@@ -83,7 +83,10 @@ PanelWindow {
|
||||
readonly property point anchorScreenPos: {
|
||||
root.open
|
||||
if (!anchorItem || !anchorWindow) return Qt.point(0, 0)
|
||||
return anchorItem.mapToItem(anchorWindow.contentItem, 0, 0)
|
||||
const p = anchorItem.mapToItem(anchorWindow.contentItem, 0, 0)
|
||||
// Centred layers (the open notch) report their screen offset.
|
||||
const offset = anchorWindow.screenOffsetX !== undefined ? anchorWindow.screenOffsetX : 0
|
||||
return Qt.point(p.x + offset, p.y)
|
||||
}
|
||||
readonly property real anchorW: anchorItem ? anchorItem.width : 0
|
||||
readonly property real anchorH: anchorItem ? anchorItem.height : 0
|
||||
|
||||
@@ -21,6 +21,10 @@ Item {
|
||||
// "slide" unrolls out of the bar; "drop" falls into place and away
|
||||
// downwards; "fade" fades in place; "shrink" grows from / shrinks to nothing.
|
||||
property string style: "slide"
|
||||
// Fill and timing; notch mode passes the notch's own.
|
||||
property color fillColor: Qt.alpha(Theme.surface, Theme.glassOpacity)
|
||||
property real openDuration: Theme.duration * 1.8
|
||||
property real closeDuration: Theme.duration
|
||||
readonly property bool unrolls: style === "slide"
|
||||
property real progress: open ? 1 : 0
|
||||
readonly property real revealed: unrolls ? Math.max(0, contentHeight * progress) : contentHeight
|
||||
@@ -39,7 +43,7 @@ Item {
|
||||
Behavior on progress {
|
||||
NumberAnimation {
|
||||
id: anim
|
||||
duration: root.open ? Theme.duration * 1.8 : Theme.duration
|
||||
duration: root.open ? root.openDuration : root.closeDuration
|
||||
easing.type: Easing.BezierSpline
|
||||
easing.bezierCurve: root.open ? [0.05, 0.7, 0.1, 1, 1, 1] : [0.3, 0, 0.8, 0.15, 1, 1]
|
||||
}
|
||||
@@ -77,6 +81,7 @@ Item {
|
||||
bodyHeight: root.revealed
|
||||
ear: BarDrawers.ear
|
||||
attached: root.attached
|
||||
fillColor: root.fillColor
|
||||
}
|
||||
Item {
|
||||
id: hit
|
||||
|
||||
@@ -4,6 +4,8 @@ import "../theme"
|
||||
Rectangle {
|
||||
id: root
|
||||
property real surfaceOpacity: Theme.glassOpacity
|
||||
// Drops the shadow and highlights, for panels drawn on another shape.
|
||||
property bool plain: false
|
||||
radius: Theme.radius
|
||||
color: Qt.alpha(Theme.surface, surfaceOpacity)
|
||||
border.width: 1
|
||||
@@ -15,12 +17,12 @@ Rectangle {
|
||||
anchors.bottomMargin: -4
|
||||
radius: root.radius
|
||||
color: Theme.shadow
|
||||
visible: Theme.shadows
|
||||
visible: Theme.shadows && !root.plain
|
||||
}
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
radius: root.radius
|
||||
visible: Theme.highlights
|
||||
visible: Theme.highlights && !root.plain
|
||||
gradient: Gradient {
|
||||
GradientStop {
|
||||
position: 0
|
||||
@@ -43,6 +45,6 @@ Rectangle {
|
||||
width: Math.max(0, parent.width - root.radius * 2)
|
||||
height: 1
|
||||
color: Theme.border
|
||||
visible: Theme.highlights
|
||||
visible: Theme.highlights && !root.plain
|
||||
}
|
||||
}
|
||||
@@ -262,6 +262,21 @@
|
||||
},
|
||||
"effectEnabled": true
|
||||
},
|
||||
"notch": {
|
||||
"enabled": false,
|
||||
"mediaFirst": true,
|
||||
"left": ["workspaces"],
|
||||
"right": ["tray"],
|
||||
"strip": [],
|
||||
"controls": [],
|
||||
"opacity": 0,
|
||||
"color": "",
|
||||
"glassOnOpen": false,
|
||||
"openSpeed": 100,
|
||||
"closeSpeed": 100,
|
||||
"colorSpeed": 100,
|
||||
"workspaceStyle": "bar"
|
||||
},
|
||||
"dashboard": {
|
||||
"enabled": true,
|
||||
"position": "top-center",
|
||||
|
||||
@@ -23,6 +23,16 @@ Singleton {
|
||||
}
|
||||
return Object.prototype.hasOwnProperty.call(modules, id) ? modules[id] : null;
|
||||
}
|
||||
// The notch's own tile layout. Until it is edited it starts as a copy of
|
||||
// the Control Center's, without Now Playing (the notch shows media itself).
|
||||
readonly property var notchModules: {
|
||||
if (!ConfigService.ready)
|
||||
return [];
|
||||
const own = ConfigService.data.notch.controls;
|
||||
return own.length ? own : ConfigService.data.controlCenter.modules.map(m => m.id === "media" ? Object.assign({}, m, {
|
||||
enabled: false
|
||||
}) : m);
|
||||
}
|
||||
// Configured size, else the module's default.
|
||||
function size(module) {
|
||||
if (!module)
|
||||
|
||||
@@ -16,6 +16,21 @@ Singleton {
|
||||
return [];
|
||||
return hasOwn(screenName) ? screens[screenName].modules : ConfigService.data.bar.modules;
|
||||
}
|
||||
// Entries for a notch module list ("left", "right" or "strip"). Each reuses
|
||||
// the module's bar entry for its options when the layout has one.
|
||||
function notchModules(screenName, key) {
|
||||
if (!ConfigService.ready || !ConfigService.data.notch)
|
||||
return [];
|
||||
const layout = modulesFor(screenName);
|
||||
return (ConfigService.data.notch[key] || []).map(id => Object.assign({}, layout.find(m => m.id === id) || {
|
||||
id: id
|
||||
}, {
|
||||
id: id,
|
||||
enabled: true,
|
||||
notch: true,
|
||||
position: key === "right" ? "right" : key === "left" ? "left" : "center"
|
||||
}));
|
||||
}
|
||||
// Saves to the screen's own layout when it has one, else the shared layout.
|
||||
function save(screenName, modules) {
|
||||
if (!hasOwn(screenName))
|
||||
|
||||
@@ -68,7 +68,18 @@ Singleton {
|
||||
available: true,
|
||||
group: "shell",
|
||||
icon: "",
|
||||
keywords: ["Bar height", "Margin", "Modules", "Show date", "24-hour time", "Show seconds", "Workspace count", "Workspace style", "Pacman", "Roman numerals", "Clock"]
|
||||
keywords: ["Bar height", "Margin", "Modules", "Show date", "24-hour time", "Show seconds", "Workspace count", "Workspace style", "Pacman", "Roman numerals", "Kanji", "Clock"]
|
||||
},
|
||||
{
|
||||
id: "notch",
|
||||
title: "Notch",
|
||||
command: "notch",
|
||||
description: "Notch mode: side islands and a pocket-dots style notch instead of the bar",
|
||||
phase: 9,
|
||||
available: true,
|
||||
group: "shell",
|
||||
icon: "",
|
||||
keywords: ["Notch", "Notch mode", "Notch opacity", "Notch colour", "Workspace style", "Glassy when open", "Opening speed", "Closing speed", "Colour change speed", "Open on Media while audio plays", "Pocket-dots", "Left island", "Right island", "Notch strip"]
|
||||
},
|
||||
{
|
||||
id: "tray",
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
pragma Singleton
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import "../services"
|
||||
|
||||
Singleton {
|
||||
property bool wallpaperPickerOpen: false
|
||||
property var wallpaperScreen: null
|
||||
property var wallpaperWindow: null
|
||||
function openWallpaperPicker() {
|
||||
settingsOpen=false;launcherOpen=false;controlCenterOpen=false;dashboardOpen=false;overviewOpen=false;
|
||||
settingsOpen=false;launcherOpen=false;controlCenterOpen=false;dashboardOpen=false;overviewOpen=false;notchOpen=false;
|
||||
wallpaperScreen=activeScreen();wallpaperPickerOpen=true;
|
||||
}
|
||||
property var systemPills: []
|
||||
@@ -15,6 +16,8 @@ Singleton {
|
||||
property var controlCenterScreen: null
|
||||
property var controlCenterWindow: null
|
||||
function openControlCenter() {
|
||||
if (notchMode)
|
||||
return openNotch();
|
||||
wallpaperPickerOpen=false;
|
||||
overviewOpen = false;
|
||||
dashboardOpen = false;
|
||||
@@ -26,6 +29,8 @@ Singleton {
|
||||
controlCenterOpen = true;
|
||||
}
|
||||
function toggleControlCenter() {
|
||||
if (notchMode)
|
||||
return toggleNotch();
|
||||
if (controlCenterOpen)
|
||||
controlCenterOpen = false;
|
||||
else
|
||||
@@ -37,6 +42,8 @@ Singleton {
|
||||
property var dashboardWindow: null
|
||||
property string dashboardTab: ""
|
||||
function openDashboard(tab) {
|
||||
if (notchMode)
|
||||
return openNotch();
|
||||
wallpaperPickerOpen = false;
|
||||
overviewOpen = false;
|
||||
controlCenterOpen = false;
|
||||
@@ -49,17 +56,58 @@ Singleton {
|
||||
dashboardOpen = true;
|
||||
}
|
||||
function toggleDashboard(tab) {
|
||||
if (notchMode)
|
||||
return toggleNotch();
|
||||
if (dashboardOpen && (!tab || tab === dashboardTab))
|
||||
dashboardOpen = false;
|
||||
else
|
||||
openDashboard(tab);
|
||||
}
|
||||
// Notch mode (pocket-dots style): the bar splits into side islands and a
|
||||
// centre notch; the Control Center and Dashboard keys open the notch instead.
|
||||
readonly property bool notchMode: ConfigService.ready && !!ConfigService.data.notch && ConfigService.data.notch.enabled
|
||||
property bool notchOpen: false
|
||||
// Collapsed notch body width (ears excluded): clock alone, or art + clock + cava.
|
||||
readonly property real notchPillWidth: MediaService.playing ? 236 : 128
|
||||
property var notchScreen: null
|
||||
property var notchWindow: null
|
||||
// "main" is the three-column panel; "computer" is the full Performance view.
|
||||
property string notchView: "main"
|
||||
function openNotch() {
|
||||
wallpaperPickerOpen = false;
|
||||
overviewOpen = false;
|
||||
controlCenterOpen = false;
|
||||
dashboardOpen = false;
|
||||
launcherOpen = false;
|
||||
settingsOpen = false;
|
||||
if (!notchOpen) {
|
||||
notchScreen = activeScreen();
|
||||
notchView = "main";
|
||||
}
|
||||
notchOpen = true;
|
||||
}
|
||||
function toggleNotch() {
|
||||
if (notchOpen)
|
||||
notchOpen = false;
|
||||
else
|
||||
openNotch();
|
||||
}
|
||||
onNotchModeChanged: if (!notchMode)
|
||||
notchOpen = false
|
||||
// Super+N: swaps between notch mode and the full bar.
|
||||
function toggleNotchMode() {
|
||||
if (!ConfigService.ready)
|
||||
return false;
|
||||
notchOpen = false;
|
||||
return ConfigService.setValue("notch.enabled", !notchMode);
|
||||
}
|
||||
// Workspace overview (SUPER+Tab): a drawer of live workspace thumbnails.
|
||||
property bool overviewOpen: false
|
||||
property var overviewScreen: null
|
||||
property var overviewWindow: null
|
||||
function openOverview() {
|
||||
wallpaperPickerOpen = false;
|
||||
notchOpen = false;
|
||||
controlCenterOpen = false;
|
||||
dashboardOpen = false;
|
||||
launcherOpen = false;
|
||||
@@ -85,6 +133,7 @@ Singleton {
|
||||
}
|
||||
function openLauncher(mode) {
|
||||
wallpaperPickerOpen=false;
|
||||
notchOpen = false;
|
||||
overviewOpen = false;
|
||||
dashboardOpen = false;
|
||||
launcherMode = mode === "clipboard" || mode === "emoji" ? mode : "apps";
|
||||
@@ -130,6 +179,7 @@ Singleton {
|
||||
}
|
||||
function openSettings(page) {
|
||||
wallpaperPickerOpen=false;
|
||||
notchOpen = false;
|
||||
overviewOpen = false;
|
||||
dashboardOpen = false;
|
||||
controlCenterOpen = false;
|
||||
|
||||
@@ -23,6 +23,7 @@ Singleton {
|
||||
return;
|
||||
TrayService.close();
|
||||
ShellState.controlCenterOpen = false;
|
||||
ShellState.notchOpen = false;
|
||||
ShellState.launcherOpen = false;
|
||||
ShellState.settingsOpen = false;
|
||||
appId = id;
|
||||
|
||||
@@ -72,11 +72,16 @@ PanelWindow {
|
||||
// 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)
|
||||
readonly property real targetWidth: Math.min(options.width, root.width - 40 - (notch ? 0 : 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))
|
||||
// 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.
|
||||
readonly property bool notch: ShellState.notchMode
|
||||
// Pills sit inside the search bar in notch mode, smaller.
|
||||
readonly property int notchPill: 36
|
||||
readonly property real maxBodyHeight: Math.min(460, root.height * 0.78 - barHeight - (notch ? 0 : root.height * 0.22))
|
||||
// Clipboard mode shows the latest five rows; the rest scroll.
|
||||
readonly property real clipboardRows: 5 * 48 - 2
|
||||
// Emoji mode shows six rows of the grid; the rest scroll.
|
||||
@@ -192,9 +197,10 @@ PanelWindow {
|
||||
Row {
|
||||
id: pills
|
||||
objectName: "launcherPills"
|
||||
x: panel.x + panel.width + 10
|
||||
y: panel.y + (root.barHeight - root.pillSize) / 2
|
||||
spacing: 10
|
||||
x: root.notch ? panel.x + panel.width - width - 14 : panel.x + panel.width + 10
|
||||
y: panel.y + (root.barHeight - (root.notch ? root.notchPill : root.pillSize)) / 2
|
||||
z: 1
|
||||
spacing: root.notch ? 6 : 10
|
||||
opacity: panel.opacity
|
||||
scale: panel.scale
|
||||
Repeater {
|
||||
@@ -217,10 +223,12 @@ PanelWindow {
|
||||
required property var modelData
|
||||
readonly property bool active: ShellState.launcherMode === modelData.mode
|
||||
objectName: "launcherPill-" + modelData.mode
|
||||
width: root.pillSize
|
||||
height: root.pillSize
|
||||
width: root.notch ? root.notchPill : root.pillSize
|
||||
height: width
|
||||
radius: width / 2
|
||||
color: active ? Theme.accent : Qt.alpha(Theme.surface, Math.min(1, surfaceOpacity + (pillArea.containsMouse ? 0.18 : 0)))
|
||||
color: active ? Theme.accent : root.notch ? (pillArea.containsMouse ? Theme.hover : Theme.fill) : Qt.alpha(Theme.surface, Math.min(1, surfaceOpacity + (pillArea.containsMouse ? 0.18 : 0)))
|
||||
border.color: root.notch ? Theme.hairline : Theme.border
|
||||
plain: root.notch
|
||||
Accessible.role: Accessible.Button
|
||||
Accessible.name: modelData.label
|
||||
scale: pillArea.pressed ? 0.92 : 1
|
||||
@@ -234,7 +242,7 @@ PanelWindow {
|
||||
anchors.centerIn: parent
|
||||
text: Icons.available ? pill.modelData.glyph : pill.modelData.fallback
|
||||
font.family: Icons.available ? Icons.family : ""
|
||||
font.pixelSize: 21
|
||||
font.pixelSize: root.notch ? 17 : 21
|
||||
color: pill.active ? Theme.accentText : Theme.text
|
||||
}
|
||||
MouseArea {
|
||||
@@ -256,38 +264,61 @@ PanelWindow {
|
||||
}
|
||||
}
|
||||
}
|
||||
// Notch mode: the notch's own shape (ears at the top edge) behind the
|
||||
// panel, which then draws no glass of its own.
|
||||
DrawerShape {
|
||||
visible: root.notch
|
||||
x: panel.x - BarDrawers.ear
|
||||
y: 0
|
||||
opacity: panel.opacity
|
||||
bodyWidth: panel.width
|
||||
bodyHeight: panel.height
|
||||
ear: BarDrawers.ear
|
||||
radius: panel.radius
|
||||
// Docked colour, turning to the open fill as the launcher unfolds.
|
||||
fillColor: ShellState.launcherOpen ? Theme.notchOpenFill : Theme.notchFill
|
||||
Behavior on fillColor {
|
||||
ColorAnimation {
|
||||
duration: ShellState.launcherOpen ? Theme.notchColorDuration : Math.min(Theme.notchColorDuration, Theme.notchCloseDuration)
|
||||
}
|
||||
}
|
||||
}
|
||||
GlassPanel {
|
||||
id: panel
|
||||
objectName: "launcherSurface"
|
||||
x: Math.round((root.width - width) / 2)
|
||||
y: Math.round(root.height * 0.22)
|
||||
width: ShellState.launcherOpen ? root.targetWidth : Math.min(320, root.targetWidth)
|
||||
height: root.barHeight + root.bodyHeight
|
||||
y: root.notch ? 0 : Math.round(root.height * 0.22)
|
||||
// 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)
|
||||
height: root.notch && !ShellState.launcherOpen ? BarDrawers.bottom : root.barHeight + root.bodyHeight
|
||||
color: root.notch ? Theme.transparent : Qt.alpha(Theme.surface, surfaceOpacity)
|
||||
border.width: root.notch ? 0 : 1
|
||||
plain: root.notch
|
||||
radius: Math.min(Theme.radius + 6, root.barHeight / 2)
|
||||
opacity: ShellState.launcherOpen ? 1 : 0
|
||||
scale: ShellState.launcherOpen ? 1 : 1 - 0.04 * Theme.intensity
|
||||
scale: ShellState.launcherOpen || root.notch ? 1 : 1 - 0.04 * Theme.intensity
|
||||
clip: true
|
||||
Behavior on width {
|
||||
NumberAnimation {
|
||||
duration: Theme.duration
|
||||
duration: !root.notch ? Theme.duration : ShellState.launcherOpen ? Theme.notchOpenDuration : Theme.notchCloseDuration
|
||||
easing.type: Easing.OutCubic
|
||||
}
|
||||
}
|
||||
Behavior on height {
|
||||
enabled: !root.snapping
|
||||
NumberAnimation {
|
||||
duration: Theme.duration
|
||||
duration: !root.notch ? Theme.duration : ShellState.launcherOpen ? Theme.notchOpenDuration : Theme.notchCloseDuration
|
||||
easing.type: Easing.OutCubic
|
||||
}
|
||||
}
|
||||
Behavior on opacity {
|
||||
NumberAnimation {
|
||||
duration: Theme.duration
|
||||
duration: !root.notch ? Theme.duration : ShellState.launcherOpen ? Theme.notchOpenDuration : Theme.notchCloseDuration
|
||||
}
|
||||
}
|
||||
Behavior on scale {
|
||||
NumberAnimation {
|
||||
duration: Theme.duration
|
||||
duration: !root.notch ? Theme.duration : ShellState.launcherOpen ? Theme.notchOpenDuration : Theme.notchCloseDuration
|
||||
easing.type: Easing.OutCubic
|
||||
}
|
||||
}
|
||||
@@ -303,7 +334,8 @@ PanelWindow {
|
||||
anchors.top: parent.top
|
||||
height: root.barHeight
|
||||
anchors.leftMargin: 12
|
||||
anchors.rightMargin: 18
|
||||
// Room for the mode pills inside the bar in notch mode.
|
||||
anchors.rightMargin: root.notch ? 18 + 2 * root.notchPill + 6 + 8 : 18
|
||||
spacing: 10
|
||||
Rectangle {
|
||||
objectName: "launcherBrowse"
|
||||
|
||||
@@ -74,6 +74,7 @@ Singleton {
|
||||
previewing = false;
|
||||
ShellState.settingsOpen = false;
|
||||
ShellState.controlCenterOpen = false;
|
||||
ShellState.notchOpen = false;
|
||||
ShellState.launcherOpen = false;
|
||||
primary = mainScreen();
|
||||
status = "";
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -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.notchDuration
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Widgets
|
||||
import "../components"
|
||||
import "../core"
|
||||
import "../services"
|
||||
import "../theme"
|
||||
|
||||
// The collapsed notch: a glass island hanging from the screen's top edge with
|
||||
// concave ears, showing the time, plus cover art and a small visualizer while
|
||||
// audio plays. Clicking it opens the notch panel.
|
||||
Item {
|
||||
id: root
|
||||
property var barScreen
|
||||
readonly property real bodyWidth: ShellState.notchPillWidth
|
||||
readonly property bool playing: MediaService.playing
|
||||
implicitWidth: bodyWidth + 2 * BarDrawers.ear
|
||||
implicitHeight: BarDrawers.bottom
|
||||
Behavior on implicitWidth {
|
||||
NumberAnimation {
|
||||
duration: Theme.notchDuration * 1.6
|
||||
easing.type: Easing.BezierSpline
|
||||
easing.bezierCurve: [0.2, 0, 0, 1, 1, 1]
|
||||
}
|
||||
}
|
||||
SystemClock {
|
||||
id: clock
|
||||
precision: SystemClock.Minutes
|
||||
}
|
||||
Demand {
|
||||
service: CavaService
|
||||
counter: "widgetConsumers"
|
||||
active: root.visible && root.playing
|
||||
}
|
||||
DrawerShape {
|
||||
bodyWidth: root.width - 2 * BarDrawers.ear
|
||||
bodyHeight: root.height
|
||||
ear: BarDrawers.ear
|
||||
radius: Math.min(Theme.radius, root.height / 2)
|
||||
fillColor: Theme.notchFill
|
||||
}
|
||||
Row {
|
||||
id: content
|
||||
anchors.centerIn: parent
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: BarDrawers.ear
|
||||
anchors.rightMargin: BarDrawers.ear
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||
onClicked: mouse => {
|
||||
if (mouse.button === Qt.RightButton)
|
||||
MediaService.toggle();
|
||||
else
|
||||
ShellState.toggleNotch();
|
||||
}
|
||||
// Wheel changes the volume, as on pocket-dots.
|
||||
onWheel: wheel => {
|
||||
const audio = AudioService.sink ? AudioService.sink.audio : null;
|
||||
const step = ConfigService.ready ? ConfigService.data.osd.step : 5;
|
||||
if (audio && wheel.angleDelta.y !== 0)
|
||||
AudioService.volume(false, audio.volume + (wheel.angleDelta.y > 0 ? 1 : -1) * step / 100);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -21,7 +21,7 @@ PanelWindow {
|
||||
// The OSD capsule takes this spot while it is up; banners wait behind it.
|
||||
readonly property var osd: ShellState.osdWindow
|
||||
readonly property bool yielding: !!osd && osd.shown && osd.options.position === options.position
|
||||
readonly property bool shown: NotificationService.active && items.length > 0 && !yielding && !ShellState.controlCenterOpen
|
||||
readonly property bool shown: NotificationService.active && items.length > 0 && !yielding && !ShellState.controlCenterOpen && !ShellState.notchOpen
|
||||
onItemsChanged: if (items.length > 0 && !drawer.shown)
|
||||
targetScreen = ScreenService.active
|
||||
// Control Center lists everything; banners would cover it.
|
||||
@@ -31,6 +31,11 @@ PanelWindow {
|
||||
if (ShellState.controlCenterOpen)
|
||||
NotificationService.clearPopups();
|
||||
}
|
||||
// The notch lists everything too.
|
||||
function onNotchOpenChanged() {
|
||||
if (ShellState.notchOpen)
|
||||
NotificationService.clearPopups();
|
||||
}
|
||||
}
|
||||
|
||||
anchors {
|
||||
|
||||
@@ -80,7 +80,7 @@ PanelWindow {
|
||||
}
|
||||
function show(next) {
|
||||
// Control Center already shows these levels.
|
||||
if (!options.enabled || !armed || ShellState.controlCenterOpen)
|
||||
if (!options.enabled || !armed || ShellState.controlCenterOpen || ShellState.notchOpen)
|
||||
return;
|
||||
if (!shown)
|
||||
targetScreen = ScreenService.active;
|
||||
|
||||
@@ -19,21 +19,26 @@ Singleton {
|
||||
error = "This desktop entry is no longer installed.";
|
||||
return false;
|
||||
}
|
||||
let command = action ? action.command : entry.command;
|
||||
if (entry.runInTerminal) {
|
||||
const terminal = ConfigService.data.dock.terminalCommand;
|
||||
if (!terminal.length) {
|
||||
error = "Set dock.terminalCommand to a terminal command argument array before launching terminal applications.";
|
||||
return false;
|
||||
}
|
||||
Quickshell.execDetached({
|
||||
command: terminal.concat(action ? action.command : entry.command),
|
||||
workingDirectory: entry.workingDirectory
|
||||
});
|
||||
} else if (action)
|
||||
action.execute();
|
||||
else
|
||||
entry.execute();
|
||||
command = terminal.concat(command);
|
||||
}
|
||||
Quickshell.execDetached({
|
||||
command: scoped(command),
|
||||
workingDirectory: entry.workingDirectory
|
||||
});
|
||||
error = "";
|
||||
return true;
|
||||
}
|
||||
// Run the app in its own transient systemd scope. Launched directly, it would
|
||||
// join the shell's cgroup and be killed whenever the shell service restarts.
|
||||
// Falls back to a plain launch where systemd-run is unavailable.
|
||||
function scoped(command) {
|
||||
return ["sh", "-c", 'if command -v systemd-run >/dev/null 2>&1; then exec systemd-run --user --scope --collect --quiet -- "$@"; fi; exec "$@"', "sh"].concat(command);
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,7 @@ function validate(c) {
|
||||
}
|
||||
if (typeof c.animation.reducedMotion !== "boolean" || !Number.isFinite(c.animation.duration) || c.animation.duration < 0 || c.animation.duration > 1000) throw Error("Invalid animation settings");
|
||||
if (!Number.isFinite(c.bar.height) || c.bar.height < 32 || c.bar.height > 80 || !Number.isFinite(c.bar.margin) || c.bar.margin < 0 || c.bar.margin > 100) throw Error("Invalid bar geometry");
|
||||
if(!Number.isInteger(c.bar.workspaces.count) || c.bar.workspaces.count<1 || c.bar.workspaces.count>20 || !["numbers","roman","dots","pacman"].includes(c.bar.workspaces.style) || ["showDate","use24Hour","showSeconds"].some(k=>typeof c.bar.clock[k]!=="boolean"))throw Error("Invalid bar module options");
|
||||
if(!Number.isInteger(c.bar.workspaces.count) || c.bar.workspaces.count<1 || c.bar.workspaces.count>20 || !["numbers","roman","kanji","dots","pacman"].includes(c.bar.workspaces.style) || ["showDate","use24Hour","showSeconds"].some(k=>typeof c.bar.clock[k]!=="boolean"))throw Error("Invalid bar module options");
|
||||
const cava=c.bar.cava;
|
||||
if(!cava || !Number.isInteger(cava.bars) || cava.bars<4 || cava.bars>24 || !["bars","mirror"].includes(cava.style) || typeof cava.hideWhenIdle!=="boolean")throw Error("Invalid bar visualizer preferences");
|
||||
const validModules = list => {
|
||||
@@ -84,6 +84,12 @@ function validate(c) {
|
||||
if(!dash || ["enabled","openFromClock","rememberTab","easyEffects"].some(k=>typeof dash[k]!=="boolean") || !["top-left","top-center","top-right","center"].includes(dash.position) || !Array.isArray(dash.tabs))throw Error("Invalid dashboard preferences");
|
||||
const dashTabs=new Set();
|
||||
for(const t of dash.tabs) { if(!t || typeof t.id!=="string" || dashTabs.has(t.id) || typeof t.enabled!=="boolean")throw Error("Invalid dashboard tab"); dashTabs.add(t.id); }
|
||||
if(!c.notch || ["enabled","mediaFirst"].some(k=>typeof c.notch[k]!=="boolean"))throw Error("Invalid notch preferences");
|
||||
for(const key of ["left","right","strip"]) if(!Array.isArray(c.notch[key]) || c.notch[key].some(id=>typeof id!=="string" || !id))throw Error("Invalid notch modules");
|
||||
if(!Array.isArray(c.notch.controls) || c.notch.controls.some(m=>!m || typeof m.id!=="string" || typeof m.enabled!=="boolean" || ["w","h"].some(k=>m[k]!==undefined && (!Number.isInteger(m[k]) || m[k]<1 || m[k]>4)) || [["x",3],["y",63]].some(([k,max])=>m[k]!==undefined && (!Number.isInteger(m[k]) || m[k]<0 || m[k]>max))))throw Error("Invalid notch controls");
|
||||
if(!Number.isFinite(c.notch.opacity) || c.notch.opacity<0 || c.notch.opacity>100 || typeof c.notch.color!=="string" || (c.notch.color!=="" && !/^#[0-9a-fA-F]{6}$/.test(c.notch.color)))throw Error("Invalid notch colour");
|
||||
if(typeof c.notch.glassOnOpen!=="boolean" || ["openSpeed","closeSpeed","colorSpeed"].some(k=>!Number.isFinite(c.notch[k]) || c.notch[k]<25 || c.notch[k]>300))throw Error("Invalid notch animation");
|
||||
if(!["bar","numbers","roman","kanji","dots","pacman"].includes(c.notch.workspaceStyle))throw Error("Invalid notch workspace style");
|
||||
if(typeof c.osd.enabled!=="boolean" || !["slide","drop","fade","shrink"].includes(c.osd.animation) || !["top-right","top-center","bottom-center"].includes(c.osd.position) || !Number.isInteger(c.osd.timeout) || c.osd.timeout<500 || c.osd.timeout>5000 || !Number.isInteger(c.osd.step) || c.osd.step<1 || c.osd.step>20)throw Error("Invalid OSD preferences");
|
||||
const notes=c.notifications;
|
||||
if(!notes || ["enabled","doNotDisturb","criticalInDnd"].some(k=>typeof notes[k]!=="boolean") || !["slide","drop","fade","shrink"].includes(notes.animation) || !["top-right","top-center"].includes(notes.position) || !Number.isInteger(notes.timeout) || notes.timeout<1000 || notes.timeout>30000 || !Number.isInteger(notes.maxPopups) || notes.maxPopups<1 || notes.maxPopups>6)throw Error("Invalid notification preferences");
|
||||
|
||||
@@ -238,6 +238,8 @@ Singleton {
|
||||
if (activePopout && activePopout !== owner && typeof activePopout.close === "function")
|
||||
activePopout.close();
|
||||
activePopout = owner;
|
||||
// The notch stays open: its strip hosts plugin widgets whose panels
|
||||
// open from it. It hands keyboard focus over while one is open.
|
||||
ShellState.controlCenterOpen = false;
|
||||
ShellState.dashboardOpen = false;
|
||||
PopoutState.close();
|
||||
@@ -412,6 +414,10 @@ Singleton {
|
||||
if (ShellState.launcherOpen)
|
||||
root.closePopout();
|
||||
}
|
||||
function onNotchOpenChanged() {
|
||||
if (!ShellState.notchOpen)
|
||||
root.closePopout();
|
||||
}
|
||||
function onSettingsOpenChanged() {
|
||||
if (ShellState.settingsOpen)
|
||||
root.closePopout();
|
||||
|
||||
@@ -39,6 +39,10 @@ Singleton {
|
||||
if (!ShellState.controlCenterOpen)
|
||||
root.cancel();
|
||||
}
|
||||
function onNotchOpenChanged() {
|
||||
if (!ShellState.notchOpen)
|
||||
root.cancel();
|
||||
}
|
||||
function onSettingsPageChanged() {
|
||||
root.cancel();
|
||||
}
|
||||
|
||||
@@ -16,8 +16,8 @@ Singleton {
|
||||
readonly property var features: {
|
||||
if (!ConfigService.ready)
|
||||
return [];
|
||||
if (ShellState.controlCenterOpen)
|
||||
return ConfigService.data.controlCenter.modules.filter(m => m.enabled && ["brightness", "nightLight", "dnd", "profiles", "power"].includes(m.id)).map(m => m.id);
|
||||
if (ShellState.controlCenterOpen || ShellState.notchOpen)
|
||||
return (ShellState.notchOpen && ConfigService.data.notch.controls.length ? ConfigService.data.notch.controls : ConfigService.data.controlCenter.modules).filter(m => m.enabled && ["brightness", "nightLight", "dnd", "profiles", "power"].includes(m.id)).map(m => m.id);
|
||||
if (ShellState.dashboardOpen)
|
||||
return ["power"];
|
||||
if (!ShellState.settingsOpen)
|
||||
|
||||
@@ -71,6 +71,7 @@ Singleton {
|
||||
if (!options.enabled || !item || !item.hasMenu || !icon)
|
||||
return false;
|
||||
ShellState.controlCenterOpen = false;
|
||||
ShellState.notchOpen = false;
|
||||
ShellState.launcherOpen = false;
|
||||
ShellState.settingsOpen = false;
|
||||
currentItem = item;
|
||||
|
||||
@@ -302,6 +302,8 @@ PanelWindow {
|
||||
return osd;
|
||||
case "dashboard":
|
||||
return dashboardPage;
|
||||
case "notch":
|
||||
return notchPage;
|
||||
case "plugins":
|
||||
return pluginsPage;
|
||||
case "launcher":
|
||||
@@ -422,6 +424,10 @@ PanelWindow {
|
||||
id: dashboardPage
|
||||
Pages.Dashboard {}
|
||||
}
|
||||
Component {
|
||||
id: notchPage
|
||||
Pages.Notch {}
|
||||
}
|
||||
Component {
|
||||
id: lockPage
|
||||
Pages.Lock {}
|
||||
|
||||
@@ -134,10 +134,10 @@ SettingsPage {
|
||||
title: "Workspaces"
|
||||
PreferenceChoice {
|
||||
label: "Workspace style"
|
||||
description: "Numbers, roman numerals, dots (filled when occupied) or Pac-Man"
|
||||
description: "Numbers, roman numerals, kanji, dots (filled when occupied) or Pac-Man"
|
||||
icon: ""
|
||||
setting: "bar.workspaces.style"
|
||||
choices: ["numbers", "roman", "dots", "pacman"]
|
||||
choices: ["numbers", "roman", "kanji", "dots", "pacman"]
|
||||
}
|
||||
SettingRow {
|
||||
title: "Preview"
|
||||
|
||||
@@ -0,0 +1,207 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import "../controls"
|
||||
import "../../components"
|
||||
import "../../core"
|
||||
import "../../services"
|
||||
import "../../theme"
|
||||
|
||||
SettingsPage {
|
||||
id: root
|
||||
readonly property var options: ConfigService.data.notch
|
||||
// Adds or removes a bar module from one of the notch's module lists.
|
||||
function toggleModule(key, id) {
|
||||
const list = (options[key] || []).slice();
|
||||
const at = list.indexOf(id);
|
||||
if (at >= 0)
|
||||
list.splice(at, 1);
|
||||
else
|
||||
list.push(id);
|
||||
ConfigService.setValue("notch." + key, list);
|
||||
}
|
||||
// Chips for every bar module; filled ones are shown there, in click order.
|
||||
component ModulePicker: SettingRow {
|
||||
id: picker
|
||||
property string key
|
||||
below: Flow {
|
||||
Layout.fillWidth: true
|
||||
spacing: 6
|
||||
Repeater {
|
||||
model: ModuleRegistry.available
|
||||
Rectangle {
|
||||
id: chip
|
||||
required property string modelData
|
||||
readonly property bool on: (root.options[picker.key] || []).includes(modelData)
|
||||
objectName: "notchModule-" + picker.key + "-" + modelData
|
||||
implicitWidth: chipLabel.implicitWidth + 24
|
||||
implicitHeight: 28
|
||||
radius: 14
|
||||
color: on ? (chipArea.containsMouse ? Theme.accentHover : Theme.accent) : chipArea.containsMouse ? Theme.hover : Theme.fill
|
||||
border.width: on ? 0 : 1
|
||||
border.color: Theme.hairline
|
||||
Accessible.role: Accessible.CheckBox
|
||||
Accessible.name: ModuleRegistry.title(modelData)
|
||||
Accessible.checked: on
|
||||
Text {
|
||||
id: chipLabel
|
||||
anchors.centerIn: parent
|
||||
text: ModuleRegistry.title(chip.modelData)
|
||||
color: chip.on ? Theme.accentText : Theme.text
|
||||
font.pixelSize: 12
|
||||
font.weight: Font.Medium
|
||||
}
|
||||
MouseArea {
|
||||
id: chipArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: root.toggleModule(picker.key, chip.modelData)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
SettingsSection {
|
||||
title: "Notch"
|
||||
description: "Splits the bar into side islands with a notch at the top centre. Super+C, Super+X and a click on the notch open it: dashboard pages on the left (scroll to switch), controls and weather in the middle, notifications on the right. The launcher drops out of it."
|
||||
PreferenceToggle {
|
||||
label: "Notch"
|
||||
description: root.options.enabled ? "On: notch mode" : "Off: the full bar"
|
||||
icon: ""
|
||||
setting: "notch.enabled"
|
||||
}
|
||||
}
|
||||
SettingsSection {
|
||||
title: "Look"
|
||||
description: "0% is the normal glass. Raise the opacity towards a solid colour: e.g. 50% with a purple colour, or 100% black for OLED."
|
||||
enabled: root.options.enabled
|
||||
PreferenceSlider {
|
||||
label: "Notch opacity"
|
||||
icon: ""
|
||||
setting: "notch.opacity"
|
||||
from: 0
|
||||
to: 100
|
||||
step: 1
|
||||
unit: "%"
|
||||
}
|
||||
PreferenceToggle {
|
||||
label: "Glassy when open"
|
||||
description: "Keeps the colour and opacity on the docked notch; the open notch and launcher fade back to the normal glass"
|
||||
icon: ""
|
||||
setting: "notch.glassOnOpen"
|
||||
}
|
||||
PreferenceSlider {
|
||||
label: "Opening speed"
|
||||
description: "Notch and launcher; 100% follows the shell's animation duration"
|
||||
icon: ""
|
||||
setting: "notch.openSpeed"
|
||||
from: 25
|
||||
to: 300
|
||||
step: 5
|
||||
unit: "%"
|
||||
}
|
||||
PreferenceSlider {
|
||||
label: "Closing speed"
|
||||
description: "100% follows the shell's animation duration"
|
||||
icon: ""
|
||||
setting: "notch.closeSpeed"
|
||||
from: 25
|
||||
to: 300
|
||||
step: 5
|
||||
unit: "%"
|
||||
}
|
||||
PreferenceSlider {
|
||||
label: "Colour change speed"
|
||||
description: "How fast the docked colour turns glassy when opening (closing never outlasts the close)"
|
||||
icon: ""
|
||||
setting: "notch.colorSpeed"
|
||||
from: 25
|
||||
to: 300
|
||||
step: 5
|
||||
unit: "%"
|
||||
}
|
||||
SettingRow {
|
||||
title: "Notch colour"
|
||||
description: root.options.color ? "Custom colour" : "Glass tint (Appearance)"
|
||||
icon: ""
|
||||
setting: "notch.color"
|
||||
GlassTextField {
|
||||
Layout.preferredWidth: 120
|
||||
color: Theme.text
|
||||
selectByMouse: true
|
||||
placeholderText: "Glass tint"
|
||||
text: root.options.color
|
||||
validator: RegularExpressionValidator {
|
||||
regularExpression: /(#[0-9a-fA-F]{6})?/
|
||||
}
|
||||
onEditingFinished: if (acceptableInput)
|
||||
ConfigService.setValue("notch.color", text)
|
||||
}
|
||||
GlassButton {
|
||||
text: "Black"
|
||||
onClicked: ConfigService.setValue("notch.color", "#000000")
|
||||
}
|
||||
below: GlassColorPicker {
|
||||
Layout.fillWidth: true
|
||||
selectedColor: root.options.color || Theme.tint
|
||||
onChosen: color => ConfigService.setValue("notch.color", color.toString())
|
||||
}
|
||||
}
|
||||
}
|
||||
SettingsSection {
|
||||
title: "Opening"
|
||||
enabled: root.options.enabled
|
||||
PreferenceToggle {
|
||||
label: "Open on Media while audio plays"
|
||||
description: "Otherwise it opens on the last page"
|
||||
icon: ""
|
||||
setting: "notch.mediaFirst"
|
||||
}
|
||||
SettingRow {
|
||||
title: "Preview"
|
||||
icon: ""
|
||||
GlassButton {
|
||||
objectName: "notchOpenButton"
|
||||
text: "Open notch"
|
||||
enabled: root.options.enabled
|
||||
onClicked: ShellState.openNotch()
|
||||
}
|
||||
}
|
||||
}
|
||||
SettingsSection {
|
||||
title: "Workspaces"
|
||||
enabled: root.options.enabled
|
||||
PreferenceChoice {
|
||||
label: "Workspace style"
|
||||
description: "Notch mode only; \"bar\" uses the style from Settings → Bar"
|
||||
icon: ""
|
||||
setting: "notch.workspaceStyle"
|
||||
choices: ["bar", "numbers", "roman", "kanji", "dots", "pacman"]
|
||||
}
|
||||
}
|
||||
SettingsSection {
|
||||
title: "Modules"
|
||||
description: "Which bar modules show in notch mode. The strip sits left of the clock in the open notch; the mouse wheel scrolls it sideways when it overflows."
|
||||
enabled: root.options.enabled
|
||||
ModulePicker {
|
||||
title: "Notch strip"
|
||||
description: "Left of the clock in the open notch, e.g. AI usage or the screen recorder"
|
||||
icon: ""
|
||||
key: "strip"
|
||||
}
|
||||
ModulePicker {
|
||||
title: "Left island"
|
||||
icon: ""
|
||||
key: "left"
|
||||
}
|
||||
ModulePicker {
|
||||
title: "Right island"
|
||||
icon: ""
|
||||
key: "right"
|
||||
}
|
||||
}
|
||||
SettingNote {
|
||||
text: "Super+N switches between notch mode and the full bar. The cog in the open notch edits its tiles in place, separately from the Control Center. Follow Control Center (in that editor) mirrors the Control Center again."
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,7 @@ import "widgets"
|
||||
import "wallpaper"
|
||||
import "controlcenter"
|
||||
import "dashboard"
|
||||
import "notch"
|
||||
import "overview"
|
||||
import "osd"
|
||||
import "notifications"
|
||||
@@ -37,6 +38,7 @@ ShellRoot {
|
||||
WallpaperPicker {}
|
||||
ControlCenter {}
|
||||
Dashboard {}
|
||||
Notch {}
|
||||
Overview {}
|
||||
PluginHost {}
|
||||
Osd {}
|
||||
@@ -106,6 +108,7 @@ ShellRoot {
|
||||
ShellState.wallpaperPickerOpen = false;
|
||||
ShellState.controlCenterOpen = false;
|
||||
ShellState.dashboardOpen = false;
|
||||
ShellState.notchOpen = false;
|
||||
ShellState.overviewOpen = false;
|
||||
ShellState.settingsOpen = false;
|
||||
ShellState.launcherOpen = false;
|
||||
|
||||
@@ -32,6 +32,28 @@ Singleton {
|
||||
// opacity, controls and cards are translucent shades of it (never grey overlays).
|
||||
readonly property color tint: ConfigService.ready && /^#[0-9a-fA-F]{6}$/.test(ConfigService.data.appearance.glassTint) ? ConfigService.data.appearance.glassTint : "#000000"
|
||||
readonly property color surface: tint
|
||||
// Notch mode's fill: at opacity 0 it is the normal glass; raising it moves
|
||||
// towards a solid colour (the glass tint unless a notch colour is set).
|
||||
readonly property color notchFill: {
|
||||
const n = ConfigService.ready ? ConfigService.data.notch : null;
|
||||
const c = n && /^#[0-9a-fA-F]{6}$/.test(n.color) ? n.color : tint;
|
||||
const o = n ? Math.max(0, Math.min(100, n.opacity)) / 100 : 0;
|
||||
return Qt.alpha(c, glassOpacity + (1 - glassOpacity) * o);
|
||||
}
|
||||
// The open notch's fill: the plain glass when "glassy when open" is on.
|
||||
readonly property color notchOpenFill: ConfigService.ready && ConfigService.data.notch.glassOnOpen ? Qt.alpha(tint, glassOpacity) : notchFill
|
||||
// Notch animations run at their own speeds (percent; 100 follows the shell),
|
||||
// one for opening and one for closing.
|
||||
readonly property real notchOpenDuration: duration * 100 / (ConfigService.ready ? Math.max(25, ConfigService.data.notch.openSpeed) : 100)
|
||||
readonly property real notchCloseDuration: duration * 100 / (ConfigService.ready ? Math.max(25, ConfigService.data.notch.closeSpeed) : 100)
|
||||
// Docked colour to the open fill and back (only differs with "glassy when open").
|
||||
readonly property real notchColorDuration: duration * 0.6 * 100 / (ConfigService.ready ? Math.max(25, ConfigService.data.notch.colorSpeed) : 100)
|
||||
// Motion inside the open notch (pages, tiles, the pill's width) uses the opening speed.
|
||||
readonly property real notchDuration: notchOpenDuration
|
||||
function mixColor(a, b, t) {
|
||||
const k = Math.max(0, Math.min(1, t));
|
||||
return Qt.rgba(a.r + (b.r - a.r) * k, a.g + (b.g - a.g) * k, a.b + (b.b - a.b) * k, a.a + (b.a - a.a) * k);
|
||||
}
|
||||
readonly property color surfaceVariant: Qt.alpha(tint, 0.38)
|
||||
readonly property color fill: Qt.alpha(tint, 0.22)
|
||||
readonly property color hover: Qt.alpha(text, 0.09)
|
||||
|
||||
@@ -19,7 +19,11 @@ PanelWindow {
|
||||
readonly property real screenWidth:screen ? screen.width : 1920
|
||||
readonly property real screenHeight:screen ? screen.height : 1080
|
||||
implicitWidth:Math.round(surface.width)
|
||||
implicitHeight:Math.round(BarDrawers.bottom+surface.contentHeight)
|
||||
// Notch mode: no bar to hang from, so it drops from the screen's top edge
|
||||
// in the notch's shape, colour and speeds.
|
||||
readonly property bool notch:ShellState.notchMode
|
||||
readonly property real top:notch ? 0 : BarDrawers.bottom
|
||||
implicitHeight:Math.round(top+surface.contentHeight)
|
||||
visible:ShellState.wallpaperPickerOpen || surface.shown
|
||||
color:Theme.transparent
|
||||
exclusionMode:ExclusionMode.Ignore
|
||||
@@ -107,10 +111,13 @@ PanelWindow {
|
||||
BarDrawer {
|
||||
id:surface
|
||||
objectName:"wallpaperPickerSurface"
|
||||
y:BarDrawers.bottom
|
||||
y:root.top
|
||||
open:ShellState.wallpaperPickerOpen
|
||||
contentWidth:Math.min(1240,root.screenWidth-2*(BarDrawers.margin+BarDrawers.radius+ear))
|
||||
contentHeight:Math.min(640,root.screenHeight-BarDrawers.bottom-40)
|
||||
contentHeight:Math.min(640,root.screenHeight-root.top-40)
|
||||
fillColor:root.notch ? Theme.notchOpenFill : Qt.alpha(Theme.surface,Theme.glassOpacity)
|
||||
openDuration:root.notch ? Theme.notchOpenDuration*2 : Theme.duration*1.8
|
||||
closeDuration:root.notch ? Theme.notchCloseDuration*1.3 : Theme.duration
|
||||
drawerId:"wallpaper"
|
||||
screenName:root.screen ? root.screen.name : ""
|
||||
screenX:(root.screenWidth-width)/2
|
||||
|
||||
@@ -142,6 +142,7 @@ Singleton {
|
||||
function edit(id) {
|
||||
ShellState.settingsOpen = false;
|
||||
ShellState.controlCenterOpen = false;
|
||||
ShellState.notchOpen = false;
|
||||
ShellState.launcherOpen = false;
|
||||
ShellState.wallpaperPickerOpen = false;
|
||||
selected = id || "";
|
||||
|
||||
+7
-1
@@ -50,6 +50,12 @@ case "${1:-run}" in
|
||||
# glassmxrph dashboard [dashboard|media|performance|power]
|
||||
exec quickshell ipc --path "$project_dir/quickshell" call dashboard toggle "${2:-}"
|
||||
;;
|
||||
notch)
|
||||
# glassmxrph notch [toggle|open|close|mode]; mode swaps notch mode and the full bar
|
||||
action=${2:-toggle}
|
||||
[ "$action" = mode ] && action=toggleMode
|
||||
exec quickshell ipc --path "$project_dir/quickshell" call notch "$action"
|
||||
;;
|
||||
lock)
|
||||
exec quickshell ipc --path "$project_dir/quickshell" call lock lock
|
||||
;;
|
||||
@@ -73,5 +79,5 @@ case "${1:-run}" in
|
||||
settings|close|status)
|
||||
exec quickshell ipc --path "$project_dir/quickshell" call shell "$1"
|
||||
;;
|
||||
*) echo 'Usage: glassmxrph [run|wallpaper|launcher|overview|clipboard|emoji|dashboard [TAB]|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]|plugin ACTION|controlcenter|lock|widgets|osd ACTION|notifications ACTION|settings|close|status|doctor]' >&2; exit 2 ;;
|
||||
esac
|
||||
Reference in new issue
Block a user