From 242a1baf0b678b59e5e12891b3ea5302216f65ea Mon Sep 17 00:00:00 2001 From: =?utf8?q?Pawe=C5=82=20Forysiuk?= Date: Fri, 3 Aug 2012 21:29:46 +0200 Subject: [PATCH] Use bigger factor for large speed dials Fixes: https://bugs.launchpad.net/midori/+bug/904492 --- midori/midori-view.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/midori/midori-view.c b/midori/midori-view.c index 5b13ff17..6110b116 100644 --- a/midori/midori-view.c +++ b/midori/midori-view.c @@ -4224,6 +4224,7 @@ prepare_speed_dial_html (MidoriView* view, GKeyFile* key_file; GString* markup = NULL; guint slot_count = 1, i, grid_index = 3, slot_size; + guint margin, div_factor; gchar* speed_dial_head; gchar* file_path; gchar** groups; @@ -4278,9 +4279,19 @@ prepare_speed_dial_html (MidoriView* view, /* Combined width of slots should always be less than 100%. * Use half of the remaining percentage as a margin size */ + if (slot_size * grid_index >= 100 && grid_index > 4) + div_factor = 8; + else + div_factor = 2; + + margin = (100 - ((slot_size - 4) * grid_index)) / div_factor; + + if (margin > 9) + margin = margin % 10; + g_string_append_printf (markup, "", - (100 - ((slot_size - 4) * grid_index)) / 2); + margin); if (katze_object_get_boolean (view->settings, "close-buttons-left")) g_string_append_printf (markup, -- 2.39.5