]> Dogcows Code - chaz/openbox/commitdiff
make a config option for the inactive osd font
authorDana Jansens <danakj@orodu.net>
Mon, 21 Dec 2009 15:42:58 +0000 (10:42 -0500)
committerDana Jansens <danakj@orodu.net>
Mon, 21 Dec 2009 15:43:30 +0000 (10:43 -0500)
data/rc.xml
openbox/config.c
openbox/config.h
openbox/openbox.c
render/theme.c
render/theme.h

index dc73fb53401271d5f26a0cd0b495b3a9bc27bcb9..ff9016dc0dd969352b9755e41ca440eec26e1f3a 100644 (file)
     <slant>normal</slant>
     <!-- 'italic' or 'normal' -->
   </font>
-  <font place="OnScreenDisplay">
+  <font place="ActiveOnScreenDisplay">
+    <name>sans</name>
+    <size>9</size>
+    <!-- font size in points -->
+    <weight>bold</weight>
+    <!-- 'bold' or 'normal' -->
+    <slant>normal</slant>
+    <!-- 'italic' or 'normal' -->
+  </font>
+  <font place="InactiveOnScreenDisplay">
     <name>sans</name>
     <size>9</size>
     <!-- font size in points -->
index 33fadeb75a5d0c5e15babc7040073db4e2019141..6bdae9fffbd3b11dde405a17a63606a598e4d30f 100644 (file)
@@ -57,7 +57,8 @@ RrFont *config_font_activewindow;
 RrFont *config_font_inactivewindow;
 RrFont *config_font_menuitem;
 RrFont *config_font_menutitle;
-RrFont *config_font_osd;
+RrFont *config_font_activeosd;
+RrFont *config_font_inactiveosd;
 
 guint   config_desktops_num;
 GSList *config_desktops_names;
@@ -605,8 +606,12 @@ static void parse_theme(xmlNodePtr node, gpointer d)
             font = &config_font_menutitle;
         else if (obt_parse_attr_contains(n, "place", "MenuItem"))
             font = &config_font_menuitem;
+        else if (obt_parse_attr_contains(n, "place", "ActiveOnScreenDisplay"))
+            font = &config_font_activeosd;
         else if (obt_parse_attr_contains(n, "place", "OnScreenDisplay"))
-            font = &config_font_osd;
+            font = &config_font_activeosd;
+        else if (obt_parse_attr_contains(n, "place","InactiveOnScreenDisplay"))
+            font = &config_font_inactiveosd;
         else
             goto next_font;
 
@@ -1036,7 +1041,8 @@ void config_shutdown(void)
     RrFontClose(config_font_inactivewindow);
     RrFontClose(config_font_menuitem);
     RrFontClose(config_font_menutitle);
-    RrFontClose(config_font_osd);
+    RrFontClose(config_font_activeosd);
+    RrFontClose(config_font_inactiveosd);
 
     for (it = config_desktops_names; it; it = g_slist_next(it))
         g_free(it->data);
index 18c97ede30a5be215ad74931bc9fe542567ea845..11796dcb0788b3b4e7ec5006a35ccad4b5f5eaa8 100644 (file)
@@ -152,8 +152,10 @@ 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 font for on-screen-displays/popups' active text */
+extern RrFont *config_font_activeosd;
+/*! The font for on-screen-displays/popups' inactive text */
+extern RrFont *config_font_inactiveosd;
 
 /*! The number of desktops */
 extern guint config_desktops_num;
index 800e6a210d3141a2fffd4eba1dc7b9816a167a0f..5f926bb649936f811ac06b485a7d64c5ae817197 100644 (file)
@@ -274,7 +274,8 @@ gint main(gint argc, gchar **argv)
                                         config_font_inactivewindow,
                                         config_font_menutitle,
                                         config_font_menuitem,
