popupMenu: Add a status label and icon to submenu menu items
This will allow us to implement the new submenu designs in the aggregate menu. https://bugzilla.gnome.org/show_bug.cgi?id=704368
This commit is contained in:
parent
3816db03f5
commit
fb0f9cd1a1
@ -1293,14 +1293,23 @@ const PopupSubMenuMenuItem = new Lang.Class({
|
|||||||
Name: 'PopupSubMenuMenuItem',
|
Name: 'PopupSubMenuMenuItem',
|
||||||
Extends: PopupBaseMenuItem,
|
Extends: PopupBaseMenuItem,
|
||||||
|
|
||||||
_init: function(text) {
|
_init: function(text, wantIcon) {
|
||||||
this.parent();
|
this.parent();
|
||||||
|
|
||||||
this.actor.add_style_class_name('popup-submenu-menu-item');
|
this.actor.add_style_class_name('popup-submenu-menu-item');
|
||||||
|
|
||||||
|
if (wantIcon) {
|
||||||
|
this.icon = new St.Icon({ style_class: 'popup-menu-icon' });
|
||||||
|
this.addActor(this.icon, { align: St.Align.MIDDLE });
|
||||||
|
}
|
||||||
|
|
||||||
this.label = new St.Label({ text: text });
|
this.label = new St.Label({ text: text });
|
||||||
this.addActor(this.label);
|
this.addActor(this.label);
|
||||||
this.actor.label_actor = this.label;
|
this.actor.label_actor = this.label;
|
||||||
|
|
||||||
|
this.status = new St.Label({ style_class: 'popup-status-menu-item' });
|
||||||
|
this.addActor(this.status, { align: St.Align.END });
|
||||||
|
|
||||||
this._triangle = new St.Label({ text: '\u25B8' });
|
this._triangle = new St.Label({ text: '\u25B8' });
|
||||||
this.addActor(this._triangle, { align: St.Align.END });
|
this.addActor(this._triangle, { align: St.Align.END });
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user