mirror of
https://github.com/edu4rdshl/gnome-shell.git
synced 2026-07-18 07:34:54 +00:00
Merge branch 'quick-toggle-menu-double-click' into 'main'
quick-settings: Handle interrupted menu animations See merge request GNOME/gnome-shell!2481
This commit is contained in:
commit
cd5b57fccf
1 changed files with 8 additions and 2 deletions
|
|
@ -366,6 +366,7 @@ class QuickToggleMenu extends PopupMenu.PopupMenuBase {
|
|||
reactive: true,
|
||||
x_expand: true,
|
||||
y_expand: false,
|
||||
height: 0,
|
||||
constraints,
|
||||
});
|
||||
this.actor._delegate = this;
|
||||
|
|
@ -446,19 +447,24 @@ class QuickToggleMenu extends PopupMenu.PopupMenuBase {
|
|||
this.actor.show();
|
||||
this.isOpen = true;
|
||||
|
||||
const previousHeight = this.actor.height;
|
||||
this.actor.height = -1;
|
||||
const [targetHeight] = this.actor.get_preferred_height(-1);
|
||||
this.actor.height = previousHeight;
|
||||
|
||||
const duration = animate !== PopupAnimation.NONE
|
||||
? POPUP_ANIMATION_TIME / 2
|
||||
: 0;
|
||||
|
||||
this.actor.height = 0;
|
||||
this.box.opacity = 0;
|
||||
this.actor.ease({
|
||||
duration,
|
||||
height: targetHeight,
|
||||
onComplete: () => {
|
||||
// Don't interrupt close if it has started
|
||||
if (!this.isOpen)
|
||||
return;
|
||||
|
||||
this.box.ease({
|
||||
duration,
|
||||
opacity: 255,
|
||||
|
|
@ -478,7 +484,7 @@ class QuickToggleMenu extends PopupMenu.PopupMenuBase {
|
|||
: 0;
|
||||
|
||||
this.box.ease({
|
||||
duration,
|
||||
duration: this.box.opacity > 0 ? duration : 0,
|
||||
opacity: 0,
|
||||
onComplete: () => {
|
||||
this.actor.ease({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue