Port PanelMenu to new class framework

Second patch in the class framework, now it's the turn of
PanelMenu (buttons, menus and status indicators).

https://bugzilla.gnome.org/show_bug.cgi?id=664436
This commit is contained in:
Giovanni Campagna
2011-11-20 15:38:48 +01:00
parent 2b57603271
commit 566bdb50c2
11 changed files with 73 additions and 111 deletions

View File

@ -40,12 +40,9 @@ function _onVertSepRepaint (area)
cr.stroke();
};
function DateMenuButton() {
this._init.apply(this, arguments);
}
DateMenuButton.prototype = {
__proto__: PanelMenu.Button.prototype,
const DateMenuButton = new Lang.Class({
Name: 'DateMenuButton',
Extends: PanelMenu.Button,
_init: function(params) {
params = Params.parse(params, { showEvents: true });
@ -57,7 +54,7 @@ DateMenuButton.prototype = {
let menuAlignment = 0.25;
if (St.Widget.get_default_direction() == St.TextDirection.RTL)
menuAlignment = 1.0 - menuAlignment;
PanelMenu.Button.prototype._init.call(this, menuAlignment);
this.parent(menuAlignment);
this._clock = new St.Label();
this.actor.add_actor(this._clock);
@ -239,4 +236,4 @@ DateMenuButton.prototype = {
}
}
}
};
});