From 5eb5663cf66943c3d8400a1423bf4ede95f89eb1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Pawe=C5=82=20Forysiuk?= Date: Mon, 10 Oct 2011 01:38:39 +0200 Subject: [PATCH] Implement embossed speed dial with custom close buttons The close button position is wrong. --- data/close.png | Bin 0 -> 1436 bytes data/speeddial-head.html | 229 +++++++++------------------------------ midori/midori-view.c | 100 ++++++----------- 3 files changed, 83 insertions(+), 246 deletions(-) create mode 100644 data/close.png diff --git a/data/close.png b/data/close.png new file mode 100644 index 0000000000000000000000000000000000000000..ba38c3b3e10aa9ed858efccd14efc1fe0551bf2d GIT binary patch literal 1436 zcmV;N1!MY&P)~2x7$5-yZtL&*ZV-js9th-@A8DE?l@EhYuf?ojZ5Rp+kqHqoYH*y1FD5OYCKN zdHK!Lr%xM!+)TiXp!4U?@6vUBN<`${yLZys+A1!W>!bb1ks~rTHYOq>x~>PWUAtD6 z324PkB|H*r~6S)sGDlZAx^3JVLrd-3AM_rN9+ znW|X{VuAqY{QUf&h{%;ISFCF~c<`Wn`0zpc`}?K5yj)x^mz0;6%fP^Z1OfqRYHG4< zFJ8PTA|jzsXasPYKT04FE zv}L4{M0$F9Eb(wSY>j(* zdZeVJB*lJwd|X6CZr{G$3KS}R%?yMM$Zlw8@BqAe^(rMEhGF3Kdg<%y10X*?AAr8T zKD=HphGC@GoBsRu?W;sp7!zVvi>$f1IUT^^aI8syyu3VIE?3H$+wCSVFK>;l=^qM( z^rS1)l2c6U?(Y5@;J|?cYn**PA5~RV08C9y0Z>_4iO=V=PHHxf#{t(`r4*0S|@JR%~pva%Ak+wC<< zHy5zkNIVllqKN9jU~mket*y=4&A`9_&z?Qw?%lhzx3?3GMrm(v=hm%TJbwI`p`jtm z*7OSogJZg`uP9xUv6_uQh1ctCi^XCw!!YF7v199&sr25`(ju`~Oyco){L-aM9Y6(1 z*=WMDNPG`FfrbYU9(0R{OiWBjeSQ6gKy`I>^7idp5fORx=ur>Qp!8P1v-AoA>@O%N zXbA)Y|A>ezE-uQ|t5?PCc4vgR-EO&j`LaYJ5fKrYo}Qj8Dk}OG*iTvo(L}_ojah(0 z9lLn$Oz-(t*xb^q5^>7;o*T(r%wI$ z`t|E^AOOq)OF&%G-ZC4Bhp!MQ1L}dJH*Vbcd0}B;PS$DRaCrXa&6~dhN0nch(#bJT zmHxz-mER8J1784JfvwxNZ7Vu);>0&~b#-4?R8;ILE-wBu7z_qSM@J_H2M5P}KHr-_ zATSNgs6I#HdC>tw%m-7FeihPy4xj+|4ES6H+QDl1F@Tu5rZ6xMEC3<3mI7J>O9N)9 z;N}8(3baXW#DwX - {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"); - - g_string_append (markup, - ""); - - while (slot <= rows * cols) + /* try to guess the best X by X grid size */ + while ((grid_index * grid_index) < slot_count) + grid_index++; + + /* 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 <= 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, - "
\n" - "
\n" - "\n" - "

" - "‪%s

\n", - position, slot, slot, uri, encoded, slot, title); + "
" + "" + "
%s
\n", + slot, uri, encoded, slot, slot, title); g_free (title); g_free (encoded); @@ -3808,12 +3777,11 @@ prepare_speed_dial_html (MidoriView* view) else { g_string_append_printf (markup, - "\n", - position, slot, slot, slot); + "
" + "
" + "
%s
\n", + slot, slot, _("Click to add a shortcut")); } slot++; @@ -3821,7 +3789,7 @@ prepare_speed_dial_html (MidoriView* view) g_free (uri); } g_string_append_printf (markup, - "\n\n\n\n"); + "\n\n\n"); return g_string_free (markup, FALSE); } -- 2.39.5