Center speed dial via percentual margin

This commit is contained in:
Paweł Forysiuk 2011-11-10 22:24:21 +01:00 committed by Christian Dywan
parent 6f6a57a623
commit db51b7d575

View file

@ -3710,6 +3710,12 @@ prepare_speed_dial_html (MidoriView* view)
sokoke_is_app_or_private () ? "" : "</noscript>", sokoke_is_app_or_private () ? "" : "</noscript>",
slot_size + 1, slot_size - 4); slot_size + 1, slot_size - 4);
/* Combined width of slots should always be less than 100%.
* Use half of the remaining percentage as a margin size */
g_string_append_printf (markup,
"<style> body { overflow:hidden } #content { margin-left: %d%%; }</style>",
(100 - ((slot_size - 4) * grid_index)) / 2);
if (katze_object_get_boolean (view->settings, "close-buttons-left")) if (katze_object_get_boolean (view->settings, "close-buttons-left"))
g_string_append_printf (markup, g_string_append_printf (markup,
"<style>.cross { left: -14px }</style>"); "<style>.cross { left: -14px }</style>");