1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-24 21:42:51 -05:00

dankbar: hot fix color moda & systm tray item positions

This commit is contained in:
bbedward
2025-11-18 22:13:06 -05:00
parent 5ddea836a1
commit 99a307e0ad
2 changed files with 19 additions and 10 deletions

View File

@@ -635,7 +635,7 @@ Item {
id: systemTrayComponent
SystemTrayBar {
parentWindow: rootWindow
parentWindow: barWindow
parentScreen: barWindow.screen
widgetThickness: barWindow.widgetThickness
isAtBottom: SettingsData.dankBarPosition === SettingsData.Position.Bottom
@@ -981,7 +981,7 @@ Item {
section: topBarContent.getWidgetSection(parent) || "right"
parentScreen: barWindow.screen
onColorPickerRequested: {
rootWindow.colorPickerRequested()
barWindow.colorPickerRequested()
}
}
}

View File

@@ -530,6 +530,7 @@ Item {
Item {
id: menuContainer
objectName: "overflowMenuContainer"
readonly property real rawWidth: {
const itemCount = root.hiddenBarItems.length
@@ -724,8 +725,7 @@ Item {
if (!trayItem.hasMenu) return
root.menuOpen = false
root.showForTrayItem(trayItem, parent, parentScreen, root.isAtBottom, root.isVertical, root.axis)
root.showForTrayItem(trayItem, menuContainer, parentScreen, root.isAtBottom, root.isVertical, root.axis)
}
}
}
@@ -911,10 +911,10 @@ Item {
onVisibleChanged: {
if (visible) {
updatePosition()
root.menuOpen = false
PopoutManager.closeAllPopouts()
ModalManager.closeAllModalsExcept(null)
updatePosition()
}
}
@@ -954,11 +954,20 @@ Item {
function updatePosition() {
const targetItem = (typeof menuRoot !== "undefined" && menuRoot.anchorItem) ? menuRoot.anchorItem : root
const globalPos = targetItem.mapToGlobal(0, 0)
const screenX = screen.x || 0
const screenY = screen.y || 0
const relativeX = globalPos.x - screenX
const relativeY = globalPos.y - screenY
const isFromOverflowMenu = targetItem.objectName === "overflowMenuContainer"
let relativeX, relativeY
if (isFromOverflowMenu) {
relativeX = targetItem.x
relativeY = targetItem.y
} else {
const globalPos = targetItem.mapToGlobal(0, 0)
const screenX = screen.x || 0
const screenY = screen.y || 0
relativeX = globalPos.x - screenX
relativeY = globalPos.y - screenY
}
const widgetThickness = Math.max(20, 26 + SettingsData.dankBarInnerPadding * 0.6)
const effectiveBarThickness = Math.max(widgetThickness + SettingsData.dankBarInnerPadding + 4, Theme.barHeight - 4 - (8 - SettingsData.dankBarInnerPadding))