From b74d00abe6f3f9a1484eba3923357d5a6a8c9b7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Forysiuk?= Date: Wed, 4 May 2011 22:45:00 +0200 Subject: [PATCH] Set speed dial size without javascript So the layout is right with and without javascript. And we also hide the Edit and Remove buttons and options appropriately. --- data/speeddial-head.html | 38 -------------------------------------- midori/midori-view.c | 31 ++++++++++++++++++++++++++++--- 2 files changed, 28 insertions(+), 41 deletions(-) diff --git a/data/speeddial-head.html b/data/speeddial-head.html index 0c901bd7..69844115 100644 --- a/data/speeddial-head.html +++ b/data/speeddial-head.html @@ -37,8 +37,6 @@ float: left; border: 1px solid #ccc; position: relative; - width: 200px; - height: 150px; margin: 20px 20px 0px 0px; background-color: #fff; -webkit-border-radius: 10px; @@ -57,7 +55,6 @@ font-size: 50px; font-weight: bold; margin: 0px; - height: 30px; padding: 10px 0px 0px 0px; display: block; } @@ -82,8 +79,6 @@ div.shortcut a { border: 1px solid #ccc; display: block; - width: 160px; - height: 107px; margin: 15px auto 0px; background-color: #fafafa; color: #aaa; @@ -121,7 +116,6 @@ height: 16px; width: 16px; margin-bottom: -17px; - margin-left: 180px; margin-top: 2px; background: url({stock}/1/gtk-close) 98% 70% no-repeat; cursor: pointer; @@ -264,38 +258,6 @@ var setThumbSize = function (size) { - var i; - var rules = document.styleSheets[0].cssRules; - - var width = columns; - var height = Math.round (size / 1.5); - - $('wrap').style.width = (width * (size + 60)) + 'px'; - - for (i = 0; i < rules.length; i++) - { - switch (rules[i].selectorText) - { - case 'div.shortcut a': - rules[i].style.width = size + 'px'; - rules[i].style.height = height + 'px'; - break; - case 'div.shortcut': - rules[i].style.width = (size + 40) + 'px'; - rules[i].style.height = (height + 43) + 'px'; - break; - case '.cross': - rules[i].style.marginLeft = (size + 20) + 'px'; - break; - case 'h1': - rules[i].style.fontSize = (size / 4 + 10) + 'px'; - rules[i].style.height = (size / 4 - 10) + 'px'; - break; - case 'h4 span::before': - rules[i].style.visibility = (size < 160) ? 'hidden' : 'visible'; - break; - } - } console.log ("speed_dial-save-thumbsize " + size); } diff --git a/midori/midori-view.c b/midori/midori-view.c index 789ca10c..96cd4e29 100644 --- a/midori/midori-view.c +++ b/midori/midori-view.c @@ -3953,9 +3953,34 @@ prepare_speed_dial_html (MidoriView* view) g_free (thumb_size_type); g_string_append_printf (markup, - "\n", - cols, rows, thumb_size); + "\n", + cols, rows, thumb_size); + + g_string_append_printf (markup, + "", + 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"); + + if (!katze_object_get_boolean (view->settings, "enable-scripts")) + { + g_string_append (markup, + ""); + } while (slot <= rows * cols) {