Fix indentation issues in altTab.js, plus minor cleanup in some other files.
This commit is contained in:
parent
c4b4248707
commit
be95ca553a
@ -36,9 +36,9 @@ function AltTabPopup() {
|
|||||||
|
|
||||||
AltTabPopup.prototype = {
|
AltTabPopup.prototype = {
|
||||||
_init : function() {
|
_init : function() {
|
||||||
let global = Shell.Global.get();
|
let global = Shell.Global.get();
|
||||||
|
|
||||||
this.actor = new Big.Box({ background_color : POPUP_BG_COLOR,
|
this.actor = new Big.Box({ background_color : POPUP_BG_COLOR,
|
||||||
corner_radius: POPUP_GRID_SPACING,
|
corner_radius: POPUP_GRID_SPACING,
|
||||||
padding: POPUP_GRID_SPACING,
|
padding: POPUP_GRID_SPACING,
|
||||||
spacing: POPUP_GRID_SPACING,
|
spacing: POPUP_GRID_SPACING,
|
||||||
@ -48,15 +48,15 @@ AltTabPopup.prototype = {
|
|||||||
// but Tidy.Grid is lame in various ways. (Eg, it seems to
|
// but Tidy.Grid is lame in various ways. (Eg, it seems to
|
||||||
// have a minimum size of 200x200.) So we create a vertical
|
// have a minimum size of 200x200.) So we create a vertical
|
||||||
// Big.Box containing multiple horizontal Big.Boxes.
|
// Big.Box containing multiple horizontal Big.Boxes.
|
||||||
this._grid = new Big.Box({ spacing: POPUP_GRID_SPACING,
|
this._grid = new Big.Box({ spacing: POPUP_GRID_SPACING,
|
||||||
orientation: Big.BoxOrientation.VERTICAL });
|
orientation: Big.BoxOrientation.VERTICAL });
|
||||||
let gcenterbox = new Big.Box({ orientation: Big.BoxOrientation.HORIZONTAL,
|
let gcenterbox = new Big.Box({ orientation: Big.BoxOrientation.HORIZONTAL,
|
||||||
x_align: Big.BoxAlignment.CENTER });
|
x_align: Big.BoxAlignment.CENTER });
|
||||||
gcenterbox.append(this._grid, Big.BoxPackFlags.NONE);
|
gcenterbox.append(this._grid, Big.BoxPackFlags.NONE);
|
||||||
this.actor.append(gcenterbox, Big.BoxPackFlags.NONE);
|
this.actor.append(gcenterbox, Big.BoxPackFlags.NONE);
|
||||||
|
|
||||||
// Selected-window label
|
// Selected-window label
|
||||||
this._label = new Clutter.Text({ font_name: "Sans 16px",
|
this._label = new Clutter.Text({ font_name: "Sans 16px",
|
||||||
ellipsize: Pango.EllipsizeMode.END });
|
ellipsize: Pango.EllipsizeMode.END });
|
||||||
|
|
||||||
let labelbox = new Big.Box({ background_color: POPUP_INDICATOR_COLOR,
|
let labelbox = new Big.Box({ background_color: POPUP_INDICATOR_COLOR,
|
||||||
@ -67,7 +67,7 @@ AltTabPopup.prototype = {
|
|||||||
x_align: Big.BoxAlignment.CENTER,
|
x_align: Big.BoxAlignment.CENTER,
|
||||||
width: POPUP_LABEL_MAX_WIDTH + POPUP_GRID_SPACING });
|
width: POPUP_LABEL_MAX_WIDTH + POPUP_GRID_SPACING });
|
||||||
lcenterbox.append(labelbox, Big.BoxPackFlags.NONE);
|
lcenterbox.append(labelbox, Big.BoxPackFlags.NONE);
|
||||||
this.actor.append(lcenterbox, Big.BoxPackFlags.NONE);
|
this.actor.append(lcenterbox, Big.BoxPackFlags.NONE);
|
||||||
|
|
||||||
// Indicator around selected icon
|
// Indicator around selected icon
|
||||||
this._indicator = new Big.Rectangle({ border_width: POPUP_INDICATOR_WIDTH,
|
this._indicator = new Big.Rectangle({ border_width: POPUP_INDICATOR_WIDTH,
|
||||||
@ -76,10 +76,10 @@ AltTabPopup.prototype = {
|
|||||||
color: POPUP_TRANSPARENT });
|
color: POPUP_TRANSPARENT });
|
||||||
this.actor.append(this._indicator, Big.BoxPackFlags.FIXED);
|
this.actor.append(this._indicator, Big.BoxPackFlags.FIXED);
|
||||||
|
|
||||||
this._items = [];
|
this._items = [];
|
||||||
this._toplevels = global.window_group.get_children();
|
this._toplevels = global.window_group.get_children();
|
||||||
|
|
||||||
global.stage.add_actor(this.actor);
|
global.stage.add_actor(this.actor);
|
||||||
|
|
||||||
// Dark translucent window used to cover all but the
|
// Dark translucent window used to cover all but the
|
||||||
// currently-selected window while Alt-Tabbing. Actually
|
// currently-selected window while Alt-Tabbing. Actually
|
||||||
@ -142,7 +142,7 @@ AltTabPopup.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
show : function(initialSelection) {
|
show : function(initialSelection) {
|
||||||
let global = Shell.Global.get();
|
let global = Shell.Global.get();
|
||||||
|
|
||||||
Main.startModal();
|
Main.startModal();
|
||||||
|
|
||||||
@ -154,7 +154,7 @@ AltTabPopup.prototype = {
|
|||||||
time: SHOW_TIME,
|
time: SHOW_TIME,
|
||||||
transition: "easeOutQuad" });
|
transition: "easeOutQuad" });
|
||||||
|
|
||||||
this.actor.show_all();
|
this.actor.show_all();
|
||||||
this.actor.x = Math.floor((global.screen_width - this.actor.width) / 2);
|
this.actor.x = Math.floor((global.screen_width - this.actor.width) / 2);
|
||||||
this.actor.y = Math.floor((global.screen_height - this.actor.height) / 2);
|
this.actor.y = Math.floor((global.screen_height - this.actor.height) / 2);
|
||||||
|
|
||||||
@ -162,7 +162,7 @@ AltTabPopup.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
destroy : function() {
|
destroy : function() {
|
||||||
this.actor.destroy();
|
this.actor.destroy();
|
||||||
this._overlay.destroy();
|
this._overlay.destroy();
|
||||||
|
|
||||||
Main.endModal();
|
Main.endModal();
|
||||||
@ -240,7 +240,7 @@ AltTabPopup.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
_adjust_overlay : function() {
|
_adjust_overlay : function() {
|
||||||
let global = Shell.Global.get();
|
let global = Shell.Global.get();
|
||||||
|
|
||||||
if (this._selected && this._selected.icon_rect) {
|
if (this._selected && this._selected.icon_rect) {
|
||||||
// We want to highlight a specific rectangle within the
|
// We want to highlight a specific rectangle within the
|
||||||
|
@ -424,7 +424,7 @@ AppDisplay.prototype = {
|
|||||||
if (category.indexOf(search) >= 0)
|
if (category.indexOf(search) >= 0)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -131,7 +131,6 @@ DocDisplay.prototype = {
|
|||||||
|
|
||||||
// Gets the list of recent items from the recent items manager.
|
// Gets the list of recent items from the recent items manager.
|
||||||
_refreshCache : function() {
|
_refreshCache : function() {
|
||||||
let me = this;
|
|
||||||
if (!this._docsStale)
|
if (!this._docsStale)
|
||||||
return;
|
return;
|
||||||
this._allItems = this._docManager.getItems();
|
this._allItems = this._docManager.getItems();
|
||||||
|
@ -233,13 +233,13 @@ GenericDisplayItem.prototype = {
|
|||||||
return details;
|
return details;
|
||||||
},
|
},
|
||||||
|
|
||||||
// Destoys the item.
|
// Destroys the item.
|
||||||
destroy: function() {
|
destroy: function() {
|
||||||
this.actor.destroy();
|
this.actor.destroy();
|
||||||
},
|
},
|
||||||
|
|
||||||
//// Pure virtual public methods ////
|
//// Pure virtual public methods ////
|
||||||
|
|
||||||
// Performes an action associated with launching this item, such as opening a file or an application.
|
// Performes an action associated with launching this item, such as opening a file or an application.
|
||||||
launch: function() {
|
launch: function() {
|
||||||
throw new Error("Not implemented");
|
throw new Error("Not implemented");
|
||||||
|
@ -10,7 +10,6 @@ const Pango = imports.gi.Pango;
|
|||||||
const Shell = imports.gi.Shell;
|
const Shell = imports.gi.Shell;
|
||||||
const Signals = imports.signals;
|
const Signals = imports.signals;
|
||||||
|
|
||||||
const DocDisplay = imports.ui.docDisplay;
|
|
||||||
const DocInfo = imports.misc.docInfo;
|
const DocInfo = imports.misc.docInfo;
|
||||||
|
|
||||||
const COLLAPSED_WIDTH = 24;
|
const COLLAPSED_WIDTH = 24;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user