mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-28 15:32:50 -05:00
fix app drawer context menus
This commit is contained in:
@@ -354,7 +354,6 @@ DankModal {
|
|||||||
|
|
||||||
function show(x, y, app) {
|
function show(x, y, app) {
|
||||||
currentApp = app
|
currentApp = app
|
||||||
|
|
||||||
if (!contextMenu.parent && typeof Overlay !== "undefined" && Overlay.overlay)
|
if (!contextMenu.parent && typeof Overlay !== "undefined" && Overlay.overlay)
|
||||||
contextMenu.parent = Overlay.overlay;
|
contextMenu.parent = Overlay.overlay;
|
||||||
|
|
||||||
@@ -364,7 +363,6 @@ DankModal {
|
|||||||
const screenHeight = Screen.height;
|
const screenHeight = Screen.height;
|
||||||
let finalX = x;
|
let finalX = x;
|
||||||
let finalY = y;
|
let finalY = y;
|
||||||
|
|
||||||
if (x + menuWidth > screenWidth - 20)
|
if (x + menuWidth > screenWidth - 20)
|
||||||
finalX = x - menuWidth;
|
finalX = x - menuWidth;
|
||||||
|
|
||||||
|
|||||||
@@ -87,19 +87,15 @@ PanelWindow {
|
|||||||
readonly property real screenHeight: Screen.height
|
readonly property real screenHeight: Screen.height
|
||||||
readonly property real calculatedX: {
|
readonly property real calculatedX: {
|
||||||
var centerX = appDrawerPopout.triggerX + (appDrawerPopout.triggerWidth / 2) - (popupWidth / 2);
|
var centerX = appDrawerPopout.triggerX + (appDrawerPopout.triggerWidth / 2) - (popupWidth / 2);
|
||||||
|
if (centerX >= Theme.spacingM && centerX + popupWidth <= screenWidth - Theme.spacingM)
|
||||||
if (centerX >= Theme.spacingM && centerX + popupWidth <= screenWidth - Theme.spacingM) {
|
|
||||||
return centerX;
|
return centerX;
|
||||||
}
|
|
||||||
|
if (centerX < Theme.spacingM)
|
||||||
if (centerX < Theme.spacingM) {
|
|
||||||
return Theme.spacingM;
|
return Theme.spacingM;
|
||||||
}
|
|
||||||
|
if (centerX + popupWidth > screenWidth - Theme.spacingM)
|
||||||
if (centerX + popupWidth > screenWidth - Theme.spacingM) {
|
|
||||||
return screenWidth - popupWidth - Theme.spacingM;
|
return screenWidth - popupWidth - Theme.spacingM;
|
||||||
}
|
|
||||||
|
|
||||||
return centerX;
|
return centerX;
|
||||||
}
|
}
|
||||||
readonly property real calculatedY: appDrawerPopout.triggerY
|
readonly property real calculatedY: appDrawerPopout.triggerY
|
||||||
@@ -110,7 +106,6 @@ PanelWindow {
|
|||||||
height: popupHeight
|
height: popupHeight
|
||||||
x: calculatedX
|
x: calculatedX
|
||||||
y: calculatedY
|
y: calculatedY
|
||||||
|
|
||||||
opacity: appDrawerPopout.isVisible ? 1 : 0
|
opacity: appDrawerPopout.isVisible ? 1 : 0
|
||||||
scale: appDrawerPopout.isVisible ? 1 : 0.9
|
scale: appDrawerPopout.isVisible ? 1 : 0.9
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user