13
13
const Params = imports.misc.params;
14
14
const Tweener = imports.ui.tweener;
16
const Gettext = imports.gettext.domain('gnome-shell');
17
const _ = Gettext.gettext;
19
16
const SLIDER_SCROLL_STEP = 0.05; /* Slider scrolling step in % */
21
18
function PopupBaseMenuItem(params) {
707
704
this._switch = new Switch(active);
709
706
this.addActor(this.label);
710
this.addActor(this._switch.actor, { align: St.Align.END });
712
this.connect('activate', Lang.bind(this,function(from) {
708
this._statusBin = new St.Bin({ x_align: St.Align.END });
709
this.addActor(this._statusBin, { align: St.Align.END });
711
this._statusLabel = new St.Label({ text: '',
712
style_class: 'popup-inactive-menu-item'
714
this._switch = new Switch(false);
715
this._statusBin.child = this._switch.actor;
718
setStatus: function(text) {
720
this._statusLabel.text = text;
721
this._statusBin.child = this._statusLabel;
722
this.actor.reactive = false;
723
this.actor.can_focus = false;
725
this._statusBin.child = this._switch.actor;
726
this.actor.reactive = true;
727
this.actor.can_focus = true;
731
activate: function(event) {
732
if (this._switch.actor.mapped) {
736
PopupBaseMenuItem.prototype.activate.call(this, event);
717
739
toggle: function() {