Add notch speeds and a glassy-when-open option
- Settings → Notch → Look: separate opening, closing and colour-change speeds for the notch and the notch-mode launcher. - "Glassy when open" keeps the custom colour/opacity on the docked notch and fades the open notch and launcher back to the normal glass; closing never outlasts the shrink, so it docks in the docked colour. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e4ca1f5d9c
commit
efaace0f15
9 files changed
+87
-19
No files matched your search
@@ -270,7 +270,11 @@
|
|||||||
"strip": [],
|
"strip": [],
|
||||||
"controls": [],
|
"controls": [],
|
||||||
"opacity": 0,
|
"opacity": 0,
|
||||||
"color": ""
|
"color": "",
|
||||||
|
"glassOnOpen": false,
|
||||||
|
"openSpeed": 100,
|
||||||
|
"closeSpeed": 100,
|
||||||
|
"colorSpeed": 100
|
||||||
},
|
},
|
||||||
"dashboard": {
|
"dashboard": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ Singleton {
|
|||||||
available: true,
|
available: true,
|
||||||
group: "shell",
|
group: "shell",
|
||||||
icon: "",
|
icon: "",
|
||||||
keywords: ["Notch", "Notch mode", "Notch opacity", "Notch colour", "Open on Media while audio plays", "Pocket-dots", "Left island", "Right island", "Notch strip"]
|
keywords: ["Notch", "Notch mode", "Notch opacity", "Notch colour", "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",
|
id: "tray",
|
||||||
|
|||||||
@@ -275,7 +275,13 @@ PanelWindow {
|
|||||||
bodyHeight: panel.height
|
bodyHeight: panel.height
|
||||||
ear: BarDrawers.ear
|
ear: BarDrawers.ear
|
||||||
radius: panel.radius
|
radius: panel.radius
|
||||||
fillColor: Theme.notchFill
|
// 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 {
|
GlassPanel {
|
||||||
id: panel
|
id: panel
|
||||||
@@ -294,25 +300,25 @@ PanelWindow {
|
|||||||
clip: true
|
clip: true
|
||||||
Behavior on width {
|
Behavior on width {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: Theme.duration
|
duration: !root.notch ? Theme.duration : ShellState.launcherOpen ? Theme.notchOpenDuration : Theme.notchCloseDuration
|
||||||
easing.type: Easing.OutCubic
|
easing.type: Easing.OutCubic
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Behavior on height {
|
Behavior on height {
|
||||||
enabled: !root.snapping
|
enabled: !root.snapping
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: Theme.duration
|
duration: !root.notch ? Theme.duration : ShellState.launcherOpen ? Theme.notchOpenDuration : Theme.notchCloseDuration
|
||||||
easing.type: Easing.OutCubic
|
easing.type: Easing.OutCubic
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Behavior on opacity {
|
Behavior on opacity {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: Theme.duration
|
duration: !root.notch ? Theme.duration : ShellState.launcherOpen ? Theme.notchOpenDuration : Theme.notchCloseDuration
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Behavior on scale {
|
Behavior on scale {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: Theme.duration
|
duration: !root.notch ? Theme.duration : ShellState.launcherOpen ? Theme.notchOpenDuration : Theme.notchCloseDuration
|
||||||
easing.type: Easing.OutCubic
|
easing.type: Easing.OutCubic
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+17
-10
@@ -51,7 +51,7 @@ PanelWindow {
|
|||||||
Behavior on progress {
|
Behavior on progress {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
id: morph
|
id: morph
|
||||||
duration: ShellState.notchOpen ? Theme.duration * 2 : Theme.duration * 1.3
|
duration: ShellState.notchOpen ? Theme.notchOpenDuration * 2 : Theme.notchCloseDuration * 1.3
|
||||||
easing.type: Easing.BezierSpline
|
easing.type: Easing.BezierSpline
|
||||||
easing.bezierCurve: ShellState.notchOpen ? [0.2, 0, 0, 1, 1, 1] : [0.3, 0, 0.8, 0.15, 1, 1]
|
easing.bezierCurve: ShellState.notchOpen ? [0.2, 0, 0, 1, 1, 1] : [0.3, 0, 0.8, 0.15, 1, 1]
|
||||||
}
|
}
|
||||||
@@ -64,7 +64,7 @@ PanelWindow {
|
|||||||
Behavior on targetWidth {
|
Behavior on targetWidth {
|
||||||
enabled: root.settled
|
enabled: root.settled
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: Theme.duration * 1.4
|
duration: Theme.notchDuration * 1.4
|
||||||
easing.type: Easing.BezierSpline
|
easing.type: Easing.BezierSpline
|
||||||
easing.bezierCurve: [0.2, 0, 0, 1, 1, 1]
|
easing.bezierCurve: [0.2, 0, 0, 1, 1, 1]
|
||||||
}
|
}
|
||||||
@@ -72,7 +72,7 @@ PanelWindow {
|
|||||||
Behavior on targetHeight {
|
Behavior on targetHeight {
|
||||||
enabled: root.settled
|
enabled: root.settled
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: Theme.duration * 1.4
|
duration: Theme.notchDuration * 1.4
|
||||||
easing.type: Easing.BezierSpline
|
easing.type: Easing.BezierSpline
|
||||||
easing.bezierCurve: [0.2, 0, 0, 1, 1, 1]
|
easing.bezierCurve: [0.2, 0, 0, 1, 1, 1]
|
||||||
}
|
}
|
||||||
@@ -135,7 +135,14 @@ PanelWindow {
|
|||||||
bodyHeight: root.bodyHeight
|
bodyHeight: root.bodyHeight
|
||||||
ear: root.ear
|
ear: root.ear
|
||||||
radius: Math.min(Theme.radius + 8, root.bodyHeight / 2)
|
radius: Math.min(Theme.radius + 8, root.bodyHeight / 2)
|
||||||
fillColor: Theme.notchFill
|
// Fades between the docked and open fill at its own speed; closing, it
|
||||||
|
// never outlasts the shrink so it docks in the docked colour.
|
||||||
|
fillColor: ShellState.notchOpen ? Theme.notchOpenFill : Theme.notchFill
|
||||||
|
Behavior on fillColor {
|
||||||
|
ColorAnimation {
|
||||||
|
duration: ShellState.notchOpen ? Theme.notchColorDuration : Math.min(Theme.notchColorDuration, Theme.notchCloseDuration * 1.3)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
@@ -296,7 +303,7 @@ PanelWindow {
|
|||||||
Behavior on opacity {
|
Behavior on opacity {
|
||||||
enabled: root.settled
|
enabled: root.settled
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: Theme.duration
|
duration: Theme.notchDuration
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -321,7 +328,7 @@ PanelWindow {
|
|||||||
y: -pager.page * pager.height
|
y: -pager.page * pager.height
|
||||||
Behavior on y {
|
Behavior on y {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: Theme.duration * 1.6
|
duration: Theme.notchDuration * 1.6
|
||||||
easing.type: Easing.BezierSpline
|
easing.type: Easing.BezierSpline
|
||||||
easing.bezierCurve: [0.2, 0, 0, 1, 1, 1]
|
easing.bezierCurve: [0.2, 0, 0, 1, 1, 1]
|
||||||
}
|
}
|
||||||
@@ -354,7 +361,7 @@ PanelWindow {
|
|||||||
border.color: Theme.hairline
|
border.color: Theme.hairline
|
||||||
Behavior on color {
|
Behavior on color {
|
||||||
ColorAnimation {
|
ColorAnimation {
|
||||||
duration: Theme.duration / 2
|
duration: Theme.notchDuration / 2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Column {
|
Column {
|
||||||
@@ -503,7 +510,7 @@ PanelWindow {
|
|||||||
color: pager.page === index ? Theme.accent : Qt.alpha(Theme.text, 0.25)
|
color: pager.page === index ? Theme.accent : Qt.alpha(Theme.text, 0.25)
|
||||||
Behavior on height {
|
Behavior on height {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: Theme.duration
|
duration: Theme.notchDuration
|
||||||
easing.type: Easing.OutCubic
|
easing.type: Easing.OutCubic
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -602,7 +609,7 @@ PanelWindow {
|
|||||||
Behavior on y {
|
Behavior on y {
|
||||||
enabled: root.settled
|
enabled: root.settled
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: Theme.duration
|
duration: Theme.notchDuration
|
||||||
easing.type: Easing.OutCubic
|
easing.type: Easing.OutCubic
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -692,7 +699,7 @@ PanelWindow {
|
|||||||
Behavior on opacity {
|
Behavior on opacity {
|
||||||
enabled: root.settled
|
enabled: root.settled
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: Theme.duration
|
duration: Theme.notchDuration
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ Item {
|
|||||||
opacity: status === Image.Ready ? 1 : 0
|
opacity: status === Image.Ready ? 1 : 0
|
||||||
Behavior on opacity {
|
Behavior on opacity {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: Theme.duration
|
duration: Theme.notchDuration
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ Item {
|
|||||||
implicitHeight: BarDrawers.bottom
|
implicitHeight: BarDrawers.bottom
|
||||||
Behavior on implicitWidth {
|
Behavior on implicitWidth {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: Theme.duration * 1.6
|
duration: Theme.notchDuration * 1.6
|
||||||
easing.type: Easing.BezierSpline
|
easing.type: Easing.BezierSpline
|
||||||
easing.bezierCurve: [0.2, 0, 0, 1, 1, 1]
|
easing.bezierCurve: [0.2, 0, 0, 1, 1, 1]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -88,6 +88,7 @@ function validate(c) {
|
|||||||
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");
|
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(!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(!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(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");
|
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;
|
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");
|
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");
|
||||||
|
|||||||
@@ -85,6 +85,42 @@ SettingsPage {
|
|||||||
step: 1
|
step: 1
|
||||||
unit: "%"
|
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 {
|
SettingRow {
|
||||||
title: "Notch colour"
|
title: "Notch colour"
|
||||||
description: root.options.color ? "Custom colour" : "Glass tint (Appearance)"
|
description: root.options.color ? "Custom colour" : "Glass tint (Appearance)"
|
||||||
|
|||||||
@@ -40,6 +40,20 @@ Singleton {
|
|||||||
const o = n ? Math.max(0, Math.min(100, n.opacity)) / 100 : 0;
|
const o = n ? Math.max(0, Math.min(100, n.opacity)) / 100 : 0;
|
||||||
return Qt.alpha(c, glassOpacity + (1 - glassOpacity) * o);
|
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 surfaceVariant: Qt.alpha(tint, 0.38)
|
||||||
readonly property color fill: Qt.alpha(tint, 0.22)
|
readonly property color fill: Qt.alpha(tint, 0.22)
|
||||||
readonly property color hover: Qt.alpha(text, 0.09)
|
readonly property color hover: Qt.alpha(text, 0.09)
|
||||||
|
|||||||
Reference in new issue
Block a user