Skip to content

Commit 6339267

Browse files
authored
fix: Dock can overlapping right-click menu (#566)
PR-455 and PR-454. Set menu margin according to dock location PMS: BUG-316719
1 parent 51f33fd commit 6339267

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

qml/AppItemMenu.qml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ Loader {
1919
property bool hideFavoriteMenu
2020
property bool hideMoveToTopMenu
2121
property bool hideDisplayScalingMenu
22-
22+
readonly property bool isFullscreen: LauncherController.currentFrame === "FullscreenFrame"
23+
readonly property bool isHorizontalDock: DesktopIntegration.dockPosition === Qt.UpArrow || DesktopIntegration.dockPosition === Qt.DownArrow
24+
readonly property int dockSpacing: (isHorizontalDock ? DesktopIntegration.dockGeometry.height : DesktopIntegration.dockGeometry.width) / Screen.devicePixelRatio
2325
signal closed()
2426

2527
Component {
@@ -28,6 +30,10 @@ Loader {
2830
Menu {
2931
id: contextMenu
3032

33+
topMargin: isFullscreen && DesktopIntegration.dockPosition === Qt.UpArrow ? dockSpacing : 0
34+
bottomMargin: isFullscreen && DesktopIntegration.dockPosition === Qt.DownArrow ? dockSpacing : 0
35+
leftMargin: isFullscreen && DesktopIntegration.dockPosition === Qt.LeftArrow ? dockSpacing : 0
36+
rightMargin: isFullscreen && DesktopIntegration.dockPosition === Qt.RightArrow ? dockSpacing : 0
3137
modal: true
3238

3339
MenuItem {

qml/DummyAppItemMenu.qml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,20 @@ Loader {
1313
id: root
1414

1515
property string desktopId
16-
16+
readonly property bool isFullscreen: LauncherController.currentFrame === "FullscreenFrame"
17+
readonly property bool isHorizontalDock: DesktopIntegration.dockPosition === Qt.UpArrow || DesktopIntegration.dockPosition === Qt.DownArrow
18+
readonly property int dockSpacing: (isHorizontalDock ? DesktopIntegration.dockGeometry.height : DesktopIntegration.dockGeometry.width) / Screen.devicePixelRatio
1719
signal closed()
1820

1921
Component {
2022
id: contextMenuComp
2123

2224
Menu {
2325
id: contextMenu
26+
topMargin: isFullscreen && DesktopIntegration.dockPosition === Qt.UpArrow ? dockSpacing : 0
27+
bottomMargin: isFullscreen && DesktopIntegration.dockPosition === Qt.DownArrow ? dockSpacing : 0
28+
leftMargin: isFullscreen && DesktopIntegration.dockPosition === Qt.LeftArrow ? dockSpacing : 0
29+
rightMargin: isFullscreen && DesktopIntegration.dockPosition === Qt.RightArrow ? dockSpacing : 0
2430
modal: true
2531

2632
MenuItem {

0 commit comments

Comments
 (0)