Centralize menu button coordinate logic and replace popupwindows with dropdownmenu.

This commit is contained in:
Jas Singh
2024-07-14 15:13:09 -07:00
parent 6062164652
commit 7a2fdf8647
21 changed files with 89 additions and 109 deletions

View File

@@ -29,13 +29,18 @@ const moveBoxToCursor = (self, fixed) => {
marginRight = fixed ? marginRight - monWidth / 2 : marginRight - value[0];
let marginLeft = monWidth - currentWidth - marginRight;
if (marginRight < 0) {
marginRight = 13;
marginLeft = monWidth - currentWidth - 13;
} else if (marginRight < 13) {
marginRight = 13;
marginLeft = monWidth - currentWidth - 13;
const minimumMargin = 0;
if (marginRight < minimumMargin) {
marginRight = minimumMargin;
marginLeft = monWidth - currentWidth - minimumMargin;
}
if (marginLeft < minimumMargin) {
marginLeft = minimumMargin;
marginRight = monWidth - currentWidth - minimumMargin;
}
const marginTop = 45;
const marginBottom = monHeight - marginTop;
self.set_margin_left(marginLeft);