1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-06-28 22:12:10 -04:00

feat(popouts): complete initial hover implementation

This commit is contained in:
purian23
2026-06-26 23:33:40 -04:00
parent 06fa21118e
commit 7979fb2b0e
16 changed files with 642 additions and 80 deletions
+23 -6
View File
@@ -186,6 +186,14 @@ Singleton {
return currentPopoutsByScreen[screen.name] || null;
}
// Checks if the active popout is pinned for auto-dismissal
function isActivePopoutPinned(screen) {
const p = getActivePopout(screen);
if (!p || !_isPopoutPresented(p))
return false;
return p.hoverDismissEnabled === false;
}
function isCurrentPopout(popout, screenName) {
const name = screenName || popout?.screen?.name || "";
return !!name && currentPopoutsByScreen[name] === popout;
@@ -194,6 +202,8 @@ Singleton {
function requestPopout(popout, tabIndex, triggerSource) {
if (!popout || !popout.screen)
return;
// Clicking a hover popout pins it open rather than toggling it closed
const wasTransient = popout.hoverDismissEnabled === true;
if (popout.hoverDismissEnabled !== undefined)
popout.hoverDismissEnabled = false;
screenshotActive = false;
@@ -240,13 +250,17 @@ Singleton {
}
if (currentPopout === popout && popout.shouldBeVisible && !movedFromOtherScreen) {
if (triggerId !== undefined && currentPopoutTriggers[screenName] === triggerId) {
_closePopout(popout);
return;
}
const sameTrigger = triggerId === undefined || currentPopoutTriggers[screenName] === triggerId;
if (triggerId === undefined) {
_closePopout(popout);
if (sameTrigger) {
if (!wasTransient) {
_closePopout(popout);
return;
}
if (popout.updateSurfacePosition)
popout.updateSurfacePosition();
if (triggerId !== undefined)
currentPopoutTriggers[screenName] = triggerId;
return;
}
@@ -315,6 +329,9 @@ Singleton {
currentPopoutsByScreen[screenName] = null;
currentPopoutTriggers[screenName] = null;
} else {
// Signal the active popout to fade in-place when morphed
if (typeof currentPopout.beginSupersededClose === "function")
currentPopout.beginSupersededClose();
_closePopout(currentPopout);
}
}
+47 -4
View File
@@ -291,6 +291,8 @@ Singleton {
onFrameLauncherEmergeSideChanged: saveSettings()
property bool frameLauncherArcExtender: false
onFrameLauncherArcExtenderChanged: saveSettings()
property bool frameLauncherEdgeHover: false
onFrameLauncherEdgeHoverChanged: saveSettings()
readonly property string frameModalEmergeSide: frameLauncherEmergeSide === "top" ? "bottom" : "top"
property string frameMode: "connected"
onFrameModeChanged: saveSettings()
@@ -603,9 +605,9 @@ Singleton {
if (!on && id !== "settings" && current.filter(t => t.enabled && t.id !== "settings").length <= 1)
return;
dashTabs = current.map(t => t.id === id ? {
"id": t.id,
"enabled": on
} : t);
"id": t.id,
"enabled": on
} : t);
}
function resetDashTabs() {
@@ -1000,7 +1002,8 @@ Singleton {
"shadowColorMode": "default",
"shadowCustomColor": "#000000",
"clickThrough": false,
"hoverPopouts": false
"hoverPopouts": false,
"hoverPopoutDelay": 150
}
]
@@ -2437,6 +2440,46 @@ Singleton {
return barConfigs.filter(cfg => cfg.enabled);
}
function _sideToPosition(side) {
switch (side) {
case "top":
return SettingsData.Position.Top;
case "bottom":
return SettingsData.Position.Bottom;
case "left":
return SettingsData.Position.Left;
case "right":
return SettingsData.Position.Right;
}
return -1;
}
// Check if a bar occupies the specified screen edge
function barOccupiesSide(screen, side) {
if (!screen)
return false;
const sidePos = _sideToPosition(side);
if (sidePos < 0)
return false;
const bars = getEnabledBarConfigs();
for (var i = 0; i < bars.length; i++) {
const bc = bars[i];
if (bc.position !== sidePos)
continue;
const prefs = bc.screenPreferences || ["all"];
if (prefs.includes("all") || isScreenInPreferences(screen, prefs))
return true;
}
return false;
}
// Check if the dock occupies the specified screen edge.
function dockOccupiesSide(side) {
if (!showDock)
return false;
return dockPosition === _sideToPosition(side);
}
function getScreensSortedByPosition() {
const screens = [];
for (var i = 0; i < Quickshell.screens.length; i++) {
@@ -642,6 +642,7 @@ var SPEC = {
frameCloseGaps: { def: true },
frameLauncherEmergeSide: { def: "bottom" },
frameLauncherArcExtender: { def: false },
frameLauncherEdgeHover: { def: false },
frameMode: { def: "connected" },
barInsetPaddingShared: { def: -1 },
barInsetPaddingSyncAll: { def: false },