mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-08-01 19:18:28 -04:00
restore overlay option and tweak inset padding behavior
This commit is contained in:
@@ -2735,6 +2735,35 @@ Singleton {
|
|||||||
return edges;
|
return edges;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getOverlayBarEdgesForScreen(screen) {
|
||||||
|
if (!screen)
|
||||||
|
return [];
|
||||||
|
var edges = [];
|
||||||
|
for (var i = 0; i < barConfigs.length; i++) {
|
||||||
|
var bc = barConfigs[i];
|
||||||
|
if (!bc.enabled || !(bc.useOverlayLayer ?? false))
|
||||||
|
continue;
|
||||||
|
var prefs = bc.screenPreferences || ["all"];
|
||||||
|
if (!prefs.includes("all") && !isScreenInPreferences(screen, prefs))
|
||||||
|
continue;
|
||||||
|
switch (bc.position ?? 0) {
|
||||||
|
case SettingsData.Position.Top:
|
||||||
|
edges.push("top");
|
||||||
|
break;
|
||||||
|
case SettingsData.Position.Bottom:
|
||||||
|
edges.push("bottom");
|
||||||
|
break;
|
||||||
|
case SettingsData.Position.Left:
|
||||||
|
edges.push("left");
|
||||||
|
break;
|
||||||
|
case SettingsData.Position.Right:
|
||||||
|
edges.push("right");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return edges;
|
||||||
|
}
|
||||||
|
|
||||||
function frameEdgeInsetForSide(screen, side) {
|
function frameEdgeInsetForSide(screen, side) {
|
||||||
if (!frameEnabled || !screen)
|
if (!frameEnabled || !screen)
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -173,8 +173,9 @@ Item {
|
|||||||
if (base.length === 0 && root.barConfig?.showOnLastDisplay && Quickshell.screens.length === 1)
|
if (base.length === 0 && root.barConfig?.showOnLastDisplay && Quickshell.screens.length === 1)
|
||||||
base = Quickshell.screens;
|
base = Quickshell.screens;
|
||||||
}
|
}
|
||||||
// Connected frame mode renders the bar inside the frame surface; skip the standalone window there.
|
// Connected frame mode renders the bar inside the frame surface; skip the standalone window there
|
||||||
return base.filter(screen => !CompositorService.frameHostsSurfacesForScreen(screen));
|
// unless this bar wants the overlay layer, which the frame surface cannot provide.
|
||||||
|
return base.filter(screen => !CompositorService.frameHostsBarForConfig(screen, root.barConfig));
|
||||||
}
|
}
|
||||||
|
|
||||||
delegate: DankBarWindow {
|
delegate: DankBarWindow {
|
||||||
|
|||||||
@@ -38,8 +38,9 @@ Item {
|
|||||||
readonly property real _barInsetPaddingRaw: SettingsData.barInsetPaddingSyncAll ? SettingsData.barInsetPaddingShared : (barConfig?.barInsetPadding ?? -1)
|
readonly property real _barInsetPaddingRaw: SettingsData.barInsetPaddingSyncAll ? SettingsData.barInsetPaddingShared : (barConfig?.barInsetPadding ?? -1)
|
||||||
readonly property real _barInsetPaddingAuto: _barIsVertical ? Theme.spacingXS : _edgeBaseMargin
|
readonly property real _barInsetPaddingAuto: _barIsVertical ? Theme.spacingXS : _edgeBaseMargin
|
||||||
readonly property real _barInsetPadding: _barInsetPaddingRaw < 0 ? _barInsetPaddingAuto : _barInsetPaddingRaw
|
readonly property real _barInsetPadding: _barInsetPaddingRaw < 0 ? _barInsetPaddingAuto : _barInsetPaddingRaw
|
||||||
// Connected-frame Bar Inset Padding: absolute free-end inset (auto < 0 = frameThickness, 0 = edge-to-edge).
|
// Connected-frame Bar Inset Padding: absolute free-end gap the hosted bar spans full-width into
|
||||||
// FrameExclusions already moves a free bar end inward by frameThickness so use frame inset to mangage the gap
|
// (auto < 0 = frameThickness so widgets align with the interior cutout, 0 = edge-to-edge). The extra
|
||||||
|
// beyond frameThickness is what an adjacent bar end adds on top of its corner alignment.
|
||||||
readonly property real _frameInsetResolved: SettingsData.frameBarInsetPadding < 0 ? SettingsData.frameThickness : SettingsData.frameBarInsetPadding
|
readonly property real _frameInsetResolved: SettingsData.frameBarInsetPadding < 0 ? SettingsData.frameThickness : SettingsData.frameBarInsetPadding
|
||||||
readonly property real _frameInsetExtra: Math.max(0, _frameInsetResolved - SettingsData.frameThickness)
|
readonly property real _frameInsetExtra: Math.max(0, _frameInsetResolved - SettingsData.frameThickness)
|
||||||
|
|
||||||
@@ -53,28 +54,28 @@ Item {
|
|||||||
if (_barIsVertical)
|
if (_barIsVertical)
|
||||||
return _edgeBaseMargin;
|
return _edgeBaseMargin;
|
||||||
if (_usesFrameBarChrome)
|
if (_usesFrameBarChrome)
|
||||||
return hasAdjacentLeftBarLive ? _cornerAlignInset : _frameInsetExtra;
|
return hasAdjacentLeftBarLive ? _cornerAlignInset : _frameInsetResolved;
|
||||||
return Math.max(0, _barInsetPadding);
|
return Math.max(0, _barInsetPadding);
|
||||||
}
|
}
|
||||||
readonly property real _rightMargin: {
|
readonly property real _rightMargin: {
|
||||||
if (_barIsVertical)
|
if (_barIsVertical)
|
||||||
return _edgeBaseMargin;
|
return _edgeBaseMargin;
|
||||||
if (_usesFrameBarChrome)
|
if (_usesFrameBarChrome)
|
||||||
return hasAdjacentRightBarLive ? _cornerAlignInset : _frameInsetExtra;
|
return hasAdjacentRightBarLive ? _cornerAlignInset : _frameInsetResolved;
|
||||||
return Math.max(0, _barInsetPadding);
|
return Math.max(0, _barInsetPadding);
|
||||||
}
|
}
|
||||||
readonly property real _topMargin: {
|
readonly property real _topMargin: {
|
||||||
if (!_barIsVertical)
|
if (!_barIsVertical)
|
||||||
return 0;
|
return 0;
|
||||||
if (_usesFrameBarChrome)
|
if (_usesFrameBarChrome)
|
||||||
return hasAdjacentTopBarLive ? (_edgeBaseMargin + SettingsData.frameBarSize + _frameInsetExtra) : _frameInsetExtra;
|
return hasAdjacentTopBarLive ? (_edgeBaseMargin + SettingsData.frameBarSize + _frameInsetExtra) : _frameInsetResolved;
|
||||||
return Math.max(0, _barInsetPadding);
|
return Math.max(0, _barInsetPadding);
|
||||||
}
|
}
|
||||||
readonly property real _bottomMargin: {
|
readonly property real _bottomMargin: {
|
||||||
if (!_barIsVertical)
|
if (!_barIsVertical)
|
||||||
return 0;
|
return 0;
|
||||||
if (_usesFrameBarChrome)
|
if (_usesFrameBarChrome)
|
||||||
return hasAdjacentBottomBarLive ? (_edgeBaseMargin + SettingsData.frameBarSize + _frameInsetExtra) : _frameInsetExtra;
|
return hasAdjacentBottomBarLive ? (_edgeBaseMargin + SettingsData.frameBarSize + _frameInsetExtra) : _frameInsetResolved;
|
||||||
return Math.max(0, _barInsetPadding);
|
return Math.max(0, _barInsetPadding);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -930,7 +930,8 @@ Item {
|
|||||||
if (_barHovered)
|
if (_barHovered)
|
||||||
return;
|
return;
|
||||||
const excludedBar = _barExitPending ? barWindow : null;
|
const excludedBar = _barExitPending ? barWindow : null;
|
||||||
if (cursorOverHoverChain(gx, gy, excludedBar))
|
const staleOverExitedBar = excludedBar?.containsGlobalPoint?.(gx, gy, 0) ?? false;
|
||||||
|
if (!staleOverExitedBar && cursorOverHoverChain(gx, gy, excludedBar))
|
||||||
return;
|
return;
|
||||||
_barExitPending = false;
|
_barExitPending = false;
|
||||||
closeHoverSurfaces();
|
closeHoverSurfaces();
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import qs.Widgets
|
|||||||
Variants {
|
Variants {
|
||||||
id: dockVariants
|
id: dockVariants
|
||||||
// Connected frame mode renders the dock inside the frame surface; skip the standalone window there.
|
// Connected frame mode renders the dock inside the frame surface; skip the standalone window there.
|
||||||
model: SettingsData.getFilteredScreens("dock").filter(screen => !CompositorService.frameHostsSurfacesForScreen(screen))
|
model: SettingsData.getFilteredScreens("dock").filter(screen => !CompositorService.frameHostsDockForScreen(screen))
|
||||||
|
|
||||||
property var contextMenu
|
property var contextMenu
|
||||||
property var trashContextMenu
|
property var trashContextMenu
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ Item {
|
|||||||
const configs = SettingsData.barConfigs || [];
|
const configs = SettingsData.barConfigs || [];
|
||||||
for (let i = 0; i < configs.length; i++) {
|
for (let i = 0; i < configs.length; i++) {
|
||||||
const bc = configs[i];
|
const bc = configs[i];
|
||||||
if (!bc.enabled)
|
if (!bc.enabled || (bc.useOverlayLayer ?? false))
|
||||||
continue;
|
continue;
|
||||||
const prefs = bc.screenPreferences || ["all"];
|
const prefs = bc.screenPreferences || ["all"];
|
||||||
if (!prefs.includes("all") && !SettingsData.isScreenInPreferences(host.targetScreen, prefs))
|
if (!prefs.includes("all") && !SettingsData.isScreenInPreferences(host.targetScreen, prefs))
|
||||||
|
|||||||
@@ -16,6 +16,12 @@ Scope {
|
|||||||
return SettingsData.getActiveBarEdgesForScreen(screen);
|
return SettingsData.getActiveBarEdgesForScreen(screen);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Overlay-layer bars stay standalone even in connected mode and reserve their own edge.
|
||||||
|
readonly property var overlayBarEdges: {
|
||||||
|
SettingsData.barConfigs;
|
||||||
|
return SettingsData.getOverlayBarEdgesForScreen(root.screen);
|
||||||
|
}
|
||||||
|
|
||||||
// One thin invisible PanelWindow per edge. A standalone bar reserves its own edge, so
|
// One thin invisible PanelWindow per edge. A standalone bar reserves its own edge, so
|
||||||
// that edge is skipped — unless the frame hosts the bar (connected mode), where no bar
|
// that edge is skipped — unless the frame hosts the bar (connected mode), where no bar
|
||||||
// window exists and the exclusion must reserve the full bar thickness itself.
|
// window exists and the exclusion must reserve the full bar thickness itself.
|
||||||
@@ -23,13 +29,17 @@ Scope {
|
|||||||
readonly property bool screenEnabled: CompositorService.frameWindowVisibleForScreen(root.screen)
|
readonly property bool screenEnabled: CompositorService.frameWindowVisibleForScreen(root.screen)
|
||||||
readonly property bool hostsBar: CompositorService.frameHostsSurfacesForScreen(root.screen)
|
readonly property bool hostsBar: CompositorService.frameHostsSurfacesForScreen(root.screen)
|
||||||
|
|
||||||
|
function hostsBandForEdge(edge) {
|
||||||
|
return root.hostsBar && !root.overlayBarEdges.includes(edge);
|
||||||
|
}
|
||||||
|
|
||||||
function exclusionSizeForEdge(edge) {
|
function exclusionSizeForEdge(edge) {
|
||||||
return root.barEdges.includes(edge) ? SettingsData.frameBarSize : SettingsData.frameThickness;
|
return root.barEdges.includes(edge) ? SettingsData.frameBarSize : SettingsData.frameThickness;
|
||||||
}
|
}
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
readonly property bool isBarEdge: root.barEdges.includes("top")
|
readonly property bool isBarEdge: root.barEdges.includes("top")
|
||||||
active: root.screenEnabled && (!isBarEdge || root.hostsBar)
|
active: root.screenEnabled && (!isBarEdge || root.hostsBandForEdge("top"))
|
||||||
sourceComponent: EdgeExclusion {
|
sourceComponent: EdgeExclusion {
|
||||||
targetScreen: root.screen
|
targetScreen: root.screen
|
||||||
exclusionSize: root.exclusionSizeForEdge("top")
|
exclusionSize: root.exclusionSizeForEdge("top")
|
||||||
@@ -41,7 +51,7 @@ Scope {
|
|||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
readonly property bool isBarEdge: root.barEdges.includes("bottom")
|
readonly property bool isBarEdge: root.barEdges.includes("bottom")
|
||||||
active: root.screenEnabled && (!isBarEdge || root.hostsBar)
|
active: root.screenEnabled && (!isBarEdge || root.hostsBandForEdge("bottom"))
|
||||||
sourceComponent: EdgeExclusion {
|
sourceComponent: EdgeExclusion {
|
||||||
targetScreen: root.screen
|
targetScreen: root.screen
|
||||||
exclusionSize: root.exclusionSizeForEdge("bottom")
|
exclusionSize: root.exclusionSizeForEdge("bottom")
|
||||||
@@ -53,7 +63,7 @@ Scope {
|
|||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
readonly property bool isBarEdge: root.barEdges.includes("left")
|
readonly property bool isBarEdge: root.barEdges.includes("left")
|
||||||
active: root.screenEnabled && (!isBarEdge || root.hostsBar)
|
active: root.screenEnabled && (!isBarEdge || root.hostsBandForEdge("left"))
|
||||||
sourceComponent: EdgeExclusion {
|
sourceComponent: EdgeExclusion {
|
||||||
targetScreen: root.screen
|
targetScreen: root.screen
|
||||||
exclusionSize: root.exclusionSizeForEdge("left")
|
exclusionSize: root.exclusionSizeForEdge("left")
|
||||||
@@ -65,7 +75,7 @@ Scope {
|
|||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
readonly property bool isBarEdge: root.barEdges.includes("right")
|
readonly property bool isBarEdge: root.barEdges.includes("right")
|
||||||
active: root.screenEnabled && (!isBarEdge || root.hostsBar)
|
active: root.screenEnabled && (!isBarEdge || root.hostsBandForEdge("right"))
|
||||||
sourceComponent: EdgeExclusion {
|
sourceComponent: EdgeExclusion {
|
||||||
targetScreen: root.screen
|
targetScreen: root.screen
|
||||||
exclusionSize: root.exclusionSizeForEdge("right")
|
exclusionSize: root.exclusionSizeForEdge("right")
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ PanelWindow {
|
|||||||
|
|
||||||
readonly property bool _connectedActive: CompositorService.usesConnectedFrameChromeForScreen(win.targetScreen)
|
readonly property bool _connectedActive: CompositorService.usesConnectedFrameChromeForScreen(win.targetScreen)
|
||||||
readonly property bool _dockHostedHere: {
|
readonly property bool _dockHostedHere: {
|
||||||
if (!win._connectedActive || !SettingsData.showDock)
|
if (!win._connectedActive || !SettingsData.showDock || SettingsData.dockUseOverlayLayer)
|
||||||
return false;
|
return false;
|
||||||
const screens = SettingsData.getFilteredScreens("dock");
|
const screens = SettingsData.getFilteredScreens("dock");
|
||||||
for (let i = 0; i < screens.length; i++) {
|
for (let i = 0; i < screens.length; i++) {
|
||||||
|
|||||||
@@ -694,6 +694,16 @@ Singleton {
|
|||||||
return FrameTransitionState.effectiveConnectedFrameModeActive && frameConfiguredForScreen(screenOrName);
|
return FrameTransitionState.effectiveConnectedFrameModeActive && frameConfiguredForScreen(screenOrName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// A surface set to the overlay layer cannot live inside the frame's single top-layer window,
|
||||||
|
// so it stays a standalone window (which resolves itself onto the overlay layer) even in connected mode.
|
||||||
|
function frameHostsBarForConfig(screenOrName, barConfig) {
|
||||||
|
return frameHostsSurfacesForScreen(screenOrName) && !(barConfig?.useOverlayLayer ?? false);
|
||||||
|
}
|
||||||
|
|
||||||
|
function frameHostsDockForScreen(screenOrName) {
|
||||||
|
return frameHostsSurfacesForScreen(screenOrName) && !SettingsData.dockUseOverlayLayer;
|
||||||
|
}
|
||||||
|
|
||||||
function framePeerSurfacesUseOverlayForScreen(screenOrName) {
|
function framePeerSurfacesUseOverlayForScreen(screenOrName) {
|
||||||
return frameWindowVisibleForScreen(screenOrName);
|
return frameWindowVisibleForScreen(screenOrName);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user