~jbicha/ubuntu/oneiric/gnome-shell/oneiric-3.2.2.1

« back to all changes in this revision

Viewing changes to js/ui/popupMenu.js

  • Committer: Bazaar Package Importer
  • Author(s): Michael Terry
  • Date: 2011-07-20 14:46:28 UTC
  • mfrom: (1.1.25 upstream)
  • Revision ID: james.westby@ubuntu.com-20110720144628-ipirjtz8od4uktpg
Tags: 3.1.3-0ubuntu1
* New upstream release
* debian/control.in:
  - Update dependency versions

Show diffs side-by-side

added added

removed removed

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