Centralize menu button coordinate logic and replace popupwindows with dropdownmenu.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
const mpris = await Service.import("mpris");
|
||||
import { closeAllMenus } from "../index.js";
|
||||
import { openMenu } from "../utils.js";
|
||||
|
||||
const Media = () => {
|
||||
const activePlayer = Variable(mpris.players[0]);
|
||||
@@ -90,14 +90,8 @@ const Media = () => {
|
||||
props: {
|
||||
on_scroll_up: () => mpris.getPlayer("")?.next(),
|
||||
on_scroll_down: () => mpris.getPlayer("")?.previous(),
|
||||
on_primary_click: (_, event) => {
|
||||
const clickPos = event.get_root_coords();
|
||||
const coords = [clickPos[1], clickPos[2]];
|
||||
|
||||
globalMousePos.value = coords;
|
||||
|
||||
closeAllMenus();
|
||||
App.toggleWindow("mediamenu");
|
||||
on_primary_click: (clicked, event) => {
|
||||
openMenu(clicked, event, "mediamenu");
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user