set colors for text
authorDana Jansens <danakj@orodu.net>
Mon, 2 Jun 2003 02:01:15 +0000 (02:01 +0000)
committerDana Jansens <danakj@orodu.net>
Mon, 2 Jun 2003 02:01:15 +0000 (02:01 +0000)
openbox/frame.c
openbox/menu_render.c
openbox/popup.c

index 7f82a413299a39e14d62e504b0b427af9b93096c..8c2fd33adf2cbf2972165d2188ef27c16a42deea 100644 (file)
@@ -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);
index fbdff17dd5abe0022fd9d0f7be22b60a026f7e76..dcfcd557d476dada131a70c434d2ee2e3cde001e 100644 (file)
@@ -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);
index 6ce937b999779687fd0672aa68ad8dc709958400..906cec172aeab765211153e24d79ccdcf2bd5552 100644 (file)
@@ -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);