[gnome-shell] PopupMenu: allow insertion of items at any point
- From: Giovanni Campagna <gcampagna src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] PopupMenu: allow insertion of items at any point
- Date: Tue, 16 Nov 2010 19:43:29 +0000 (UTC)
commit 0c5d87d79b5c9b99a4d263b016498511041301f2
Author: Giovanni Campagna <gcampagna src gnome org>
Date: Tue Nov 16 20:35:51 2010 +0100
PopupMenu: allow insertion of items at any point
Add a "position" argument to addMenuItem, and pass it to the
underlying box layout. If undefined or null, it adds at the end.
js/ui/popupMenu.js | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js
index 7227f90..8f84805 100644
--- a/js/ui/popupMenu.js
+++ b/js/ui/popupMenu.js
@@ -679,8 +679,11 @@ PopupMenu.prototype = {
}));
},
- addMenuItem: function(menuItem) {
- this._box.add(menuItem.actor);
+ addMenuItem: function(menuItem, position) {
+ if (position == undefined)
+ this._box.add(menuItem.actor);
+ else
+ this._box.insert_actor(menuItem.actor, position);
menuItem._activeChangeId = menuItem.connect('active-changed', Lang.bind(this, function (menuItem, active) {
if (active && this._activeMenuItem != menuItem) {
if (this._activeMenuItem)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]