if (battery_state.percentage >= percentage_hide) {
if (panel1[i].battery.area.on_screen == 1) {
panel1[i].battery.area.on_screen = 0;
+ panel1[i].area.resize = 1;
panel_refresh = 1;
}
- continue;
}
else {
if (panel1[i].battery.area.on_screen == 0) {
panel1[i].battery.area.on_screen = 1;
- panel_refresh = 1;
+ panel1[i].area.resize = 1;
}
}
- panel1[i].battery.area.resize = 1;
+ if (panel1[i].battery.area.on_screen == 1) {
+ panel1[i].battery.area.resize = 1;
+ panel_refresh = 1;
+ }
}
}
percentage_width = time_width = 0;
battery->area.redraw = 1;
-
snprintf(buf_bat_percentage, sizeof(buf_bat_percentage), "%d%%", battery_state.percentage);
if(battery_state.state == BATTERY_FULL) {
strcpy(buf_bat_time, "Full");
clock->area._resize = resize_clock;
clock->area.resize = 1;
clock->area.redraw = 1;
- clock->area.on_screen = 1;
+ // check consistency
+ if (time1_format == 0)
+ return;
+ clock->area.on_screen = 1;
strftime(buf_time, sizeof(buf_time), time1_format, clock_gettime_for_tz(time1_timezone));
get_text_size(time1_font_desc, &time_height_ink, &time_height, panel->area.height, buf_time, strlen(buf_time));
if (time2_format) {
}
else {
// panel vertical => fixed width, height, posy and posx
-// clock->area.posy = panel->area.bg->border.width + panel->area.paddingxlr;
-// clock->area.height = (2 * clock->area.paddingxlr) + (time_height + date_height);
clock->area.posx = panel->area.bg->border.width + panel->area.paddingy;
clock->area.width = panel->area.width - (2 * panel->area.bg->border.width) - (2 * panel->area.paddingy);
}
strftime(buf_date, sizeof(buf_date), time2_format, clock_gettime_for_tz(time2_timezone));
// vertical panel doen't adjust width
- if (!panel_horizontal) return ret;
+ if (!panel_horizontal) {
+// clock->area.posy = panel->area.bg->border.width + panel->area.paddingxlr;
+// clock->area.height = (2 * clock->area.paddingxlr) + (time_height + date_height);
+ return ret;
+ }
//printf(" resize_clock\n");
cairo_surface_t *cs;
launcher->area._resize = resize_launcher;
launcher->area.resize = 1;
launcher->area.redraw = 1;
- launcher->area.on_screen = 1;
+ // check consistency
+ if (launcher->list_apps == NULL)
+ return;
+
+ launcher->area.on_screen = 1;
if (panel_horizontal) {
// panel horizonal => fixed height and posy
launcher->area.posy = panel->area.bg->border.width + panel->area.paddingy;
launcher_enabled = 0;
}
+
int resize_launcher(void *obj)
{
Launcher *launcher = obj;
icons_per_row = count / icons_per_column + (count%icons_per_column != 0);
launcher->area.width = (2 * launcher->area.bg->border.width) + (2 * launcher->area.paddingxlr) + (icon_size * icons_per_row) + ((icons_per_row-1) * launcher->area.paddingx);
}
-
-// launcher->area.posx = panel->area.bg->border.width + panel->area.paddingxlr;
- launcher->area.posy = panel->area.bg->border.width;
}
else {
if (!count) launcher->area.height = 0;
icons_per_column = count / icons_per_row+ (count%icons_per_row != 0);
launcher->area.height = (2 * launcher->area.bg->border.width) + (2 * launcher->area.paddingxlr) + (icon_size * icons_per_column) + ((icons_per_column-1) * launcher->area.paddingx);
}
-
- launcher->area.posx = panel->area.bg->border.width;
-// launcher->area.posy = panel->area.height - panel->area.bg->border.width - panel->area.paddingxlr - launcher->area.height;
}
int i, posx, posy;
* 'panel_items = SC' define a panel with just Systray and Clock.
* So the tree 'Panel.Area' will have 2 childs (Systray and Clock).
*
- * 1) ok
- * 2) ??
- * 3) ??
- * répartition entre niveau global et niveau local ??
- * size_by_content peut-il modifier redraw=1 en cas de changement ? ou est ce géré par chaque composant ?
- * size_by_layout peut-il modifier redraw ?
- *
************************************************************/
void rendering(void *obj)