Fixed lingering menus when switching screens and fixed hour timer for media menu.
This commit is contained in:
@@ -13,6 +13,13 @@ import { Power } from "./power/index.js";
|
||||
|
||||
import { BarItemBox } from "../shared/barItemBox.js";
|
||||
|
||||
const closeAllMenus = () => {
|
||||
App.closeWindow("bluetoothmenu");
|
||||
App.closeWindow("audiomenu");
|
||||
App.closeWindow("networkmenu");
|
||||
App.closeWindow("mediamenu");
|
||||
}
|
||||
|
||||
// layout of the bar
|
||||
const Left = (monitor, wsMap) => {
|
||||
return Widget.Box({
|
||||
@@ -114,4 +121,4 @@ const BarAlt = (monitor = 0, wsMap) => {
|
||||
});
|
||||
};
|
||||
|
||||
export { Bar, BarAlt };
|
||||
export { Bar, BarAlt, closeAllMenus };
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
const bluetooth = await Service.import('bluetooth')
|
||||
import { closeAllMenus } from "../bar.js";
|
||||
|
||||
const Bluetooth = () => {
|
||||
const btIcon = Widget.Label({
|
||||
@@ -24,6 +25,7 @@ const Bluetooth = () => {
|
||||
|
||||
globalMousePos.value = coords;
|
||||
|
||||
closeAllMenus();
|
||||
App.toggleWindow("bluetoothmenu");
|
||||
},
|
||||
},
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const date = Variable("", {
|
||||
poll: [1000, 'date "+ %a %b %d %I:%M:%S %p"'],
|
||||
poll: [1000, 'date "+ %a %b %d %I:%M:%S %p"'],
|
||||
});
|
||||
|
||||
const Clock = () => {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
const mpris = await Service.import("mpris");
|
||||
import { closeAllMenus } from "../bar.js";
|
||||
|
||||
const Media = () => {
|
||||
const activePlayer = Variable(mpris.players[0]);
|
||||
@@ -96,6 +97,7 @@ const Media = () => {
|
||||
|
||||
globalMousePos.value = coords;
|
||||
|
||||
closeAllMenus();
|
||||
App.toggleWindow("mediamenu");
|
||||
},
|
||||
},
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
const network = await Service.import("network");
|
||||
import { closeAllMenus } from "../bar.js";
|
||||
|
||||
import { globalMousePos } from "../../../globals.js";
|
||||
|
||||
@@ -35,6 +36,7 @@ const Network = () => {
|
||||
|
||||
globalMousePos.value = coords;
|
||||
|
||||
closeAllMenus();
|
||||
App.toggleWindow("networkmenu");
|
||||
},
|
||||
},
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
const audio = await Service.import("audio");
|
||||
import { closeAllMenus } from "../bar.js";
|
||||
|
||||
import { globalMousePos } from "../../../globals.js";
|
||||
|
||||
@@ -47,6 +48,7 @@ const Volume = () => {
|
||||
|
||||
globalMousePos.value = coords;
|
||||
|
||||
closeAllMenus();
|
||||
App.toggleWindow("audiomenu");
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user