diff --git a/data/close.png b/data/close.png
new file mode 100644
index 00000000..ba38c3b3
Binary files /dev/null and b/data/close.png differ
diff --git a/data/speeddial-head.html b/data/speeddial-head.html
index 556221eb..58cea24a 100644
--- a/data/speeddial-head.html
+++ b/data/speeddial-head.html
@@ -4,166 +4,81 @@
This file is licensed under the terms of the expat license, see the file EXPAT.
-->
-
{title}
",
- thumb_size + 40, (int)((thumb_size / 1.5) + 43),
- thumb_size, (int)(thumb_size / 1.5),
- thumb_size + 20,
- (int)((thumb_size / 4) + 10), (int)((thumb_size / 4) - 10),
- cols * (thumb_size + 60),
- thumb_size < 160 ? "hidden" : "visible");
+ /* try to guess the best X by X grid size */
+ while ((grid_index * grid_index) < slot_count)
+ grid_index++;
- g_string_append (markup,
- "");
+ /* percent width size of one slot */
+ slot_size = (100 / grid_index);
+ g_string_append_printf (markup,
+ "\n",
+ slot_size + 1, slot_size - 4);
- while (slot <= rows * cols)
+ while (slot <= slot_count)
{
gchar* dial_entry = g_strdup_printf ("Dial %d", slot);
gchar* uri = g_key_file_get_string (key_file, dial_entry, "uri", NULL);
- const gchar* position;
- if (slot < cols)
- position = " top";
- else if (slot == cols)
- position = " top right";
- else if (slot > cols && slot % cols == 0)
- position = " right";
- else
- position = "";
if (uri && *uri && *uri != '#')
{
@@ -3794,13 +3763,13 @@ prepare_speed_dial_html (MidoriView* view)
g_free (thumb_file);
g_string_append_printf (markup,
- "