X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=render%2Ftheme.c;h=756af167a7d51279565b0ba925e244aa70f8f93e;hb=f1ad68d05bf22bec99f8e1a749fc86bfe16df5af;hp=28a682b5f22b2a49bfcf431c40128619c23f0f19;hpb=526560b8a0871cd93f27c32442b3e470ec42ecb3;p=chaz%2Fopenbox diff --git a/render/theme.c b/render/theme.c index 28a682b5..756af167 100644 --- a/render/theme.c +++ b/render/theme.c @@ -48,7 +48,7 @@ static xmlNodePtr find_node(xmlNodePtr n, const gchar *names[]); static gboolean find_int(ParseState *ps, xmlNodePtr n, const gchar *names[], gint *integer, gint lower, gint upper); static gboolean find_string(ParseState *ps, xmlNodePtr n, const gchar *names[], - const gchar **string); + gchar **string); static gboolean find_color(ParseState *ps, xmlNodePtr n, const gchar *names[], RrColor **color, gchar *alpha); static gboolean find_point(ParseState *ps, xmlNodePtr n, const gchar *names[], @@ -72,7 +72,7 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name, ParseState ps; xmlNodePtr root; RrJustify winjust, mtitlejust; - const gchar *str; + gchar *str; RrTheme *theme; if (name) { @@ -154,6 +154,7 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name, winjust = RR_JUSTIFY_RIGHT; else if (strcmp(str, "center") == 0) winjust = RR_JUSTIFY_CENTER; + g_free(str); } if (menu_title_font) { @@ -168,6 +169,7 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name, mtitlejust = RR_JUSTIFY_RIGHT; else if (strcmp(str, "center") == 0) mtitlejust = RR_JUSTIFY_CENTER; + g_free(str); } if (menu_item_font) { @@ -1204,9 +1206,10 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name, MAX(theme->padding * 2, ut + ub)); */ theme->title_height = theme->label_height + theme->paddingy * 2; - /* this should match the above title_height given the same font size - for both. */ - theme->menu_title_height = theme->menu_title_font_height + + + RrMargins(theme->a_menu_title, &ul, &ut, &ur, &ub); + theme->menu_title_label_height = theme->menu_title_font_height+ut+ub; + theme->menu_title_height = theme->menu_title_label_height + theme->paddingy * 2; } theme->button_size = theme->label_height - 2; @@ -1515,7 +1518,7 @@ static gboolean find_int(ParseState *ps, xmlNodePtr n, const gchar *names[], } static gboolean find_string(ParseState *ps, xmlNodePtr n, const gchar *names[], - const gchar **string) + gchar **string) { if ((n = find_node(n, names))) { *string = parse_string(ps->doc, n);