-                                        config_font_osd)))
+                                        config_font_activeosd,
+                                        config_font_inactiveosd)))
                 {
                     RrThemeFree(ob_rr_theme);
                     ob_rr_theme = theme;
index 29d81c0d55e25eeb070844e4ebbdf2a051fd2fa9..6c136bf541f541cbc6a79da8de34ef626445022d 100644 (file)
@@ -67,7 +67,7 @@ RrTheme* RrThemeNew(const RrInstance *inst, const gchar *name,
                     gboolean allow_fallback,
                     RrFont *active_window_font, RrFont *inactive_window_font,
                     RrFont *menu_title_font, RrFont *menu_item_font,
-                    RrFont *osd_font)
+                    RrFont *active_osd_font, RrFont *inactive_osd_font)
 {
     XrmDatabase db = NULL;
     RrJustify winjust, mtitlejust;
@@ -174,7 +174,8 @@ RrTheme* RrThemeNew(const RrInstance *inst, const gchar *name,
 
     theme->menu_font = get_font(menu_item_font, &default_font, inst);
 
-    theme->osd_font = get_font(osd_font, &default_font, inst);
+    theme->osd_font_hilite = get_font(active_osd_font, &default_font, inst);
+    theme->osd_font_unhilite = get_font(inactive_osd_font, &default_font,inst);
 
     /* load direct dimensions */
     if ((!read_int(db, "menu.overlap.x", &theme->menu_overlap_x) &&
@@ -926,13 +927,15 @@ RrTheme* RrThemeNew(const RrInstance *inst, const gchar *name,
 
     theme->osd_hilite_label->texture[0].type = RR_TEXTURE_TEXT;
     theme->osd_hilite_label->texture[0].data.text.justify = RR_JUSTIFY_LEFT;
-    theme->osd_hilite_label->texture[0].data.text.font = theme->osd_font;
+    theme->osd_hilite_label->texture[0].data.text.font =
+        theme->osd_font_hilite;
     theme->osd_hilite_label->texture[0].data.text.color =
         theme->osd_text_active_color;
 
     theme->osd_unhilite_label->texture[0].type = RR_TEXTURE_TEXT;
     theme->osd_unhilite_label->texture[0].data.text.justify = RR_JUSTIFY_LEFT;
-    theme->osd_unhilite_label->texture[0].data.text.font = theme->osd_font;
+    theme->osd_unhilite_label->texture[0].data.text.font =
+        theme->osd_font_unhilite;
     theme->osd_unhilite_label->texture[0].data.text.color =
         theme->osd_text_inactive_color;
 
@@ -1564,7 +1567,8 @@ void RrThemeFree(RrTheme *theme)
         RrFontClose(theme->win_font_unfocused);
         RrFontClose(theme->menu_title_font);
         RrFontClose(theme->menu_font);
-        RrFontClose(theme->osd_font);
+        RrFontClose(theme->osd_font_hilite);
+        RrFontClose(theme->osd_font_unhilite);
 
         RrAppearanceFree(theme->a_disabled_focused_max);
         RrAppearanceFree(theme->a_disabled_unfocused_max);
index 06014cbb42f012d844e549f93cc4944644787197..3f9063e61c3e9ea305b2ed474f5833b894fbf185 100644 (file)
@@ -34,7 +34,8 @@ struct _RrTheme {
     RrFont *win_font_unfocused;
     RrFont *menu_title_font;
     RrFont *menu_font;
-    RrFont *osd_font;
+    RrFont *osd_font_hilite;
+    RrFont *osd_font_unhilite;
 
     /* style settings - geometry */
     gint paddingx;
@@ -257,7 +258,7 @@ RrTheme* RrThemeNew(const RrInstance *inst, const gchar *theme,
                     gboolean allow_fallback,
                     RrFont *active_window_font, RrFont *inactive_window_font,
                     RrFont *menu_title_font, RrFont *menu_item_font,
-                    RrFont *osd_font);
+                    RrFont *active_osd_font, RrFont *inactive_osd_font);
 void RrThemeFree(RrTheme *theme);
 
 G_END_DECLS
This page took 0.038241 seconds and 4 git commands to generate.