1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-08-04 12:38:31 -04:00

frame: merge bars with frame window and get things on Top layer by

default
This commit is contained in:
bbedward
2026-07-23 14:10:17 -04:00
parent 5854327c28
commit 8af71036cc
21 changed files with 2608 additions and 2121 deletions
+14 -7
View File
@@ -13,6 +13,9 @@ Item {
signal colorPickerRequested
signal barReady(var barConfig)
Component.onCompleted: BarWidgetService.registerDankBarItem(root.barConfig?.id, root)
Component.onDestruction: BarWidgetService.unregisterDankBarItem(root.barConfig?.id, root)
property alias barVariants: barVariants
property var hyprlandOverviewLoader: null
property bool systemTrayMenuOpen: false
@@ -161,14 +164,18 @@ Item {
id: barVariants
model: {
const prefs = root.barConfig?.screenPreferences || ["all"];
if (prefs.includes("all") || (typeof prefs[0] === "string" && prefs[0] === "all")) {
return Quickshell.screens;
const wantsAll = prefs.includes("all") || (typeof prefs[0] === "string" && prefs[0] === "all");
let base;
if (wantsAll) {
base = Quickshell.screens;
} else {
base = Quickshell.screens.filter(screen => SettingsData.isScreenInPreferences(screen, prefs));
if (base.length === 0 && root.barConfig?.showOnLastDisplay && Quickshell.screens.length === 1)
base = Quickshell.screens;
}
const filtered = Quickshell.screens.filter(screen => SettingsData.isScreenInPreferences(screen, prefs));
if (filtered.length === 0 && root.barConfig?.showOnLastDisplay && Quickshell.screens.length === 1) {
return Quickshell.screens;
}
return filtered;
// Connected frame mode renders the bar inside the frame surface; skip the standalone window there
// unless this bar wants the overlay layer, which the frame surface cannot provide.
return base.filter(screen => !CompositorService.frameHostsBarForConfig(screen, root.barConfig));
}
delegate: DankBarWindow {
File diff suppressed because it is too large Load Diff
+17 -6
View File
@@ -38,37 +38,44 @@ Item {
readonly property real _barInsetPaddingRaw: SettingsData.barInsetPaddingSyncAll ? SettingsData.barInsetPaddingShared : (barConfig?.barInsetPadding ?? -1)
readonly property real _barInsetPaddingAuto: _barIsVertical ? Theme.spacingXS : _edgeBaseMargin
readonly property real _barInsetPadding: _barInsetPaddingRaw < 0 ? _barInsetPaddingAuto : _barInsetPaddingRaw
// Connected-frame Bar Inset Padding: absolute free-end inset (auto < 0 = frameThickness, 0 = edge-to-edge).
// FrameExclusions already moves a free bar end inward by frameThickness so use frame inset to mangage the gap
// Connected-frame Bar Inset Padding: absolute free-end gap the hosted bar spans full-width into
// (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 _frameInsetExtra: Math.max(0, _frameInsetResolved - SettingsData.frameThickness)
// Horizontal bars span the full width and own the corners; the perpendicular vertical bar
// tucks in below/above. Where they meet, inset the corner widget so it centres in the
// frameBarSize corner cell, aligning it with the vertical bar's widget column.
readonly property real _widgetThicknessValue: _hasBarWindow ? barWindow.widgetThickness : 30
readonly property real _cornerAlignInset: Math.max(_frameInsetExtra, (SettingsData.frameBarSize - _widgetThicknessValue) / 2)
readonly property real _leftMargin: {
if (_barIsVertical)
return _edgeBaseMargin;
if (_usesFrameBarChrome)
return hasAdjacentLeftBarLive ? (_edgeBaseMargin + SettingsData.frameBarSize + _frameInsetExtra) : _frameInsetExtra;
return hasAdjacentLeftBarLive ? _cornerAlignInset : _frameInsetResolved;
return Math.max(0, _barInsetPadding);
}
readonly property real _rightMargin: {
if (_barIsVertical)
return _edgeBaseMargin;
if (_usesFrameBarChrome)
return hasAdjacentRightBarLive ? (_edgeBaseMargin + SettingsData.frameBarSize + _frameInsetExtra) : _frameInsetExtra;
return hasAdjacentRightBarLive ? _cornerAlignInset : _frameInsetResolved;
return Math.max(0, _barInsetPadding);
}
readonly property real _topMargin: {
if (!_barIsVertical)
return 0;
if (_usesFrameBarChrome)
return hasAdjacentTopBarLive ? (outlineThickness + SettingsData.frameThickness + _frameInsetExtra) : _frameInsetExtra;
return hasAdjacentTopBarLive ? (_edgeBaseMargin + SettingsData.frameBarSize + _frameInsetExtra) : _frameInsetResolved;
return Math.max(0, _barInsetPadding);
}
readonly property real _bottomMargin: {
if (!_barIsVertical)
return 0;
if (_usesFrameBarChrome)
return hasAdjacentBottomBarLive ? (outlineThickness + SettingsData.frameThickness + _frameInsetExtra) : _frameInsetExtra;
return hasAdjacentBottomBarLive ? (_edgeBaseMargin + SettingsData.frameBarSize + _frameInsetExtra) : _frameInsetResolved;
return Math.max(0, _barInsetPadding);
}
@@ -677,6 +684,7 @@ Item {
LeftSection {
id: hLeftSection
objectName: "leftSection"
edgeIsScreenEdge: !topBarContent.hasAdjacentLeftBarLive
overrideAxisLayout: true
forceVerticalLayout: false
anchors {
@@ -710,6 +718,7 @@ Item {
RightSection {
id: hRightSection
objectName: "rightSection"
edgeIsScreenEdge: !topBarContent.hasAdjacentRightBarLive
overrideAxisLayout: true
forceVerticalLayout: false
anchors {
@@ -782,6 +791,7 @@ Item {
LeftSection {
id: vLeftSection
objectName: "leftSection"
edgeIsScreenEdge: !topBarContent.hasAdjacentTopBarLive
overrideAxisLayout: true
forceVerticalLayout: true
width: parent.width
@@ -850,6 +860,7 @@ Item {
RightSection {
id: vRightSection
objectName: "rightSection"
edgeIsScreenEdge: !topBarContent.hasAdjacentBottomBarLive
overrideAxisLayout: true
forceVerticalLayout: true
width: parent.width
@@ -930,7 +930,8 @@ Item {
if (_barHovered)
return;
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;
_barExitPending = false;
closeHoverSurfaces();
File diff suppressed because it is too large Load Diff
+5 -2
View File
@@ -17,6 +17,9 @@ Item {
property real sectionAvailablePrimarySize: 0
property bool overrideAxisLayout: false
property bool forceVerticalLayout: false
// False when a perpendicular bar occupies this edge, so the first widget's click area
// doesn't extend past the bar into the neighbour (matters most in the frame surface).
property bool edgeIsScreenEdge: true
readonly property bool isVertical: overrideAxisLayout ? forceVerticalLayout : (axis?.isVertical ?? false)
property alias widgetLayoutLoader: layoutLoader
@@ -68,7 +71,7 @@ Item {
isFirst: index === 0
isLast: index === rowRepeater.count - 1
sectionSpacing: parent.rowSpacing
isLeftBarEdge: true
isLeftBarEdge: root.edgeIsScreenEdge
isRightBarEdge: false
}
}
@@ -115,7 +118,7 @@ Item {
isFirst: index === 0
isLast: index === columnRepeater.count - 1
sectionSpacing: parent.columnSpacing
isTopBarEdge: true
isTopBarEdge: root.edgeIsScreenEdge
isBottomBarEdge: false
}
}
+5 -2
View File
@@ -17,6 +17,9 @@ Item {
property real sectionAvailablePrimarySize: 0
property bool overrideAxisLayout: false
property bool forceVerticalLayout: false
// False when a perpendicular bar occupies this edge, so the last widget's click area
// doesn't extend past the bar into the neighbour (matters most in the frame surface).
property bool edgeIsScreenEdge: true
readonly property bool isVertical: overrideAxisLayout ? forceVerticalLayout : (axis?.isVertical ?? false)
property alias widgetLayoutLoader: layoutLoader
@@ -71,7 +74,7 @@ Item {
isLast: index === rowRepeater.count - 1
sectionSpacing: parent.rowSpacing
isLeftBarEdge: false
isRightBarEdge: true
isRightBarEdge: root.edgeIsScreenEdge
}
}
}
@@ -118,7 +121,7 @@ Item {
isLast: index === columnRepeater.count - 1
sectionSpacing: parent.columnSpacing
isTopBarEdge: false
isBottomBarEdge: true
isBottomBarEdge: root.edgeIsScreenEdge
}
}
}