mirror of
https://github.com/davatorium/rofi.git
synced 2024-11-11 13:50:48 -05:00
Add debug output to themer that indicates unset properties.
This commit is contained in:
parent
44581fd90b
commit
645fe24890
2 changed files with 36 additions and 28 deletions
|
@ -9,6 +9,8 @@
|
|||
#include "widgets/textbox.h"
|
||||
#include "view.h"
|
||||
|
||||
#define LOG_DOMAIN "Theme"
|
||||
|
||||
void yyerror ( YYLTYPE *ylloc, const char *);
|
||||
|
||||
ThemeWidget *rofi_theme_find_or_create_class ( ThemeWidget *base, const char *class )
|
||||
|
@ -296,6 +298,7 @@ int rofi_theme_get_integer ( const char *wclass, const char *name, const char *
|
|||
if ( p ){
|
||||
return p->value.i;
|
||||
}
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Theme entry: #%s %s property %s unset.", name, state?state:"", property );
|
||||
return def;
|
||||
}
|
||||
Distance rofi_theme_get_distance ( const char *wclass, const char *name, const char *state, const char *property, int def )
|
||||
|
@ -310,6 +313,7 @@ Distance rofi_theme_get_distance ( const char *wclass, const char *name, const
|
|||
if ( p ){
|
||||
return (Distance){(double)p->value.i, PW_PX};
|
||||
}
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Theme entry: #%s %s property %s unset.", name, state?state:"", property );
|
||||
return (Distance){def, PW_PX};
|
||||
}
|
||||
|
||||
|
@ -320,6 +324,7 @@ int rofi_theme_get_boolean ( const char *wclass, const char *name, const char *
|
|||
if ( p ){
|
||||
return p->value.b;
|
||||
}
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Theme entry: #%s %s property %s unset.", name, state?state:"", property );
|
||||
return def;
|
||||
}
|
||||
|
||||
|
@ -330,6 +335,7 @@ char *rofi_theme_get_string ( const char *wclass, const char *name, const char
|
|||
if ( p ){
|
||||
return p->value.s;
|
||||
}
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Theme entry: #%s %s property %s unset.", name, state?state:"", property );
|
||||
return def;
|
||||
}
|
||||
double rofi_theme_get_double ( const char *wclass, const char *name, const char *state, const char *property, double def )
|
||||
|
@ -339,6 +345,7 @@ double rofi_theme_get_double ( const char *wclass, const char *name, const char
|
|||
if ( p ){
|
||||
return p->value.b;
|
||||
}
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Theme entry: #%s %s property %s unset.", name, state?state:"", property );
|
||||
return def;
|
||||
}
|
||||
void rofi_theme_get_color ( const char *wclass, const char *name, const char *state, const char *property, cairo_t *d)
|
||||
|
@ -352,7 +359,8 @@ void rofi_theme_get_color ( const char *wclass, const char *name, const char *s
|
|||
p->value.color.blue,
|
||||
p->value.color.alpha
|
||||
);
|
||||
|
||||
} else {
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Theme entry: #%s %s property %s unset.", name, state?state:"", property );
|
||||
}
|
||||
}
|
||||
Padding rofi_theme_get_padding ( const char *wclass, const char *name, const char *state, const char *property, Padding pad )
|
||||
|
@ -368,6 +376,7 @@ Padding rofi_theme_get_padding ( const char *wclass, const char *name, const ch
|
|||
pad = (Padding){d,d,d,d};
|
||||
}
|
||||
}
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Theme entry: #%s %s property %s unset.", name, state?state:"", property );
|
||||
return pad;
|
||||
}
|
||||
int distance_get_pixel ( Distance d, Orientation ori )
|
||||
|
|
|
@ -118,6 +118,7 @@ void widget_draw ( widget *widget, cairo_t *d )
|
|||
int top = distance_get_pixel ( widget->border.top, ORIENTATION_HORIZONTAL );
|
||||
int right = distance_get_pixel ( widget->border.right, ORIENTATION_VERTICAL );
|
||||
int bottom = distance_get_pixel ( widget->border.bottom, ORIENTATION_VERTICAL );
|
||||
if ( left || top || right || bottom ) {
|
||||
rofi_theme_get_color ( widget->class_name, widget->name, widget->state, "foreground", d );
|
||||
if ( left > 0 ) {
|
||||
cairo_set_line_width ( d, left );
|
||||
|
@ -143,9 +144,7 @@ void widget_draw ( widget *widget, cairo_t *d )
|
|||
cairo_line_to ( d, widget->w-margin_right, widget->h-bottom/2.0-margin_bottom);
|
||||
cairo_stroke ( d );
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
widget->draw ( widget, d );
|
||||
widget->need_redraw = FALSE;
|
||||
|
||||
|
|
Loading…
Reference in a new issue