diff options
| author | Dana Jansens <danakj@orodu.net> | 2003-07-10 23:27:02 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2003-07-10 23:27:02 +0000 |
| commit | 81af5a8b0caadc0a82ff2304c315f816c9576e93 (patch) | |
| tree | ccbe40fccf5bd00b6a5cba87c20aec3ad8b6e55a /openbox/framerender.c | |
| parent | b0e8e276e451639689ebc9c58c1afe54897bceb2 (diff) | |
add disabled buttons, instead of now showing buttons at all when they wont do anything, now show a disabled button instead. this severely breaks compatibility with blackbox themes since there is no good way to automiatically create a disabled button that i can think of, so if they dont exist in the theme you get black and white for the button.
when a window cant be resized, its handle is not removed but its grips are.
change allowing the user to disable individual decorations as that is overkill,
instead allow a toggle through the client.decorate boolean.
Diffstat (limited to 'openbox/framerender.c')
| -rw-r--r-- | openbox/framerender.c | 144 |
1 files changed, 83 insertions, 61 deletions
diff --git a/openbox/framerender.c b/openbox/framerender.c index b73077cd..5f2f2594 100644 --- a/openbox/framerender.c +++ b/openbox/framerender.c @@ -22,61 +22,81 @@ void framerender_frame(ObFrame *self) XSetWindowBorder(ob_display, self->plate, RrColorPixel(ob_rr_theme->cb_unfocused_color)); - if (self->client->decorations & Decor_Titlebar) { + if (self->decorations & OB_FRAME_DECOR_TITLEBAR) { RrAppearance *t, *l, *m, *n, *i, *d, *s, *c; t = (self->focused ? self->a_focused_title : self->a_unfocused_title); l = (self->focused ? self->a_focused_label : self->a_unfocused_label); - m = (self->focused ? - (self->client->max_vert || self->client->max_horz ? - ob_rr_theme->a_focused_pressed_set_max : - (self->max_press ? - ob_rr_theme->a_focused_pressed_max : - ob_rr_theme->a_focused_unpressed_max)) : - (self->client->max_vert || self->client->max_horz ? - ob_rr_theme->a_unfocused_pressed_set_max : - (self->max_press ? - ob_rr_theme->a_unfocused_pressed_max : - ob_rr_theme->a_unfocused_unpressed_max))); + m = (!(self->decorations & OB_FRAME_DECOR_MAXIMIZE) ? + (self->focused ? + ob_rr_theme->a_disabled_focused_max : + ob_rr_theme->a_disabled_unfocused_max) : + (self->focused ? + (self->client->max_vert || self->client->max_horz ? + ob_rr_theme->a_focused_pressed_set_max : + (self->max_press ? + ob_rr_theme->a_focused_pressed_max : + ob_rr_theme->a_focused_unpressed_max)) : + (self->client->max_vert || self->client->max_horz ? + ob_rr_theme->a_unfocused_pressed_set_max : + (self->max_press ? + ob_rr_theme->a_unfocused_pressed_max : + ob_rr_theme->a_unfocused_unpressed_max)))); n = self->a_icon; - i = (self->focused ? - (self->iconify_press ? - ob_rr_theme->a_focused_pressed_iconify : - ob_rr_theme->a_focused_unpressed_iconify) : - (self->iconify_press ? - ob_rr_theme->a_unfocused_pressed_iconify : - ob_rr_theme->a_unfocused_unpressed_iconify)); - d = (self->focused ? - (self->client->desktop == DESKTOP_ALL ? - ob_rr_theme->a_focused_pressed_set_desk : - (self->desk_press ? - ob_rr_theme->a_focused_pressed_desk : - ob_rr_theme->a_focused_unpressed_desk)) : - (self->client->desktop == DESKTOP_ALL ? - ob_rr_theme->a_unfocused_pressed_set_desk : - (self->desk_press ? - ob_rr_theme->a_unfocused_pressed_desk : - ob_rr_theme->a_unfocused_unpressed_desk))); - s = (self->focused ? - (self->client->shaded ? - ob_rr_theme->a_focused_pressed_set_shade : - (self->shade_press ? - ob_rr_theme->a_focused_pressed_shade : - ob_rr_theme->a_focused_unpressed_shade)) : - (self->client->shaded ? - ob_rr_theme->a_unfocused_pressed_set_shade : - (self->shade_press ? - ob_rr_theme->a_unfocused_pressed_shade : - ob_rr_theme->a_unfocused_unpressed_shade))); - c = (self->focused ? - (self->close_press ? - ob_rr_theme->a_focused_pressed_close : - ob_rr_theme->a_focused_unpressed_close) : - (self->close_press ? - ob_rr_theme->a_unfocused_pressed_close : - ob_rr_theme->a_unfocused_unpressed_close)); + i = (!(self->decorations & OB_FRAME_DECOR_ICONIFY) ? + (self->focused ? + ob_rr_theme->a_disabled_focused_iconify : + ob_rr_theme->a_disabled_unfocused_iconify) : + (self->focused ? + (self->iconify_press ? + ob_rr_theme->a_focused_pressed_iconify : + ob_rr_theme->a_focused_unpressed_iconify) : + (self->iconify_press ? + ob_rr_theme->a_unfocused_pressed_iconify : + ob_rr_theme->a_unfocused_unpressed_iconify))); + d = (!(self->decorations & OB_FRAME_DECOR_ALLDESKTOPS) ? + (self->focused ? + ob_rr_theme->a_disabled_focused_desk : + ob_rr_theme->a_disabled_unfocused_desk) : + (self->focused ? + (self->client->desktop == DESKTOP_ALL ? + ob_rr_theme->a_focused_pressed_set_desk : + (self->desk_press ? + ob_rr_theme->a_focused_pressed_desk : + ob_rr_theme->a_focused_unpressed_desk)) : + (self->client->desktop == DESKTOP_ALL ? + ob_rr_theme->a_unfocused_pressed_set_desk : + (self->desk_press ? + ob_rr_theme->a_unfocused_pressed_desk : + ob_rr_theme->a_unfocused_unpressed_desk)))); + s = (!(self->decorations & OB_FRAME_DECOR_SHADE) ? + (self->focused ? + ob_rr_theme->a_disabled_focused_shade : + ob_rr_theme->a_disabled_unfocused_shade) : + (self->focused ? + (self->client->shaded ? + ob_rr_theme->a_focused_pressed_set_shade : + (self->shade_press ? + ob_rr_theme->a_focused_pressed_shade : + ob_rr_theme->a_focused_unpressed_shade)) : + (self->client->shaded ? + ob_rr_theme->a_unfocused_pressed_set_shade : + (self->shade_press ? + ob_rr_theme->a_unfocused_pressed_shade : + ob_rr_theme->a_unfocused_unpressed_shade)))); + c = (!(self->decorations & OB_FRAME_DECOR_CLOSE) ? + (self->focused ? + ob_rr_theme->a_disabled_focused_close : + ob_rr_theme->a_disabled_unfocused_close) : + (self->focused ? + (self->close_press ? + ob_rr_theme->a_focused_pressed_close : + ob_rr_theme->a_focused_unpressed_close) : + (self->close_press ? + ob_rr_theme->a_unfocused_pressed_close : + ob_rr_theme->a_unfocused_unpressed_close))); RrPaint(t, self->title, self->width, ob_rr_theme->title_height); @@ -118,7 +138,7 @@ void framerender_frame(ObFrame *self) framerender_close(self, c); } - if (self->client->decorations & Decor_Handle) { + if (self->decorations & OB_FRAME_DECOR_HANDLE) { RrAppearance *h, *g; h = (self->focused ? @@ -126,23 +146,25 @@ void framerender_frame(ObFrame *self) RrPaint(h, self->handle, self->width, ob_rr_theme->handle_height); - g = (self->focused ? - ob_rr_theme->a_focused_grip : ob_rr_theme->a_unfocused_grip); + if (self->decorations & OB_FRAME_DECOR_GRIPS) { + g = (self->focused ? + ob_rr_theme->a_focused_grip : ob_rr_theme->a_unfocused_grip); - if (g->surface.grad == RR_SURFACE_PARENTREL) - g->surface.parent = h; + if (g->surface.grad == RR_SURFACE_PARENTREL) + g->surface.parent = h; - g->surface.parentx = 0; - g->surface.parenty = 0; + g->surface.parentx = 0; + g->surface.parenty = 0; - RrPaint(g, self->lgrip, - ob_rr_theme->grip_width, ob_rr_theme->handle_height); + RrPaint(g, self->lgrip, + ob_rr_theme->grip_width, ob_rr_theme->handle_height); - g->surface.parentx = self->width - ob_rr_theme->grip_width; - g->surface.parenty = 0; + g->surface.parentx = self->width - ob_rr_theme->grip_width; + g->surface.parenty = 0; - RrPaint(g, self->rgrip, - ob_rr_theme->grip_width, ob_rr_theme->handle_height); + RrPaint(g, self->rgrip, + ob_rr_theme->grip_width, ob_rr_theme->handle_height); + } } } |
