"merge" r7366-7367
authorDana Jansens <danakj@orodu.net>
Tue, 5 Jun 2007 16:07:13 +0000 (16:07 +0000)
committerDana Jansens <danakj@orodu.net>
Tue, 5 Jun 2007 16:07:13 +0000 (16:07 +0000)
add osd.border.width
add osd.border.color

openbox/focus_cycle_popup.c
openbox/popup.c
render/theme.c
render/theme.h

index 015330bda32f2be41a9b25b972568f0b360ae349..8ae4e7e8ac78c3e6c6553fc3bdd1fe372879ea04 100644 (file)
@@ -112,9 +112,9 @@ void focus_cycle_popup_startup(gboolean reconfig)
     popup.a_bg->texture[0].type = RR_TEXTURE_RGBA;
 
     attrib.override_redirect = True;
-    attrib.border_pixel=RrColorPixel(ob_rr_theme->frame_focused_border_color);
+    attrib.border_pixel=RrColorPixel(ob_rr_theme->osd_border_color);
     popup.bg = create_window(RootWindow(ob_display, ob_screen),
-                             ob_rr_theme->fbwidth,
+                             ob_rr_theme->obwidth,
                              CWOverrideRedirect | CWBorderPixel, &attrib);
 
     popup.text = create_window(popup.bg, 0, 0, NULL);
@@ -298,9 +298,9 @@ static void popup_render(ObFocusCyclePopup *p, const ObClient *c)
 
     /* find the position for the popup (include the outer borders) */
     x = screen_area->x + (screen_area->width -
-                          (w + ob_rr_theme->fbwidth * 2)) / 2;
+                          (w + ob_rr_theme->obwidth * 2)) / 2;
     y = screen_area->y + (screen_area->height -
-                          (h + ob_rr_theme->fbwidth * 2)) / 2;
+                          (h + ob_rr_theme->obwidth * 2)) / 2;
 
     /* get the dimensions of the target hilite texture */
     rgbax = ml;
index 86d4fb4dec6bd01549542236fa5cb589a281e705..6099edcb2d237c5000c2e5e9db9b5c9a1aef6181 100644 (file)
@@ -51,9 +51,9 @@ ObPopup *popup_new()
                                0, 0, 1, 1, 0, RrDepth(ob_rr_inst),
                                InputOutput, RrVisual(ob_rr_inst), 0, NULL);
 
-    XSetWindowBorderWidth(ob_display, self->bg, ob_rr_theme->fbwidth);
+    XSetWindowBorderWidth(ob_display, self->bg, ob_rr_theme->obwidth);
     XSetWindowBorder(ob_display, self->bg,
-                     RrColorPixel(ob_rr_theme->frame_focused_border_color));
+                     RrColorPixel(ob_rr_theme->osd_border_color));
 
     XMapWindow(ob_display, self->text);
 
@@ -355,7 +355,7 @@ static void pager_popup_draw_icon(gint px, gint py, gint w, gint h,
     gint eachw, eachh;
     const guint cols = screen_desktop_layout.columns;
     const guint rows = screen_desktop_layout.rows;
-    const gint linewidth = ob_rr_theme->fbwidth;
+    const gint linewidth = ob_rr_theme->obwidth;
 
     eachw = (w - ((cols + 1) * linewidth)) / cols;
     eachh = (h - ((rows + 1) * linewidth)) / rows;
@@ -500,9 +500,9 @@ void pager_popup_delay_show(ObPagerPopup *self, gulong usec,
             XSetWindowAttributes attr;
 
             attr.border_pixel = 
-                RrColorPixel(ob_rr_theme->frame_focused_border_color);
+                RrColorPixel(ob_rr_theme->osd_border_color);
             self->wins[i] = XCreateWindow(ob_display, self->popup->bg,
-                                          0, 0, 1, 1, ob_rr_theme->fbwidth,
+                                          0, 0, 1, 1, ob_rr_theme->obwidth,
                                           RrDepth(ob_rr_inst), InputOutput,
                                           RrVisual(ob_rr_inst), CWBorderPixel,
                                           &attr);
index 0b3695304608959b20c38021001c5eec1d852f85..627d95f2f613dfa80c6d602c70cdaf14683b6262 100644 (file)
@@ -190,6 +190,10 @@ RrTheme* RrThemeNew(const RrInstance *inst, const gchar *name,
     if (!read_int(db, "menu.border.width", &theme->mbwidth) ||
         theme->mbwidth < 0 || theme->mbwidth > 100)
         theme->mbwidth = theme->fbwidth;
+    /* osd border width inherits from the frame border width */
+    if (!read_int(db, "osd.border.width", &theme->obwidth) ||
+        theme->obwidth < 0 || theme->obwidth > 100)
+        theme->obwidth = theme->fbwidth;
     if (!read_int(db, "window.client.padding.width", &theme->cbwidthx) ||
         theme->cbwidthx < 0 || theme->cbwidthx > 100)
         theme->cbwidthx = theme->paddingx;
@@ -233,13 +237,19 @@ RrTheme* RrThemeNew(const RrInstance *inst, const gchar *name,
                        theme->frame_unfocused_border_color->b);
 
     /* menu border color inherits from frame focused border color */
-    if (!read_color(db, inst,
-                    "menu.border.color",
-                    &theme->menu_border_color))
-        theme->menu_border_color = RrColorNew(inst,
-                                     theme->frame_focused_border_color->r,
-                                     theme->frame_focused_border_color->g,
-                                     theme->frame_focused_border_color->b);
+    if (!read_color(db, inst, "menu.border.color", &theme->menu_border_color))
+        theme->menu_border_color =
+            RrColorNew(inst,
+                       theme->frame_focused_border_color->r,
+                       theme->frame_focused_border_color->g,
+                       theme->frame_focused_border_color->b);
+    /* osd border color inherits from frame focused border color */
+    if (!read_color(db, inst, "osd.border.color", &theme->osd_border_color))
+        theme->osd_border_color =
+            RrColorNew(inst,
+                       theme->frame_focused_border_color->r,
+                       theme->frame_focused_border_color->g,
+                       theme->frame_focused_border_color->b);
     if (!read_color(db, inst,
                     "window.active.client.color",
                     &theme->cb_focused_color))
@@ -1328,6 +1338,7 @@ void RrThemeFree(RrTheme *theme)
         g_free(theme->name);
 
         RrColorFree(theme->menu_border_color);
+        RrColorFree(theme->osd_border_color);
         RrColorFree(theme->frame_focused_border_color);
         RrColorFree(theme->frame_unfocused_border_color);
         RrColorFree(theme->title_separator_focused_color);
index e02a69e2a5a4a57cfdb50daed573f4b9823abefe..2c35284f466b50dba4855edffc75bd57cdf1f572 100644 (file)
@@ -42,6 +42,7 @@ struct _RrTheme {
     gint handle_height;
     gint fbwidth; /*!< frame border width */
     gint mbwidth; /*!< menu border width */
+    gint obwidth; /*!< osd border width */
     gint cbwidthx;
     gint cbwidthy;
     gint menu_overlap;
@@ -58,6 +59,7 @@ struct _RrTheme {
 
     /* style settings - colors */
     RrColor *menu_border_color;
+    RrColor *osd_border_color;
     RrColor *frame_focused_border_color;
     RrColor *frame_unfocused_border_color;
     RrColor *title_separator_focused_color;