X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fframerender.c;h=2fec1a55d6c5e640b880f5754431114f89a8842d;hb=0f677834e253dfd18a246c8811bf4a4e364d5e0e;hp=99d112844ba2b2314bd9be3ae111bd34512f9858;hpb=2442cdfd85e5229c7ee4ac49ca66a7d55ffcb919;p=chaz%2Fopenbox diff --git a/openbox/framerender.c b/openbox/framerender.c index 99d11284..2fec1a55 100644 --- a/openbox/framerender.c +++ b/openbox/framerender.c @@ -40,12 +40,66 @@ void framerender_frame(ObFrame *self) px = (self->focused ? RrColorPixel(ob_rr_theme->cb_focused_color) : RrColorPixel(ob_rr_theme->cb_unfocused_color)); - XSetWindowBackground(ob_display, self->plate, px); - XClearWindow(ob_display, self->plate); + + XSetWindowBackground(ob_display, self->backback, px); + XClearWindow(ob_display, self->backback); + XSetWindowBackground(ob_display, self->innerleft, px); + XClearWindow(ob_display, self->innerleft); + XSetWindowBackground(ob_display, self->innertop, px); + XClearWindow(ob_display, self->innertop); + XSetWindowBackground(ob_display, self->innerright, px); + XClearWindow(ob_display, self->innerright); + XSetWindowBackground(ob_display, self->innerbottom, px); + XClearWindow(ob_display, self->innerbottom); + + px = (self->focused ? + RrColorPixel(ob_rr_theme->frame_focused_border_color) : + RrColorPixel(ob_rr_theme->frame_unfocused_border_color)); + + XSetWindowBackground(ob_display, self->left, px); + XClearWindow(ob_display, self->left); + XSetWindowBackground(ob_display, self->right, px); + XClearWindow(ob_display, self->right); + + XSetWindowBackground(ob_display, self->titleleft, px); + XClearWindow(ob_display, self->titleleft); + XSetWindowBackground(ob_display, self->titletop, px); + XClearWindow(ob_display, self->titletop); + XSetWindowBackground(ob_display, self->titletopleft, px); + XClearWindow(ob_display, self->titletopleft); + XSetWindowBackground(ob_display, self->titletopright, px); + 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); + XSetWindowBackground(ob_display, self->handletop, px); + XClearWindow(ob_display, self->handletop); + XSetWindowBackground(ob_display, self->handleright, px); + XClearWindow(ob_display, self->handleright); + XSetWindowBackground(ob_display, self->handlebottom, px); + XClearWindow(ob_display, self->handlebottom); + + XSetWindowBackground(ob_display, self->lgripleft, px); + XClearWindow(ob_display, self->lgripleft); + XSetWindowBackground(ob_display, self->lgriptop, px); + XClearWindow(ob_display, self->lgriptop); + XSetWindowBackground(ob_display, self->lgripbottom, px); + XClearWindow(ob_display, self->lgripbottom); + + XSetWindowBackground(ob_display, self->rgripright, px); + XClearWindow(ob_display, self->rgripright); + XSetWindowBackground(ob_display, self->rgriptop, px); + XClearWindow(ob_display, self->rgriptop); + XSetWindowBackground(ob_display, self->rgripbottom, px); + XClearWindow(ob_display, self->rgripbottom); } if (self->decorations & OB_FRAME_DECOR_TITLEBAR) { - RrAppearance *t, *l, *m, *n, *i, *d, *s, *c; + RrAppearance *t, *l, *m, *n, *i, *d, *s, *c, *clear; if (self->focused) { t = self->a_focused_title; @@ -163,32 +217,38 @@ void framerender_frame(ObFrame *self) ob_rr_theme->a_hover_unfocused_close : ob_rr_theme->a_unfocused_unpressed_close))); } + clear = ob_rr_theme->a_clear; RrPaint(t, self->title, self->width, ob_rr_theme->title_height); - ob_rr_theme->a_clear->surface.parent = t; - ob_rr_theme->a_clear->surface.parentx = 0; - ob_rr_theme->a_clear->surface.parenty = 0; + clear->surface.parent = t; + clear->surface.parenty = 0; + + clear->surface.parentx = ob_rr_theme->grip_width; + + RrPaint(clear, self->topresize, + self->width - ob_rr_theme->grip_width * 2, + ob_rr_theme->paddingy + 1); + + clear->surface.parentx = 0; if (ob_rr_theme->grip_width > 0) - RrPaint(ob_rr_theme->a_clear, self->tltresize, + RrPaint(clear, self->tltresize, ob_rr_theme->grip_width, ob_rr_theme->paddingy + 1); if (ob_rr_theme->title_height > 0) - RrPaint(ob_rr_theme->a_clear, self->tllresize, + RrPaint(clear, self->tllresize, ob_rr_theme->paddingx + 1, ob_rr_theme->title_height); - ob_rr_theme->a_clear->surface.parentx = - self->width - ob_rr_theme->grip_width; + clear->surface.parentx = self->width - ob_rr_theme->grip_width; if (ob_rr_theme->grip_width > 0) - RrPaint(ob_rr_theme->a_clear, self->trtresize, + RrPaint(clear, self->trtresize, ob_rr_theme->grip_width, ob_rr_theme->paddingy + 1); - ob_rr_theme->a_clear->surface.parentx = - self->width - (ob_rr_theme->paddingx + 1); + clear->surface.parentx = self->width - (ob_rr_theme->paddingx + 1); if (ob_rr_theme->title_height > 0) - RrPaint(ob_rr_theme->a_clear, self->trrresize, + RrPaint(clear, self->trrresize, ob_rr_theme->paddingx + 1, ob_rr_theme->title_height); /* set parents for any parent relative guys */ @@ -265,7 +325,7 @@ void framerender_frame(ObFrame *self) static void framerender_label(ObFrame *self, RrAppearance *a) { - if (self->label_x < 0) return; + if (!self->label_on) return; /* set the texture's text! */ a->texture[0].data.text.string = self->client->title; RrPaint(a, self->label, self->label_width, ob_rr_theme->label_height); @@ -275,7 +335,7 @@ static void framerender_icon(ObFrame *self, RrAppearance *a) { const ObClientIcon *icon; - if (self->icon_x < 0) return; + if (!self->icon_on) return; icon = client_icon(self->client, ob_rr_theme->button_size + 2, @@ -284,6 +344,7 @@ static void framerender_icon(ObFrame *self, RrAppearance *a) a->texture[0].type = RR_TEXTURE_RGBA; a->texture[0].data.rgba.width = icon->width; a->texture[0].data.rgba.height = icon->height; + a->texture[0].data.rgba.alpha = 0xff; a->texture[0].data.rgba.data = icon->data; } else a->texture[0].type = RR_TEXTURE_NONE; @@ -294,33 +355,33 @@ static void framerender_icon(ObFrame *self, RrAppearance *a) static void framerender_max(ObFrame *self, RrAppearance *a) { - if (self->max_x < 0) return; + if (!self->max_on) return; RrPaint(a, self->max, ob_rr_theme->button_size, ob_rr_theme->button_size); } static void framerender_iconify(ObFrame *self, RrAppearance *a) { - if (self->iconify_x < 0) return; + if (!self->iconify_on) return; RrPaint(a, self->iconify, ob_rr_theme->button_size, ob_rr_theme->button_size); } static void framerender_desk(ObFrame *self, RrAppearance *a) { - if (self->desk_x < 0) return; + if (!self->desk_on) return; RrPaint(a, self->desk, ob_rr_theme->button_size, ob_rr_theme->button_size); } static void framerender_shade(ObFrame *self, RrAppearance *a) { - if (self->shade_x < 0) return; + if (!self->shade_on) return; RrPaint(a, self->shade, ob_rr_theme->button_size, ob_rr_theme->button_size); } static void framerender_close(ObFrame *self, RrAppearance *a) { - if (self->close_x < 0) return; + if (!self->close_on) return; RrPaint(a, self->close, ob_rr_theme->button_size, ob_rr_theme->button_size); }