From 4e590eba236c587caff22d8cfc3a8fc0332cb206 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Thu, 26 Apr 2007 13:10:36 +0000 Subject: [PATCH] add a separate font config for onscreendisplays change menutitle in the rc to menuheader fix up the xsd for fonts --- data/rc.xml.in | 18 ++++++++++++------ data/rc.xsd | 14 +++++++++++++- openbox/config.c | 5 ++++- openbox/config.h | 2 ++ openbox/openbox.c | 3 ++- render/theme.c | 11 +++++++++-- render/theme.h | 4 +++- 7 files changed, 45 insertions(+), 12 deletions(-) diff --git a/data/rc.xml.in b/data/rc.xml.in index 6233c2e2..d42c3135 100644 --- a/data/rc.xml.in +++ b/data/rc.xml.in @@ -44,26 +44,32 @@ yes no - arial,sans + sans 7 bold normal - arial,sans + sans 7 bold normal - - arial,sans + + sans 8 bold normal - arial,sans - 8 + sans + 9 + bold + normal + + + sans + 9 bold normal diff --git a/data/rc.xsd b/data/rc.xsd index fdb98e7d..4da392a8 100644 --- a/data/rc.xsd +++ b/data/rc.xsd @@ -47,10 +47,12 @@ Removing font shadows - they are going back into the themerc Tue Apr 24 18:42:24 UTC 2007 - mikachu(a)openbox.org Removed fourCorners option. - Wed Apr 25 14:02:40 UTC 2007 + Wed Apr 25 14:02:40 UTC 2007 - mikachu(a)openbox.org Fixed values for layer to be above/below, not top/bottom. Add chroot attribute and keybind element to keybind element. Remove xsd:sequence from everywhere, we don't care about order. + Thu Apr 26 09:11:03 EDT 2007 - danakj(a)orodu.net + Add the place attribute for fonts --> + @@ -333,6 +336,15 @@ + + + + + + + + + diff --git a/openbox/config.c b/openbox/config.c index f8b3fd95..4e3f6f9a 100644 --- a/openbox/config.c +++ b/openbox/config.c @@ -46,6 +46,7 @@ RrFont *config_font_activewindow; RrFont *config_font_inactivewindow; RrFont *config_font_menuitem; RrFont *config_font_menutitle; +RrFont *config_font_osd; gint config_desktops_num; GSList *config_desktops_names; @@ -467,10 +468,12 @@ static void parse_theme(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, font = &config_font_activewindow; else if (parse_attr_contains("InactiveWindow", n, "place")) font = &config_font_inactivewindow; - else if (parse_attr_contains("MenuTitle", n, "place")) + else if (parse_attr_contains("MenuHeader", n, "place")) font = &config_font_menutitle; else if (parse_attr_contains("MenuItem", n, "place")) font = &config_font_menuitem; + else if (parse_attr_contains("OnScreenDisplay", n, "place")) + font = &config_font_osd; else goto next_font; diff --git a/openbox/config.h b/openbox/config.h index 283fa992..e6a441b0 100644 --- a/openbox/config.h +++ b/openbox/config.h @@ -97,6 +97,8 @@ extern RrFont *config_font_inactivewindow; extern RrFont *config_font_menutitle; /*! The font for menu items */ extern RrFont *config_font_menuitem; +/*! The font for on-screen-displays/popups */ +extern RrFont *config_font_osd; /*! The number of desktops */ extern gint config_desktops_num; diff --git a/openbox/openbox.c b/openbox/openbox.c index fc2e78c0..9de780dd 100644 --- a/openbox/openbox.c +++ b/openbox/openbox.c @@ -241,7 +241,8 @@ gint main(gint argc, gchar **argv) config_font_activewindow, config_font_inactivewindow, config_font_menutitle, - config_font_menuitem))) + config_font_menuitem, + config_font_osd))) { RrThemeFree(ob_rr_theme); ob_rr_theme = theme; diff --git a/render/theme.c b/render/theme.c index a80777ba..cb50887b 100644 --- a/render/theme.c +++ b/render/theme.c @@ -66,7 +66,8 @@ static gboolean find_appearance(ParseState *ps, xmlNodePtr n, const gchar *names RrTheme* RrThemeNew(const RrInstance *inst, gchar *name, RrFont *active_window_font, RrFont *inactive_window_font, - RrFont *menu_title_font, RrFont *menu_item_font) + RrFont *menu_title_font, RrFont *menu_item_font, + RrFont *osd_font) { ParseState ps; xmlNodePtr root; @@ -173,6 +174,12 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name, } else theme->menu_font = RrFontOpenDefault(inst); + if (osd_font) { + theme->osd_font = osd_font; + RrFontRef(osd_font); + } else + theme->osd_font = RrFontOpenDefault(inst); + /* load direct dimensions */ if (!FIND(int, L("menu","overlap"), &theme->menu_overlap, -100, 100)) @@ -771,8 +778,8 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name, theme->a_focused_label->texture[0].data.text.justify = winjust; theme->osd_hilite_label->texture[0].data.text.justify = RR_JUSTIFY_LEFT; theme->a_focused_label->texture[0].data.text.font = - theme->osd_hilite_label->texture[0].data.text.font = theme->win_font_focused; + theme->osd_hilite_label->texture[0].data.text.font = theme->osd_font; theme->a_focused_label->texture[0].data.text.color = theme->title_focused_color; theme->osd_hilite_label->texture[0].data.text.color = diff --git a/render/theme.h b/render/theme.h index 62ff87dd..b0caa171 100644 --- a/render/theme.h +++ b/render/theme.h @@ -34,6 +34,7 @@ struct _RrTheme { RrFont *win_font_unfocused; RrFont *menu_title_font; RrFont *menu_font; + RrFont *osd_font; /* style settings - geometry */ gint paddingx; @@ -226,7 +227,8 @@ struct _RrTheme { the default font will be used. */ RrTheme* RrThemeNew(const RrInstance *inst, gchar *theme, RrFont *active_window_font, RrFont *inactive_window_font, - RrFont *menu_title_font, RrFont *menu_item_font); + RrFont *menu_title_font, RrFont *menu_item_font, + RrFont *osd_font); void RrThemeFree(RrTheme *theme); G_END_DECLS -- 2.39.2