appMenu: Do launch animation if supported by source
Likewise any launch actions should animate the corresponding launcher (if the menu is associated with a launcher). Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1948>
This commit is contained in:
parent
b3861ca693
commit
c809a87412
@ -38,6 +38,7 @@ var AppMenu = class AppMenu extends PopupMenu.PopupMenu {
|
|||||||
this.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
|
this.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
|
||||||
|
|
||||||
this._newWindowItem = this.addAction(_('New Window'), () => {
|
this._newWindowItem = this.addAction(_('New Window'), () => {
|
||||||
|
this._animateLaunch();
|
||||||
this._app.open_new_window(-1);
|
this._app.open_new_window(-1);
|
||||||
Main.overview.hide();
|
Main.overview.hide();
|
||||||
});
|
});
|
||||||
@ -79,6 +80,11 @@ var AppMenu = class AppMenu extends PopupMenu.PopupMenu {
|
|||||||
this._detailsItem.visible = sw !== null;
|
this._detailsItem.visible = sw !== null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_animateLaunch() {
|
||||||
|
if (this.sourceActor.animateLaunch)
|
||||||
|
this.sourceActor.animateLaunch();
|
||||||
|
}
|
||||||
|
|
||||||
/** */
|
/** */
|
||||||
destroy() {
|
destroy() {
|
||||||
super.destroy();
|
super.destroy();
|
||||||
@ -126,6 +132,9 @@ var AppMenu = class AppMenu extends PopupMenu.PopupMenu {
|
|||||||
actions.forEach(action => {
|
actions.forEach(action => {
|
||||||
const label = appInfo.get_action_name(action);
|
const label = appInfo.get_action_name(action);
|
||||||
this._actionSection.addAction(label, event => {
|
this._actionSection.addAction(label, event => {
|
||||||
|
if (action === 'new-window')
|
||||||
|
this._animateLaunch();
|
||||||
|
|
||||||
this._app.launch_action(action, event.get_time(), -1);
|
this._app.launch_action(action, event.get_time(), -1);
|
||||||
Main.overview.hide();
|
Main.overview.hide();
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user