]> code.delx.au - comingnext/commitdiff
improved font scaling (resolves text overflow on Symbian Belle devices which use...
authorMichael Prager <mail@michaelprager.de>
Thu, 17 Nov 2011 22:55:40 +0000 (23:55 +0100)
committerMichael Prager <mail@michaelprager.de>
Thu, 17 Nov 2011 22:55:40 +0000 (23:55 +0100)
Readme.txt
comingNext/index.html

index 4d4607e810dfa43867ce495f44c6031980670fbd..5853ea2ea5070fb221650d5afface00398edd6f3 100644 (file)
@@ -286,3 +286,5 @@ Changelog:
 1.34 () by Michael Prager\r
   - fixed 12h time format not being used anymore on Anna devices\r
   - fixed weekday display (for real this time) on Symbian Anna and Belle devices\r
+  - improved font scaling (resolves text overflow on Symbian Belle devices which \r
+    use a different system font)\r
index a5f531dcf03aaa159ce5144626ea35448fc5b640..8241fe9ee7cb92a2fd32494261eff2105e7bc23b 100644 (file)
@@ -719,23 +719,26 @@ function updateData()
                var entryDate = '';\r
                var dateArr = [];\r
                var fontsize = 'normal';\r
+               var lineheight = 'normal';\r
                if (mode == 0) {\r
+                       fontsize = parseInt(72 / config['eventsPerWidget'].Value) + 'px';\r
+                       lineheight = parseInt(82 / config['eventsPerWidget'].Value) + 'px';\r
+                       \r
                        if (config['eventsPerWidget'].Value == 3) {\r
-                               fontsize = '17pt';\r
                                changeCssClass('.icon', 'width:20px; height:20px');\r
                        }\r
                        else if (config['eventsPerWidget'].Value == 5) {\r
-                               fontsize = '10pt';\r
                                changeCssClass('.icon', 'width:10px; height:10px');\r
                        }\r
                        else if (config['eventsPerWidget'].Value == 6) {\r
-                               fontsize = '8pt';\r
                                changeCssClass('.icon', 'width:8px; height:8px');\r
                        }\r
                }\r
                else\r
                        changeCssClass('.icon', config['cssStyle_icon'].Value);\r
-               var entriesHtml = '<table style="font-size:' + fontsize + ';">';\r
+               var entriesHtml = '<table style="font-size:' + fontsize + '; line-height:' + lineheight + ';">';\r
+               if (mode == 0)\r
+                       entriesHtml = '<table width="307" height="82"><tr><td>' + entriesHtml; // this is needed to center the actual content vertically\r
                var eventIds = [];\r
                var max;\r
                if (mode == 0)\r
@@ -917,6 +920,8 @@ function updateData()
                        }\r
                }\r
                entriesHtml += '</table>';\r
+               if (mode == 0)\r
+                       entriesHtml = entriesHtml + '</td></tr></table>';\r
                if (config['showNothingText'].Value && entriesHtml == '<table></table>') {\r
                        var text = config['nothingText'].Value.replace(/%d/, config['monthRange'].Value);\r
                        entriesHtml = '<div style="width:295px; height:75px; text-align:center; line-height:75px; overflow:visible;">' + text + '</div>';\r
@@ -1711,15 +1716,15 @@ function log(message)
 \r
 <style type="text/css">\r
 a { color:#aaccff }\r
-table { margin:0px; padding:0px; border-spacing:0px; }\r
-td { padding:0px 5px 0px 0px; white-space:nowrap; overflow:hidden; }\r
+table { margin:0px; padding:0px; border-spacing:0px; border-collapse: collapse; }\r
+td { padding:0px 5px 0px 0px; white-space:nowrap; overflow:hidden; margin:0px; }\r
 hr { color:#ffffff; background-color:#ffffff; height:1px; text-align:left; border-style:none; }\r
 .settingsInfo { display:none; font-style:italic; }\r
 .title { font-weight:bold; font-size:14pt; }\r
 .textInput { width:90%; }\r
 .credits { margin-left:40px; text-indent: -20px; margin-bottom:0px; }\r
-#homescreenView { width: 315px; height:91px; overflow:hidden; }\r
-#calendarList { position:absolute; left:5px; top:4px; width:295px; height:75px; overflow:hidden; }\r
+#homescreenView { width: 312px; height:82px; overflow:hidden; }\r
+#calendarList { position:absolute; left:5px; top:0px; width:307px; height:82px; overflow:hidden; }\r
 #name { text-align:center; }\r
 #appicon { display: block; margin-left: auto; margin-right: auto; margin-top: 10px; }\r
 #smallappicon { width:22px; height:22px; margin-right:10px; float:left; }\r