From 0864910e796dbfa038a6a8186ad56b0bc077339e Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sat, 2 Jun 2007 21:23:15 +0000 Subject: [PATCH] merge r7274 from trunk --- openbox/frame.c | 8 +++----- openbox/framerender.c | 9 +++++++-- render/theme.c | 23 +++++++++++++++++++---- render/theme.h | 4 ++-- themes/Clearlooks/openbox-3/themerc | 2 +- 5 files changed, 32 insertions(+), 14 deletions(-) diff --git a/openbox/frame.c b/openbox/frame.c index ccf0113c..16fe608e 100644 --- a/openbox/frame.c +++ b/openbox/frame.c @@ -365,7 +365,7 @@ void frame_adjust_area(ObFrame *self, gboolean moved, self->cbwidth_b + (!self->max_horz || !self->max_vert ? self->bwidth : 0)); if (self->decorations & OB_FRAME_DECOR_TITLEBAR) - self->size.top += ob_rr_theme->title_height + ob_rr_theme->tswidth; + self->size.top += ob_rr_theme->title_height + self->bwidth; if (self->decorations & OB_FRAME_DECOR_HANDLE && ob_rr_theme->handle_height > 0) { @@ -468,14 +468,12 @@ void frame_adjust_area(ObFrame *self, gboolean moved, XMapWindow(ob_display, self->titletopleft); XMapWindow(ob_display, self->titletopright); - if (self->decorations & OB_FRAME_DECOR_TITLEBAR && - ob_rr_theme->tswidth) - { + if (self->decorations & OB_FRAME_DECOR_TITLEBAR) { XMoveResizeWindow(ob_display, self->titlebottom, self->bwidth, ob_rr_theme->title_height + self->bwidth, self->width, - ob_rr_theme->tswidth); + self->bwidth); XMapWindow(ob_display, self->titlebottom); } else diff --git a/openbox/framerender.c b/openbox/framerender.c index 2fec1a55..f122eef8 100644 --- a/openbox/framerender.c +++ b/openbox/framerender.c @@ -71,8 +71,6 @@ void framerender_frame(ObFrame *self) XClearWindow(ob_display, self->titletopright); XSetWindowBackground(ob_display, self->titleright, px); XClearWindow(ob_display, self->titleright); - XSetWindowBackground(ob_display, self->titlebottom, px); - XClearWindow(ob_display, self->titlebottom); XSetWindowBackground(ob_display, self->handleleft, px); XClearWindow(ob_display, self->handleleft); @@ -96,6 +94,13 @@ void framerender_frame(ObFrame *self) XClearWindow(ob_display, self->rgriptop); XSetWindowBackground(ob_display, self->rgripbottom, px); XClearWindow(ob_display, self->rgripbottom); + + px = (self->focused ? + RrColorPixel(ob_rr_theme->title_separator_focused_color) : + RrColorPixel(ob_rr_theme->title_separator_unfocused_color)); + + XSetWindowBackground(ob_display, self->titlebottom, px); + XClearWindow(ob_display, self->titlebottom); } if (self->decorations & OB_FRAME_DECOR_TITLEBAR) { diff --git a/render/theme.c b/render/theme.c index e32cad22..3b4a4cc3 100644 --- a/render/theme.c +++ b/render/theme.c @@ -182,10 +182,6 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name, if (!read_int(db, "border.width", &theme->fbwidth) || theme->fbwidth < 0 || theme->fbwidth > 100) theme->fbwidth = 1; - /* title separator width inherits from frame border width */ - if (!read_int(db, "window.title.separator.width", &theme->tswidth) || - theme->tswidth < 0 || theme->tswidth > 100) - theme->tswidth = theme->fbwidth; /* menu border width inherits from the frame border width */ if (!read_int(db, "menu.border.width", &theme->mbwidth) || theme->mbwidth < 0 || theme->mbwidth > 100) @@ -205,6 +201,15 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name, "border.color", &theme->frame_focused_border_color)) theme->frame_focused_border_color = RrColorNew(inst, 0, 0, 0); + /* title separator focused color inherits from focused boder color */ + if (!read_color(db, inst, + "window.active.title.separator.color", + &theme->title_separator_focused_color)) + theme->title_separator_focused_color = + RrColorNew(inst, + theme->frame_focused_border_color->r, + theme->frame_focused_border_color->g, + theme->frame_focused_border_color->b); /* unfocused border color inherits from frame focused border color */ if (!read_color(db, inst, "window.inactive.border.color", @@ -213,6 +218,16 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name, RrColorNew(inst, theme->frame_focused_border_color->r, theme->frame_focused_border_color->g, theme->frame_focused_border_color->b); + /* title separator unfocused color inherits from unfocused boder color */ + if (!read_color(db, inst, + "window.inactive.title.separator.color", + &theme->title_separator_unfocused_color)) + theme->title_separator_unfocused_color = + RrColorNew(inst, + theme->frame_unfocused_border_color->r, + theme->frame_unfocused_border_color->g, + theme->frame_unfocused_border_color->b); + /* menu border color inherits from frame focused border color */ if (!read_color(db, inst, "menu.border.color", diff --git a/render/theme.h b/render/theme.h index aa0013c0..97f2adfc 100644 --- a/render/theme.h +++ b/render/theme.h @@ -41,8 +41,6 @@ struct _RrTheme { gint paddingy; gint handle_height; gint fbwidth; /*!< frame border width */ - gint tswidth; /*!< title separator width - between the titlebar and the - client */ gint mbwidth; /*!< menu border width */ gint cbwidthx; gint cbwidthy; @@ -62,6 +60,8 @@ struct _RrTheme { RrColor *menu_border_color; RrColor *frame_focused_border_color; RrColor *frame_unfocused_border_color; + RrColor *title_separator_focused_color; + RrColor *title_separator_unfocused_color; RrColor *cb_focused_color; RrColor *cb_unfocused_color; RrColor *title_focused_color; diff --git a/themes/Clearlooks/openbox-3/themerc b/themes/Clearlooks/openbox-3/themerc index 1ba1b0d6..f67fed38 100644 --- a/themes/Clearlooks/openbox-3/themerc +++ b/themes/Clearlooks/openbox-3/themerc @@ -110,7 +110,7 @@ window.client.padding.width: 0 window.client.padding.height: 0 border.color: #000000 menu.overlap: 0 - +window.title.separator.width: 0 ### Fonts window.active.label.text.font:shadow=y:shadowtint=70:shadowoffset=1 -- 2.34.1