From 5ab0a642c96b447bbe9ae099f8a52a49fc34970d Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Sun, 14 Jan 2018 11:21:02 +0100 Subject: [Theme] When reading double property, allow fallback to integer. Otherwise the value '1' is not seen as valid entry, only '1.0'. Fixes: #752 --- source/theme.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/source/theme.c b/source/theme.c index 44081964..83b745f4 100644 --- a/source/theme.c +++ b/source/theme.c @@ -630,6 +630,17 @@ double rofi_theme_get_double ( const widget *widget, const char *property, doubl } return p->value.f; } + // Fallback to integer if double is not found. + p = rofi_theme_find_property ( wid, P_INTEGER, property, FALSE ); + if ( p ) { + if ( p->type == P_INHERIT ) { + if ( widget->parent ) { + return rofi_theme_get_double ( widget->parent, property, def ); + } + return def; + } + return (double)p->value.i; + } g_debug ( "Theme entry: #%s %s property %s unset.", widget->name, widget->state ? widget->state : "", property ); return def; } -- cgit v1.2.3