Add option to debug geometry (set env var DEBUG_GEOMETRY) (issue #583)

This commit is contained in:
o9000
2016-06-04 13:53:22 +02:00
parent 95a9e8a82e
commit fc56e48781
12 changed files with 297 additions and 101 deletions

View File

@@ -58,6 +58,7 @@ gboolean battery_found;
void battery_init_fonts();
char *battery_get_tooltip(void *obj);
void battery_dump_geometry(void *obj, int indent);
void default_battery()
{
@@ -382,6 +383,23 @@ void draw_battery(void *obj, cairo_t *c)
g_object_unref(layout);
}
void battery_dump_geometry(void *obj, int indent)
{
Battery *battery = obj;
fprintf(stderr,
"%*sText 1: y = %d, text = %s\n",
indent,
"",
battery->bat1_posy,
buf_bat_percentage);
fprintf(stderr,
"%*sText 2: y = %d, text = %s\n",
indent,
"",
battery->bat2_posy,
buf_bat_time);
}
char *battery_get_tooltip(void *obj)
{
return battery_os_tooltip();