Permalink
Browse files

Specific border width/color for undecorated active/inactive windows (…

…bug #4889)

The attached patch adds three theme options with backward compatible defaults:

undecorated.border.width
  defaults to border.width

window.undecorated.active.border.color
  defaults to window.active.border.color

window.undecorated.inactive.border.color
  defaults to window.inactive.border.color
  • Loading branch information...
1 parent e4e7c2b commit fadf435ee1a37cf542be037cc2d7e7649a544581 @memeplex memeplex committed with danakj Oct 14, 2011
Showing with 29 additions and 7 deletions.
  1. +17 −3 obrender/theme.c
  2. +3 −0 obrender/theme.h
  3. +2 −1 openbox/frame.c
  4. +7 −3 openbox/framerender.c
View
@@ -259,9 +259,13 @@ RrTheme* RrThemeNew(const RrInstance *inst, const gchar *name,
READ_INT("border.width", theme->fbwidth, 0, 100, 1);
READ_INT("menu.border.width", theme->mbwidth, 0, 100, theme->fbwidth);
READ_INT("osd.border.width", theme->obwidth, 0, 100, theme->fbwidth);
+ READ_INT("undecorated.border.width", theme->ubwidth, 0, 100,
+ theme->fbwidth);
READ_INT("menu.separator.width", theme->menu_sep_width, 1, 100, 1);
- READ_INT("menu.separator.padding.width", theme->menu_sep_paddingx, 0, 100, 6);
- READ_INT("menu.separator.padding.height", theme->menu_sep_paddingy, 0, 100, 3);
+ READ_INT("menu.separator.padding.width", theme->menu_sep_paddingx,
+ 0, 100, 6);
+ READ_INT("menu.separator.padding.height", theme->menu_sep_paddingy,
+ 0, 100, 3);
READ_INT("window.client.padding.width", theme->cbwidthx, 0, 100,
theme->paddingx);
READ_INT("window.client.padding.height", theme->cbwidthy, 0, 100,
@@ -270,7 +274,11 @@ RrTheme* RrThemeNew(const RrInstance *inst, const gchar *name,
/* load colors */
READ_COLOR_("window.active.border.color", "border.color",
theme->frame_focused_border_color, RrColorNew(inst, 0, 0, 0));
-
+ /* undecorated focused border color inherits from frame focused border
+ color */
+ READ_COLOR("window.undecorated.active.border.color",
+ theme->frame_undecorated_focused_border_color,
+ RrColorCopy(theme->frame_focused_border_color));
/* title separator focused color inherits from focused border color */
READ_COLOR("window.active.title.separator.color",
theme->title_separator_focused_color,
@@ -281,6 +289,12 @@ RrTheme* RrThemeNew(const RrInstance *inst, const gchar *name,
theme->frame_unfocused_border_color,
RrColorCopy(theme->frame_focused_border_color));
+ /* undecorated unfocused border color inherits from frame unfocused border
+ color */
+ READ_COLOR("window.undecorated.inactive.border.color",
+ theme->frame_undecorated_unfocused_border_color,
+ RrColorCopy(theme->frame_unfocused_border_color));
+
/* title separator unfocused color inherits from unfocused border color */
READ_COLOR("window.inactive.title.separator.color",
theme->title_separator_unfocused_color,
View
@@ -44,6 +44,7 @@ struct _RrTheme {
gint fbwidth; /*!< frame border width */
gint mbwidth; /*!< menu border width */
gint obwidth; /*!< osd border width */
+ gint ubwidth; /*!< undecorated frame border width */
gint cbwidthx;
gint cbwidthy;
gint menu_overlap_x;
@@ -66,7 +67,9 @@ struct _RrTheme {
RrColor *menu_border_color;
RrColor *osd_border_color;
RrColor *frame_focused_border_color;
+ RrColor *frame_undecorated_focused_border_color;
RrColor *frame_unfocused_border_color;
+ RrColor *frame_undecorated_unfocused_border_color;
RrColor *title_separator_focused_color;
RrColor *title_separator_unfocused_color;
RrColor *cb_focused_color;
View
@@ -348,7 +348,8 @@ void frame_adjust_area(ObFrame *self, gboolean moved,
self->shaded = self->client->shaded;
if (self->decorations & OB_FRAME_DECOR_BORDER)
- self->bwidth = ob_rr_theme->fbwidth;
+ self->bwidth = self->client->undecorated ?
+ ob_rr_theme->ubwidth : ob_rr_theme->fbwidth;
else
self->bwidth = 0;
View
@@ -68,9 +68,13 @@ void framerender_frame(ObFrame *self)
XSetWindowBackground(obt_display, self->innerbrb, px);
XClearWindow(obt_display, self->innerbrb);
- px = (self->focused ?
- RrColorPixel(ob_rr_theme->frame_focused_border_color) :
- RrColorPixel(ob_rr_theme->frame_unfocused_border_color));
+ px = RrColorPixel(self->focused ?
+ (self->client->undecorated ?
+ ob_rr_theme->frame_undecorated_focused_border_color :
+ ob_rr_theme->frame_focused_border_color) :
+ (self->client->undecorated ?
+ ob_rr_theme->frame_undecorated_unfocused_border_color :
+ ob_rr_theme->frame_unfocused_border_color));
XSetWindowBackground(obt_display, self->left, px);
XClearWindow(obt_display, self->left);

0 comments on commit fadf435

Please sign in to comment.