~ubuntu-branches/ubuntu/trusty/gnome-shell/trusty-proposed

« back to all changes in this revision

Viewing changes to js/ui/ctrlAltTab.js

Tags: upstream-3.3.90
ImportĀ upstreamĀ versionĀ 3.3.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
    BOTTOM: 2
23
23
};
24
24
 
25
 
function CtrlAltTabManager() {
26
 
    this._init();
27
 
}
 
25
const CtrlAltTabManager = new Lang.Class({
 
26
    Name: 'CtrlAltTabManager',
28
27
 
29
 
CtrlAltTabManager.prototype = {
30
28
    _init: function() {
31
29
        this._items = [];
32
30
        this._focusManager = St.FocusManager.get_for_stage(global.stage);
134
132
                                      }));
135
133
        }
136
134
    }
137
 
};
 
135
});
138
136
 
139
137
function mod(a, b) {
140
138
    return (a + b) % b;
141
139
}
142
140
 
143
 
function CtrlAltTabPopup() {
144
 
    this._init();
145
 
}
 
141
const CtrlAltTabPopup = new Lang.Class({
 
142
    Name: 'CtrlAltTabPopup',
146
143
 
147
 
CtrlAltTabPopup.prototype = {
148
144
    _init : function() {
149
145
        this.actor = new Shell.GenericContainer({ name: 'ctrlAltTabPopup',
150
146
                                                  reactive: true });
187
183
        let [childMinHeight, childNaturalHeight] = this._switcher.actor.get_preferred_height(primary.width - hPadding);
188
184
        let [childMinWidth, childNaturalWidth] = this._switcher.actor.get_preferred_width(childNaturalHeight);
189
185
        childBox.x1 = Math.max(primary.x + leftPadding, primary.x + Math.floor((primary.width - childNaturalWidth) / 2));
190
 
        childBox.x2 = Math.min(primary.width - hPadding, childBox.x1 + childNaturalWidth);
 
186
        childBox.x2 = Math.min(primary.x + primary.width - hPadding, childBox.x1 + childNaturalWidth);
191
187
        childBox.y1 = primary.y + Math.floor((primary.height - childNaturalHeight) / 2);
192
188
        childBox.y2 = childBox.y1 + childNaturalHeight;
193
189
        this._switcher.actor.allocate(childBox, flags);
303
299
        this._selection = num;
304
300
        this._switcher.highlight(num);
305
301
    }
306
 
};
307
 
 
308
 
function CtrlAltTabSwitcher(items) {
309
 
    this._init(items);
310
 
}
311
 
 
312
 
CtrlAltTabSwitcher.prototype = {
313
 
    __proto__ : AltTab.SwitcherList.prototype,
 
302
});
 
303
 
 
304
const CtrlAltTabSwitcher = new Lang.Class({
 
305
    Name: 'CtrlAltTabSwitcher',
 
306
    Extends: AltTab.SwitcherList,
314
307
 
315
308
    _init : function(items) {
316
 
        AltTab.SwitcherList.prototype._init.call(this, true);
 
309
        this.parent(true);
317
310
 
318
311
        for (let i = 0; i < items.length; i++)
319
312
            this._addIcon(items[i]);
336
329
 
337
330
        this.addItem(box, text);
338
331
    }
339
 
};
 
332
});