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:
@@ -635,7 +635,7 @@ Item {
|
|||||||
id: systemTrayComponent
|
id: systemTrayComponent
|
||||||
|
|
||||||
SystemTrayBar {
|
SystemTrayBar {
|
||||||
parentWindow: rootWindow
|
parentWindow: barWindow
|
||||||
parentScreen: barWindow.screen
|
parentScreen: barWindow.screen
|
||||||
widgetThickness: barWindow.widgetThickness
|
widgetThickness: barWindow.widgetThickness
|
||||||
isAtBottom: SettingsData.dankBarPosition === SettingsData.Position.Bottom
|
isAtBottom: SettingsData.dankBarPosition === SettingsData.Position.Bottom
|
||||||
@@ -981,7 +981,7 @@ Item {
|
|||||||
section: topBarContent.getWidgetSection(parent) || "right"
|
section: topBarContent.getWidgetSection(parent) || "right"
|
||||||
parentScreen: barWindow.screen
|
parentScreen: barWindow.screen
|
||||||
onColorPickerRequested: {
|
onColorPickerRequested: {
|
||||||
rootWindow.colorPickerRequested()
|
barWindow.colorPickerRequested()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -530,6 +530,7 @@ Item {
|
|||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: menuContainer
|
id: menuContainer
|
||||||
|
objectName: "overflowMenuContainer"
|
||||||
|
|
||||||
readonly property real rawWidth: {
|
readonly property real rawWidth: {
|
||||||
const itemCount = root.hiddenBarItems.length
|
const itemCount = root.hiddenBarItems.length
|
||||||
@@ -724,8 +725,7 @@ Item {
|
|||||||
|
|
||||||
if (!trayItem.hasMenu) return
|
if (!trayItem.hasMenu) return
|
||||||
|
|
||||||
root.menuOpen = false
|
root.showForTrayItem(trayItem, menuContainer, parentScreen, root.isAtBottom, root.isVertical, root.axis)
|
||||||
root.showForTrayItem(trayItem, parent, parentScreen, root.isAtBottom, root.isVertical, root.axis)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -911,10 +911,10 @@ Item {
|
|||||||
|
|
||||||
onVisibleChanged: {
|
onVisibleChanged: {
|
||||||
if (visible) {
|
if (visible) {
|
||||||
|
updatePosition()
|
||||||
root.menuOpen = false
|
root.menuOpen = false
|
||||||
PopoutManager.closeAllPopouts()
|
PopoutManager.closeAllPopouts()
|
||||||
ModalManager.closeAllModalsExcept(null)
|
ModalManager.closeAllModalsExcept(null)
|
||||||
updatePosition()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -954,11 +954,20 @@ Item {
|
|||||||
|
|
||||||
function updatePosition() {
|
function updatePosition() {
|
||||||
const targetItem = (typeof menuRoot !== "undefined" && menuRoot.anchorItem) ? menuRoot.anchorItem : root
|
const targetItem = (typeof menuRoot !== "undefined" && menuRoot.anchorItem) ? menuRoot.anchorItem : root
|
||||||
const globalPos = targetItem.mapToGlobal(0, 0)
|
|
||||||
const screenX = screen.x || 0
|
const isFromOverflowMenu = targetItem.objectName === "overflowMenuContainer"
|
||||||
const screenY = screen.y || 0
|
|
||||||
const relativeX = globalPos.x - screenX
|
let relativeX, relativeY
|
||||||
const relativeY = globalPos.y - screenY
|
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 widgetThickness = Math.max(20, 26 + SettingsData.dankBarInnerPadding * 0.6)
|
||||||
const effectiveBarThickness = Math.max(widgetThickness + SettingsData.dankBarInnerPadding + 4, Theme.barHeight - 4 - (8 - SettingsData.dankBarInnerPadding))
|
const effectiveBarThickness = Math.max(widgetThickness + SettingsData.dankBarInnerPadding + 4, Theme.barHeight - 4 - (8 - SettingsData.dankBarInnerPadding))
|
||||||
|
|||||||
Reference in New Issue
Block a user