summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonny Lamb <jonny.lamb@collabora.co.uk>2014-04-01 12:48:14 +0200
committerJonny Lamb <jonny.lamb@collabora.co.uk>2014-04-01 12:48:14 +0200
commitce66ce9ded16457feb97dcbf6d41246cb441d1e8 (patch)
treef3d652aff9d47a76c74704dc20aa8cddefa5ed08
parent9065b697449351488a624b32d075d5fcefe076ce (diff)
downloadgraynard-ce66ce9ded16457feb97dcbf6d41246cb441d1e8.tar.gz
graynard-ce66ce9ded16457feb97dcbf6d41246cb441d1e8.zip
launcher: change defaults and behaviour of launcher grid sizing
-rw-r--r--shell/launcher.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/shell/launcher.c b/shell/launcher.c
index b13d8a3..12149f0 100644
--- a/shell/launcher.c
+++ b/shell/launcher.c
@@ -407,23 +407,16 @@ maynard_launcher_calculate (MaynardLauncher *self,
* work out where the clock is, then add the clock height */
usable_height = output_height - (((output_height - panel_height) / 2) + MAYNARD_CLOCK_HEIGHT);
- cols = (guint) (usable_width / GRID_ITEM_WIDTH);
- rows = (guint) (usable_height / GRID_ITEM_WIDTH);
+ /* defaults */
+ cols = 7;
+ rows = 3;
- /* we don't want any blank space at the bottom of the grid so make
- * sure it's full and resize if necessary */
- /* TODO: this might not actually be a great idea. */
- if (cols > 0)
- {
- guint num_apps;
-
- num_apps = g_hash_table_size (
- shell_app_system_get_entries (self->priv->app_system));
+ /* if the display is smaller than cols or rows can allow, cut it down. */
+ while (cols > 1 && (cols * GRID_ITEM_WIDTH) > usable_width)
+ cols--;
- /* worst case cols = 1 */
- while ((num_apps % cols) > 0)
- cols--;
- }
+ while (rows > 1 && (rows * GRID_ITEM_WIDTH) > usable_height)
+ rows--;
if (grid_window_width)
*grid_window_width = (cols * GRID_ITEM_WIDTH) + 13; /* add back the 13 for the scrollbar */