[gnome-shell/app-picker-refresh: 8/15] appDisplay: Set a maximum column number
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/app-picker-refresh: 8/15] appDisplay: Set a maximum column number
- Date: Tue, 19 Feb 2013 17:10:51 +0000 (UTC)
commit 47871ca64dbc32be08bb288b0f8357ef6b247054
Author: Florian Müllner <fmuellner gnome org>
Date: Fri Feb 15 16:47:39 2013 +0100
appDisplay: Set a maximum column number
In particular on widescreen monitors, the number of items in a row
can be overwhelming, so limit the number of columns and center the
view.
js/ui/appDisplay.js | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index 7a5d63c..5750ac5 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -27,6 +27,7 @@ const Util = imports.misc.util;
const MAX_APPLICATION_WORK_MILLIS = 75;
const MENU_POPUP_TIMEOUT = 600;
const SCROLL_TIME = 0.1;
+const MAX_COLUMNS = 6;
// Recursively load a GMenuTreeDirectory; we could put this in ShellAppSystem too
function _loadCategory(dir, view) {
@@ -53,7 +54,8 @@ const AlphabeticalView = new Lang.Class({
_init: function(params) {
params = Params.parse(params, { scrollable: false });
- this._grid = new IconGrid.IconGrid({ xAlign: St.Align.START });
+ this._grid = new IconGrid.IconGrid({ xAlign: St.Align.MIDDLE,
+ columnLimit: MAX_COLUMNS });
this._appSystem = Shell.AppSystem.get_default();
this._appIcons = {}; // desktop file id
@@ -65,6 +67,7 @@ const AlphabeticalView = new Lang.Class({
this.actor = new St.ScrollView({ x_fill: true,
y_fill: false,
y_align: St.Align.START,
+ x_expand: true,
reactive: params.scrollable,
style_class: 'vfade' });
this.actor.add_actor(box);
@@ -147,7 +150,7 @@ const AppDisplay = new Lang.Class({
x_fill: true, y_fill: true });
this._view = new AlphabeticalView({ scrollable: true });
- box.add(this._view.actor);
+ box.add(this._view.actor, { expand: true });
// We need a dummy actor to catch the keyboard focus if the
// user Ctrl-Alt-Tabs here before the deferred work creates
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]