Commit ce66ce9d authored by Jonny Lamb's avatar Jonny Lamb
Browse files

launcher: change defaults and behaviour of launcher grid sizing

parent 9065b697
...@@ -407,23 +407,16 @@ maynard_launcher_calculate (MaynardLauncher *self, ...@@ -407,23 +407,16 @@ maynard_launcher_calculate (MaynardLauncher *self,
* work out where the clock is, then add the clock height */ * work out where the clock is, then add the clock height */
usable_height = output_height - (((output_height - panel_height) / 2) + MAYNARD_CLOCK_HEIGHT); usable_height = output_height - (((output_height - panel_height) / 2) + MAYNARD_CLOCK_HEIGHT);
cols = (guint) (usable_width / GRID_ITEM_WIDTH); /* defaults */
rows = (guint) (usable_height / GRID_ITEM_WIDTH); cols = 7;
rows = 3;
/* we don't want any blank space at the bottom of the grid so make /* if the display is smaller than cols or rows can allow, cut it down. */
* sure it's full and resize if necessary */ while (cols > 1 && (cols * GRID_ITEM_WIDTH) > usable_width)
/* TODO: this might not actually be a great idea. */ cols--;
if (cols > 0)
{
guint num_apps;
num_apps = g_hash_table_size (
shell_app_system_get_entries (self->priv->app_system));
/* worst case cols = 1 */ while (rows > 1 && (rows * GRID_ITEM_WIDTH) > usable_height)
while ((num_apps % cols) > 0) rows--;
cols--;
}
if (grid_window_width) if (grid_window_width)
*grid_window_width = (cols * GRID_ITEM_WIDTH) + 13; /* add back the 13 for the scrollbar */ *grid_window_width = (cols * GRID_ITEM_WIDTH) + 13; /* add back the 13 for the scrollbar */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment