Add delay to dashboard shortcuts to wait for menu to close fully.
This commit is contained in:
@@ -44,6 +44,16 @@ const moveBoxToCursor = (self, fixed) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// NOTE: We make the window visible for 2 seconds (on startup) so the child
|
||||||
|
// elements can allocat their proper dimensions.
|
||||||
|
// Otherwise the width that we rely on for menu positioning is set improperly
|
||||||
|
// for the first time we open a menu of each type.
|
||||||
|
const initRender = Variable(true);
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
initRender.value = false;
|
||||||
|
}, 2000);
|
||||||
|
|
||||||
export default ({
|
export default ({
|
||||||
name,
|
name,
|
||||||
child,
|
child,
|
||||||
@@ -57,7 +67,7 @@ export default ({
|
|||||||
name,
|
name,
|
||||||
class_names: [name, "dropdown-menu"],
|
class_names: [name, "dropdown-menu"],
|
||||||
setup: (w) => w.keybind("Escape", () => App.closeWindow(name)),
|
setup: (w) => w.keybind("Escape", () => App.closeWindow(name)),
|
||||||
visible: true,
|
visible: initRender.bind("value"),
|
||||||
keymode: "on-demand",
|
keymode: "on-demand",
|
||||||
exclusivity,
|
exclusivity,
|
||||||
layer: "top",
|
layer: "top",
|
||||||
@@ -67,10 +77,11 @@ export default ({
|
|||||||
on_primary_click: () => App.closeWindow(name),
|
on_primary_click: () => App.closeWindow(name),
|
||||||
on_secondary_click: () => App.closeWindow(name),
|
on_secondary_click: () => App.closeWindow(name),
|
||||||
child: Widget.Box({
|
child: Widget.Box({
|
||||||
|
class_name: "top-eb",
|
||||||
vertical: true,
|
vertical: true,
|
||||||
children: [
|
children: [
|
||||||
Widget.EventBox({
|
Widget.EventBox({
|
||||||
class_name: "event-top-padding",
|
class_name: "mid-eb event-top-padding",
|
||||||
hexpand: true,
|
hexpand: true,
|
||||||
vexpand: false,
|
vexpand: false,
|
||||||
can_focus: false,
|
can_focus: false,
|
||||||
@@ -81,7 +92,7 @@ export default ({
|
|||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
Widget.EventBox({
|
Widget.EventBox({
|
||||||
class_name: "menu-event-box",
|
class_name: "in-eb menu-event-box",
|
||||||
on_primary_click: () => {
|
on_primary_click: () => {
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -15,15 +15,18 @@ const Shortcuts = () => {
|
|||||||
});
|
});
|
||||||
const handleClick = (action, resolver) => {
|
const handleClick = (action, resolver) => {
|
||||||
App.closeWindow("dashboardmenu");
|
App.closeWindow("dashboardmenu");
|
||||||
Utils.execAsync(action)
|
|
||||||
.then((res) => {
|
|
||||||
if (typeof resolver === "function") {
|
|
||||||
return resolver(res);
|
|
||||||
}
|
|
||||||
|
|
||||||
return res;
|
setTimeout(() => {
|
||||||
})
|
Utils.execAsync(action)
|
||||||
.catch((err) => err);
|
.then((res) => {
|
||||||
|
if (typeof resolver === "function") {
|
||||||
|
return resolver(res);
|
||||||
|
}
|
||||||
|
|
||||||
|
return res;
|
||||||
|
})
|
||||||
|
.catch((err) => err);
|
||||||
|
}, 250);
|
||||||
};
|
};
|
||||||
|
|
||||||
const recordingDropdown = Widget.Menu({
|
const recordingDropdown = Widget.Menu({
|
||||||
|
|||||||
@@ -40,3 +40,18 @@
|
|||||||
|
|
||||||
//notifications
|
//notifications
|
||||||
@import "notifications/popups";
|
@import "notifications/popups";
|
||||||
|
|
||||||
|
// Eventbox styling for debugging purposes
|
||||||
|
// .parent-event {
|
||||||
|
// background-color: $red;
|
||||||
|
// }
|
||||||
|
// .mid-eb {
|
||||||
|
// background-color: $red;
|
||||||
|
// }
|
||||||
|
// .in-eb {
|
||||||
|
// background-color: $red;
|
||||||
|
// }
|
||||||
|
// .main-eb {
|
||||||
|
// background-color: $red;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
@import "../colors";
|
@import "../colors";
|
||||||
|
|
||||||
.menu-items-container.media {
|
.menu-items-container.media {
|
||||||
min-width: 25em;
|
min-width: 23em;
|
||||||
min-height: 10em;
|
min-height: 10em;
|
||||||
|
|
||||||
.menu-section-container {
|
.menu-section-container {
|
||||||
|
|||||||
@@ -94,14 +94,14 @@ tooltip label {
|
|||||||
background: $crust;
|
background: $crust;
|
||||||
border: .13em solid $surface0;
|
border: .13em solid $surface0;
|
||||||
border-radius: .7rem;
|
border-radius: .7rem;
|
||||||
min-width: 20em;
|
min-width: 18em;
|
||||||
color: $text;
|
color: $text;
|
||||||
}
|
}
|
||||||
|
|
||||||
.menu-items-container {
|
.menu-items-container {
|
||||||
border-radius: 0.4em;
|
border-radius: 0.4em;
|
||||||
font-size: 1.3em;
|
font-size: 1.3em;
|
||||||
min-width: 20em;
|
min-width: 18em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.menu-section-container {
|
.menu-section-container {
|
||||||
|
|||||||
@@ -512,14 +512,14 @@ tooltip label {
|
|||||||
background: #11111b;
|
background: #11111b;
|
||||||
border: 0.13em solid #313244;
|
border: 0.13em solid #313244;
|
||||||
border-radius: 0.7rem;
|
border-radius: 0.7rem;
|
||||||
min-width: 20em;
|
min-width: 18em;
|
||||||
color: #cdd6f4;
|
color: #cdd6f4;
|
||||||
}
|
}
|
||||||
|
|
||||||
.menu-items-container {
|
.menu-items-container {
|
||||||
border-radius: 0.4em;
|
border-radius: 0.4em;
|
||||||
font-size: 1.3em;
|
font-size: 1.3em;
|
||||||
min-width: 20em;
|
min-width: 18em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.menu-section-container {
|
.menu-section-container {
|
||||||
@@ -1036,7 +1036,7 @@ window#powermenu .powermenu.box {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.menu-items-container.media {
|
.menu-items-container.media {
|
||||||
min-width: 25em;
|
min-width: 23em;
|
||||||
min-height: 10em;
|
min-height: 10em;
|
||||||
}
|
}
|
||||||
.menu-items-container.media .menu-section-container {
|
.menu-items-container.media .menu-section-container {
|
||||||
|
|||||||
Reference in New Issue
Block a user