From: Dana Jansens Date: Mon, 2 Jun 2003 02:01:15 +0000 (+0000) Subject: set colors for text X-Git-Tag: gl2~6 X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=03cf0c2d6cea3b49242bf580694481b9dca15bff;p=dana%2Fopenbox.git set colors for text --- diff --git a/openbox/frame.c b/openbox/frame.c index 7f82a413..8c2fd33a 100644 --- a/openbox/frame.c +++ b/openbox/frame.c @@ -53,8 +53,8 @@ Frame *frame_new() self->shapewindow = createWindow(ob_root, mask, &attrib); self->surface = RrSurfaceNew(ob_render_inst, RR_SURFACE_NONE, self->window, 0); - RrColorSet(&pri, 1, 0, 0, 0); - RrColorSet(&sec, 1, 0, 1, 0); + RrColorSet(&pri, 1, 0, 0, 1.0); + RrColorSet(&sec, 1, 0, 1, 1.0); mask = 0; self->plate = createWindow(self->window, mask, &attrib); @@ -70,7 +70,7 @@ Frame *frame_new() fd->surface = RrSurfaceNewChild(RR_SURFACE_PLANAR, self->surface, 1); RrPlanarSet(fd->surface, RR_PLANAR_HORIZONTAL, RR_RAISED_OUTER, &sec, &pri, 0, NULL); - RrTextureSetText(fd->surface, 0, foont, RR_LEFT, + RrTextureSetText(fd->surface, 0, foont, RR_LEFT, &pri, "OPENBOX SUCKS because of me."); fd->window = RrSurfaceWindow(fd->surface); XSelectInput(ob_display, fd->window, ELEMENT_EVENTMASK); diff --git a/openbox/menu_render.c b/openbox/menu_render.c index fbdff17d..dcfcd557 100644 --- a/openbox/menu_render.c +++ b/openbox/menu_render.c @@ -34,7 +34,9 @@ void menu_render_full(Menu *self) { /* set texture data and size them mofos out */ if (self->label) { - RrTextureSetText(self->s_title, 0, NULL, RR_CENTER, + struct RrColor c; + RrColorSet(&c, 0, 0, 0, 1.0); + RrTextureSetText(self->s_title, 0, NULL, RR_CENTER, &c, self->label); RrSurfaceMinSize(self->s_title, &self->title_min_w, &self->title_h); self->title_min_w += theme_bevel * 2; @@ -46,18 +48,20 @@ void menu_render_full(Menu *self) { for (it = self->entries; it; it = it->next) { MenuEntry *e = it->data; + struct RrColor c; int h; - RrTextureSetText(e->s_item, 0, NULL, RR_LEFT, e->label); + RrColorSet(&c, 0, 0, 0, 1.0); + RrTextureSetText(e->s_item, 0, NULL, RR_LEFT, &c, e->label); RrSurfaceMinSize(e->s_item, &e->min_w, &self->item_h); self->size.width = MAX(self->size.width, e->min_w); - RrTextureSetText(e->s_disabled, 0, NULL, RR_LEFT, e->label); + RrTextureSetText(e->s_disabled, 0, NULL, RR_LEFT, &c, e->label); RrSurfaceMinSize(e->s_disabled, &e->min_w, &h); self->item_h = MAX(self->item_h, h); self->size.width = MAX(self->size.width, e->min_w); - RrTextureSetText(e->s_hilite, 0, NULL, RR_LEFT, e->label); + RrTextureSetText(e->s_hilite, 0, NULL, RR_LEFT, &c, e->label); RrSurfaceMinSize(e->s_hilite, &e->min_w, &h); self->item_h = MAX(self->item_h, h); self->size.width = MAX(self->size.width, e->min_w); diff --git a/openbox/popup.c b/openbox/popup.c index 6ce937b9..906cec17 100644 --- a/openbox/popup.c +++ b/openbox/popup.c @@ -60,17 +60,17 @@ Popup *popup_new(gboolean hasicon) /* XXX COPY THE APPEARANCES FROM THE THEME...... LIKE THIS SORTA! self->a_text = appearance_copy(theme_app_hilite_label); */ - RrColorSet(&pri, 1, 0, 0, 0); - RrColorSet(&sec, 0, 1, 0, 0); + RrColorSet(&pri, 1, 0, 0, 1.0); + RrColorSet(&sec, 0, 1, 0, 1.0); RrPlanarSet(self->s_bg, RR_PLANAR_VERTICAL, RR_SUNKEN_INNER, &pri, &sec, 1, &pri); - RrColorSet(&pri, 0, 0.5, 0, 0.7); - RrColorSet(&sec, 0.5, 0, 0.5, 0.7); + RrColorSet(&pri, 0, 0.5, 0, 0.3); + RrColorSet(&sec, 0.5, 0, 0.5, 0.3); RrPlanarSet(self->s_text, RR_PLANAR_HORIZONTAL, RR_BEVEL_NONE, &pri, &sec, 0, NULL); if (self->s_icon) { - RrColorSet(&pri, 0, 0, 1, 0.7); - RrColorSet(&sec, 0.5, 0.5, 0, 0.7); + RrColorSet(&pri, 0, 0, 1, 0.3); + RrColorSet(&sec, 0.5, 0.5, 0, 0.3); RrPlanarSet(self->s_icon, RR_PLANAR_HORIZONTAL, RR_BEVEL_NONE, &pri, &sec, 0, NULL); } @@ -105,8 +105,10 @@ void popup_size_to_string(Popup *self, char *text) { int textw, texth; int iconw; + struct RrColor c; - RrTextureSetText(self->s_text, 0, NULL, RR_LEFT, text); + RrColorSet(&c, 0, 0, 0, 1.0); + RrTextureSetText(self->s_text, 0, NULL, RR_LEFT, &c, text); RrSurfaceMinSize(self->s_text, &textw, &texth); textw += theme_bevel * 2; texth += theme_bevel * 2; @@ -121,9 +123,11 @@ void popup_show(Popup *self, char *text, Icon *icon) int x, y, w, h; int textw, texth; int iconw; + struct RrColor c; /* set up the textures */ - RrTextureSetText(self->s_text, 0, NULL, RR_LEFT, text); + RrColorSet(&c, 0, 0, 0, 1.0); + RrTextureSetText(self->s_text, 0, NULL, RR_LEFT, &c, text); /* measure the shit out */ RrSurfaceMinSize(self->s_text, &textw, &texth);