]> Dogcows Code - chaz/tint2/commitdiff
*fix* issue 319
authorAndreas Fink <andreas.fink85@googlemail.com>
Sat, 8 Jan 2011 13:56:26 +0000 (13:56 +0000)
committerAndreas Fink <andreas.fink85@googlemail.com>
Sat, 8 Jan 2011 13:56:26 +0000 (13:56 +0000)
src/battery/battery.c
src/clock/clock.c

index faf27e9f5a1596a99ee065aac8650c4c0d452f59..04c993486b8740c7938cbb401ac194a7580f783e 100644 (file)
@@ -460,8 +460,8 @@ int resize_battery(void *obj)
                if (new_size > battery->area.width || new_size < (battery->area.width-2)) {
                        // we try to limit the number of resize
                        battery->area.width =  new_size;
-                       battery->bat1_posy = ((battery->area.height - bat_percentage_height) / 2) - ((bat_time_height_ink + 2) / 2);
-                       battery->bat2_posy = battery->bat1_posy + bat_percentage_height + 2 - (bat_percentage_height - bat_percentage_height_ink)/2 - (bat_time_height - bat_time_height_ink)/2;
+                       battery->bat1_posy = (battery->area.height - bat_percentage_height - bat_time_height)/2;
+                       battery->bat2_posy = battery->bat1_posy + bat_percentage_height;
                        ret = 1;
                }
        }
@@ -469,8 +469,8 @@ int resize_battery(void *obj)
                int new_size = bat_percentage_height + bat_time_height + (2 * (battery->area.paddingxlr + battery->area.bg->border.width));
                if (new_size > battery->area.height || new_size < (battery->area.height-2)) {
                        battery->area.height =  new_size;
-                       battery->bat1_posy = ((battery->area.height - bat_percentage_height) / 2) - ((bat_time_height_ink + 2) / 2);
-                       battery->bat2_posy = battery->bat1_posy + bat_percentage_height + 2 - (bat_percentage_height - bat_percentage_height_ink)/2 - (bat_time_height - bat_time_height_ink)/2;
+                       battery->bat1_posy = (battery->area.height - bat_percentage_height - bat_time_height - 2)/2;
+                       battery->bat2_posy = battery->bat1_posy + bat_percentage_height + 2;
                        ret = 1;
                }
        }
index 38cfcde00a24aed84fad0479ffe90a2f2a688b2f..ec17a9fad6659477022a0ca76412cad02b9af8e0 100644 (file)
@@ -221,8 +221,8 @@ int resize_clock (void *obj)
                        clock->area.width = new_size + 1;
                        clock->time1_posy = (clock->area.height - time_height) / 2;
                        if (time2_format) {
-                               clock->time1_posy -= ((date_height_ink + 2) / 2);
-                               clock->time2_posy = clock->time1_posy + time_height + 2 - (time_height - time_height_ink)/2 - (date_height - date_height_ink)/2;
+                               clock->time1_posy -= (date_height)/2;
+                               clock->time2_posy = clock->time1_posy + time_height;
                        }
                        ret = 1;
                }
@@ -234,8 +234,8 @@ int resize_clock (void *obj)
                        clock->area.height =  new_size;
                        clock->time1_posy = (clock->area.height - time_height) / 2;
                        if (time2_format) {
-                               clock->time1_posy -= ((date_height_ink + 2) / 2);
-                               clock->time2_posy = clock->time1_posy + time_height + 2 - (time_height - time_height_ink)/2 - (date_height - date_height_ink)/2;
+                               clock->time1_posy -= (date_height)/2;
+                               clock->time2_posy = clock->time1_posy + time_height;
                        }
                        ret = 1;
                }
This page took 0.021618 seconds and 4 git commands to generate.