refactor(Dank Island): update hover delay property defaults

- fix volume pills while notifications are live
This commit is contained in:
purian23
2026-08-22 23:58:43 -04:00
parent 4447d77ba6
commit c57fd7aad1
6 changed files with 61 additions and 26 deletions
+2 -2
View File
@@ -989,8 +989,8 @@ Singleton {
property int dankIslandOuterGap: 4
property int dankIslandHorizontalOffset: 0
property string dankIslandInteractionMode: "hybrid"
property int dankIslandHoverOpenDelay: 220
property int dankIslandHoverCloseDelay: 400
property int dankIslandHoverOpenDelay: 150
property int dankIslandHoverCloseDelay: 150
property string dankIslandPalette: "default"
property bool dankIslandHighContrast: false
property bool dankIslandMediaClockVisible: true
+2 -2
View File
@@ -528,8 +528,8 @@ var SPEC = {
dankIslandOuterGap: { def: 4 },
dankIslandHorizontalOffset: { def: 0 },
dankIslandInteractionMode: { def: "hybrid" },
dankIslandHoverOpenDelay: { def: 220 },
dankIslandHoverCloseDelay: { def: 400 },
dankIslandHoverOpenDelay: { def: 150 },
dankIslandHoverCloseDelay: { def: 150 },
dankIslandPalette: { def: "default" },
dankIslandHighContrast: { def: false },
dankIslandMediaClockVisible: { def: true },
@@ -27,7 +27,7 @@ QtObject {
readonly property bool demoEnabled: Quickshell.env("DMS_DANKISLAND_NOTIFICATION_DEMO") === "1"
readonly property bool hasAction: actionLabel.length > 0
// Keep the wrapper alive while the island is hovered or expanded, matching NotificationPopup.
readonly property bool wrapperTimeoutHeld: controller.notificationActive && controller.timeoutSuspended
readonly property bool wrapperTimeoutHeld: (controller.notificationActive && controller.timeoutSuspended) || controller.notificationHeldForSystem
function isFocusedScreen() {
if (!SettingsData.notificationFocusedMonitor)
@@ -6,7 +6,7 @@ import qs.Common
QtObject {
id: root
// Hybrid expands glance faces on hover but keeps full destinations click-driven.
// Hybrid peeks the current compact face on hover. Click pins destinations.
property string interactionMode: "click"
property bool hoverExpanded: false
property bool inputSuspended: false
@@ -27,6 +27,10 @@ QtObject {
property bool launcherRequestPending: false
property bool launcherSessionActive: false
property bool launcherInputFocused: false
onLauncherInputFocusedChanged: {
if (launcherInputFocused)
hoverExpanded = false;
}
property string launcherPendingQuery: ""
property string launcherPendingMode: ""
property int launcherSessionSerial: 0
@@ -65,8 +69,8 @@ QtObject {
property string suspendedActivity: ""
property bool suspendedExpanded: false
property bool suspendedKeyboardDismissRequested: false
property int hoverOpenDelay: 220
property int hoverCloseDelay: 400
property int hoverOpenDelay: 150
property int hoverCloseDelay: 150
property int mediaReturnDelay: 1800
property real controlCenterContentHeight: 420
property real controlCenterMaxHeight: 640
@@ -357,11 +361,12 @@ QtObject {
})
readonly property bool systemActivityActive: activeActivity === "volume" || activeActivity === "brightness"
readonly property bool notificationActive: activeActivity === "notification"
readonly property bool notificationHeldForSystem: root.systemActivityActive && root.transientReturnActivity === "notification"
readonly property bool transientActive: systemActivityActive || notificationActive
readonly property bool timeoutSuspended: pointerInside || (expanded && !notificationActive)
readonly property var fullDestinations: ["launcher", "controlcenter", "wallpaper", "weather", "notificationcenter"]
readonly property bool activityOwnsBlankClicks: root.fullDestinations.indexOf(root.activeActivity) !== -1
readonly property bool hoverExpandEnabled: root.interactionMode === "hybrid" && !root.activityOwnsBlankClicks && !root.systemActivityActive
readonly property bool hoverExpandEnabled: root.interactionMode === "hybrid" && !root.systemActivityActive
readonly property var compactTarget: {
if (root.notificationActive)
return root.notificationCompactTarget;
@@ -544,6 +549,8 @@ QtObject {
}
function resolvedReturnActivity(activityId) {
if (activityId === "notification")
return "notification";
if (activityId === "media" && !mediaAvailable)
return "home";
if (activityId === "home" || activityId === "media" || fullDestinations.indexOf(activityId) !== -1)
@@ -581,8 +588,10 @@ QtObject {
notificationCenterRequestPending = false;
if (activeActivity === activityId && expanded && shouldExpand === true) {
if (requestKeyboardFocus === true)
if (requestKeyboardFocus === true) {
keyboardDismissRequested = true;
hoverExpanded = false;
}
return true;
}
@@ -618,7 +627,8 @@ QtObject {
return true;
}
hoverExpanded = false;
if (requestKeyboardFocus === true)
hoverExpanded = false;
hoverOpenTimer.stop();
hoverCloseTimer.stop();
transientTimer.stop();
@@ -849,6 +859,14 @@ QtObject {
transientTimer.stop();
const returnActivity = resolvedReturnActivity(transientReturnActivity);
transientReturnActivity = "";
if (returnActivity === "notification") {
hoverExpanded = false;
keyboardDismissRequested = false;
expanded = notificationExpandAllowed;
activeActivity = "notification";
syncNotificationTimeout(true);
return;
}
activeActivity = returnActivity;
}
@@ -856,9 +874,6 @@ QtObject {
if (activityId !== "volume" && activityId !== "brightness")
return false;
if (notificationActive)
return false;
launcherRequestPending = false;
launcherSessionActive = false;
controlCenterRequestPending = false;
@@ -866,6 +881,20 @@ QtObject {
weatherRequestPending = false;
notificationCenterRequestPending = false;
if (notificationActive) {
notificationTimer.stop();
hoverExpanded = false;
hoverOpenTimer.stop();
hoverCloseTimer.stop();
keyboardDismissRequested = false;
expanded = false;
if (!systemActivityActive)
transientReturnActivity = "notification";
activeActivity = activityId;
syncTransientTimeout(true);
return true;
}
if (expanded) {
if (activeActivity === activityId)
transientTimer.stop();
@@ -884,6 +913,8 @@ QtObject {
}
function consumeTransientNotification() {
if (transientReturnActivity === "notification")
transientReturnActivity = "";
if (!notificationActive)
return;
notificationTimer.stop();
@@ -953,6 +984,8 @@ QtObject {
}
function completeNotification() {
if (transientReturnActivity === "notification")
transientReturnActivity = "";
if (!notificationActive)
return false;
resumeAfterNotification(true);
@@ -990,7 +1023,7 @@ QtObject {
hoverCloseTimer.stop();
return;
}
if (!pointerInside && hoverExpanded && expanded && !activityOwnsBlankClicks)
if (!pointerInside && hoverExpanded && expanded)
hoverCloseTimer.restart();
}
@@ -1002,7 +1035,7 @@ QtObject {
hoverOpenTimer.restart();
} else {
hoverOpenTimer.stop();
if (hoverExpanded && expanded && !activityOwnsBlankClicks && !mediaDropdownOpen)
if (hoverExpanded && expanded && !mediaDropdownOpen)
hoverCloseTimer.restart();
}
syncNotificationTimeout(!pointerInside);
@@ -377,7 +377,7 @@ Item {
settingKey: "dankIslandInteractionMode"
tags: ["island", "interaction", "click", "hybrid", "expand"]
text: I18n.tr("Expansion Mode")
description: I18n.tr("Click expands only on an intentional press. Hybrid peeks glance faces on hover")
description: I18n.tr("Click expands only on an intentional press. Hybrid peeks the current compact face on hover")
readonly property var _modeValues: ["click", "hybrid"]
model: [I18n.tr("Click"), I18n.tr("Hybrid")]
currentIndex: SettingsData.dankIslandInteractionMode === "click" ? 0 : 1
@@ -389,7 +389,7 @@ Item {
StyledText {
width: parent.width
text: I18n.tr("Hybrid peeks at the clock, media, system faces, and notifications on hover. Control Center, the launcher, wallpapers, and weather are click actions")
text: I18n.tr("Hybrid peeks the current compact face on hover. Click pins a destination so it stays open")
color: Theme.surfaceVariantText
font.pixelSize: Theme.fontSizeSmall
wrapMode: Text.WordWrap
@@ -404,7 +404,7 @@ Item {
minimum: 0
maximum: 1000
step: 10
defaultValue: 220
defaultValue: 150
value: SettingsData.dankIslandHoverOpenDelay
enabled: SettingsData.dankIslandInteractionMode !== "click"
onSliderValueChanged: value => SettingsData.set("dankIslandHoverOpenDelay", value)
@@ -418,7 +418,7 @@ Item {
minimum: 0
maximum: 1000
step: 10
defaultValue: 400
defaultValue: 150
value: SettingsData.dankIslandHoverCloseDelay
enabled: SettingsData.dankIslandInteractionMode !== "click"
onSliderValueChanged: value => SettingsData.set("dankIslandHoverCloseDelay", value)
@@ -12085,13 +12085,14 @@
"keywords": [
"activities",
"click",
"compact",
"current",
"dank",
"dynamic island",
"expand",
"expands",
"expansion",
"faces",
"glance",
"face",
"hover",
"hybrid",
"intentional",
@@ -12101,7 +12102,7 @@
"peeks",
"press"
],
"description": "Click expands only on an intentional press. Hybrid peeks glance faces on hover"
"description": "Click expands only on an intentional press. Hybrid peeks the current compact face on hover"
},
{
"section": "dankIslandFloating",
@@ -12239,12 +12240,13 @@
"keywords": [
"activities",
"click",
"compact",
"current",
"dank",
"dynamic island",
"expand",
"expands",
"faces",
"glance",
"face",
"hover",
"hybrid",
"intentional",
@@ -12254,7 +12256,7 @@
"press"
],
"icon": "touch_app",
"description": "Click expands only on an intentional press. Hybrid peeks glance faces on hover"
"description": "Click expands only on an intentional press. Hybrid peeks the current compact face on hover"
},
{
"section": "_tab_46",