]> Dogcows Code - chaz/openbox/commitdiff
use new menu.bullet.selected.imageColor. use the text colors for the menu mask icons...
authorDana Jansens <danakj@orodu.net>
Tue, 2 Sep 2003 18:53:08 +0000 (18:53 +0000)
committerDana Jansens <danakj@orodu.net>
Tue, 2 Sep 2003 18:53:08 +0000 (18:53 +0000)
openbox/client_menu.c
openbox/menu.h
openbox/menuframe.c
openbox/menuframe.h

index cc06422adf2ca733f1100156c19ea0aa3204038b..dc724383e4319366f530f7d426d15be47cb0a546 100644 (file)
@@ -162,19 +162,25 @@ void client_menu_startup()
 
     e = menu_add_submenu(menu, CLIENT_SEND_TO, SEND_TO_MENU_NAME);
     e->data.normal.mask = ob_rr_theme->desk_mask;
-    e->data.normal.mask_color = ob_rr_theme->menu_bullet_color;
+    e->data.normal.mask_normal_color = ob_rr_theme->menu_color;
+    e->data.normal.mask_disabled_color = ob_rr_theme->menu_disabled_color;
+    e->data.normal.mask_selected_color = ob_rr_theme->menu_selected_color;
 
     menu_add_submenu(menu, CLIENT_LAYER, LAYER_MENU_NAME);
 
     acts = g_slist_prepend(NULL, action_from_string("Iconify"));
     e = menu_add_normal(menu, CLIENT_ICONIFY, _("Iconify"), acts);
     e->data.normal.mask = ob_rr_theme->iconify_mask;
-    e->data.normal.mask_color = ob_rr_theme->menu_bullet_color;
+    e->data.normal.mask_normal_color = ob_rr_theme->menu_color;
+    e->data.normal.mask_disabled_color = ob_rr_theme->menu_disabled_color;
+    e->data.normal.mask_selected_color = ob_rr_theme->menu_selected_color;
 
     acts = g_slist_prepend(NULL, action_from_string("ToggleMaximizeFull"));
     e = menu_add_normal(menu, CLIENT_MAXIMIZE, _("Maximize"), acts);
-    e->data.normal.mask = ob_rr_theme->max_mask;
-    e->data.normal.mask_color = ob_rr_theme->menu_bullet_color;
+    e->data.normal.mask = ob_rr_theme->max_mask; 
+    e->data.normal.mask_normal_color = ob_rr_theme->menu_color;
+    e->data.normal.mask_disabled_color = ob_rr_theme->menu_disabled_color;
+    e->data.normal.mask_selected_color = ob_rr_theme->menu_selected_color;
 
     acts = g_slist_prepend(NULL, action_from_string("Raise"));
     menu_add_normal(menu, CLIENT_RAISE, _("Raise to top"), acts);
@@ -185,7 +191,9 @@ void client_menu_startup()
     acts = g_slist_prepend(NULL, action_from_string("ToggleShade"));
     e = menu_add_normal(menu, CLIENT_SHADE, _("Roll up/down"), acts);
     e->data.normal.mask = ob_rr_theme->shade_mask;
-    e->data.normal.mask_color = ob_rr_theme->menu_bullet_color;
+    e->data.normal.mask_normal_color = ob_rr_theme->menu_color;
+    e->data.normal.mask_disabled_color = ob_rr_theme->menu_disabled_color;
+    e->data.normal.mask_selected_color = ob_rr_theme->menu_selected_color;
 
     acts = g_slist_prepend(NULL, action_from_string("ToggleDecorations"));
     menu_add_normal(menu, CLIENT_DECORATE, _("Decorate"), acts);
@@ -203,5 +211,7 @@ void client_menu_startup()
     acts = g_slist_prepend(NULL, action_from_string("Close"));
     e = menu_add_normal(menu, CLIENT_CLOSE, _("Close"), acts);
     e->data.normal.mask = ob_rr_theme->close_mask;
-    e->data.normal.mask_color = ob_rr_theme->menu_bullet_color;
+    e->data.normal.mask_normal_color = ob_rr_theme->menu_color;
+    e->data.normal.mask_disabled_color = ob_rr_theme->menu_disabled_color;
+    e->data.normal.mask_selected_color = ob_rr_theme->menu_selected_color;
 }
index a3620e75a7101f3f8c9312c117ef1b4a8626b855..396596ae82189a01eb54e6383f034ce7372b0eee 100644 (file)
@@ -67,7 +67,9 @@ struct _ObNormalMenuEntry {
 
     /* Mask icon */
     RrPixmapMask *mask;
-    RrColor *mask_color;
+    RrColor *mask_normal_color;
+    RrColor *mask_disabled_color;
+    RrColor *mask_selected_color;
 };
 
 struct _ObSubmenuMenuEntry {
index 6f91e0b1649f0f6304ed17170bc02d326de2d0ae..91b48a7ea2d9b6310df18f9977211950f33c9cb0 100644 (file)
@@ -103,7 +103,7 @@ static ObMenuEntryFrame* menu_entry_frame_new(ObMenuEntry *entry,
     XMapWindow(ob_display, self->window);
     XMapWindow(ob_display, self->text);
 
-    self->a_normal = RrAppearanceCopy(ob_rr_theme->a_menu_item);
+    self->a_normal = RrAppearanceCopy(ob_rr_theme->a_menu_normal);
     self->a_disabled = RrAppearanceCopy(ob_rr_theme->a_menu_disabled);
     self->a_selected = RrAppearanceCopy(ob_rr_theme->a_menu_selected);
 
@@ -115,11 +115,14 @@ static ObMenuEntryFrame* menu_entry_frame_new(ObMenuEntry *entry,
         self->a_icon->texture[0].type = RR_TEXTURE_RGBA;
         self->a_mask = RrAppearanceCopy(ob_rr_theme->a_clear_tex);
         self->a_mask->texture[0].type = RR_TEXTURE_MASK;
-        self->a_bullet = RrAppearanceCopy(ob_rr_theme->a_menu_bullet);
+        self->a_bullet_normal =
+            RrAppearanceCopy(ob_rr_theme->a_menu_bullet_normal);
+        self->a_bullet_selected =
+            RrAppearanceCopy(ob_rr_theme->a_menu_bullet_selected);
     }
 
     self->a_text_normal =
-        RrAppearanceCopy(ob_rr_theme->a_menu_text_item);
+        RrAppearanceCopy(ob_rr_theme->a_menu_text_normal);
     self->a_text_disabled =
         RrAppearanceCopy(ob_rr_theme->a_menu_text_disabled);
     self->a_text_selected =
@@ -148,7 +151,8 @@ static void menu_entry_frame_free(ObMenuEntryFrame *self)
         RrAppearanceFree(self->a_text_normal);
         RrAppearanceFree(self->a_text_disabled);
         RrAppearanceFree(self->a_text_selected);
-        RrAppearanceFree(self->a_bullet);
+        RrAppearanceFree(self->a_bullet_normal);
+        RrAppearanceFree(self->a_bullet_selected);
 
         g_free(self);
     }
@@ -298,13 +302,22 @@ static void menu_entry_frame_render(ObMenuEntryFrame *self)
     } else if (self->entry->type != OB_MENU_ENTRY_TYPE_SEPARATOR &&
                self->entry->data.normal.mask)
     {
+        RrColor *c;
+
         XMoveResizeWindow(ob_display, self->icon, PADDING, 0,
                           self->frame->item_h,
                           self->frame->item_h);
         self->a_mask->texture[0].data.mask.mask =
             self->entry->data.normal.mask;
-        self->a_mask->texture[0].data.mask.color =
-            self->entry->data.normal.mask_color;
+
+        c = ((self->entry->type == OB_MENU_ENTRY_TYPE_NORMAL &&
+              !self->entry->data.normal.enabled) ?
+             self->entry->data.normal.mask_disabled_color :
+             (self == self->frame->selected ?
+              self->entry->data.normal.mask_selected_color :
+              self->entry->data.normal.mask_normal_color));
+        self->a_mask->texture[0].data.mask.color = c;
+
         self->a_mask->surface.parent = item_a;
         self->a_mask->surface.parentx = PADDING;
         self->a_mask->surface.parenty = 0;
@@ -315,17 +328,21 @@ static void menu_entry_frame_render(ObMenuEntryFrame *self)
         XUnmapWindow(ob_display, self->icon);
 
     if (self->entry->type == OB_MENU_ENTRY_TYPE_SUBMENU) {
+        RrAppearance *bullet_a;
         XMoveResizeWindow(ob_display, self->bullet,
                           self->frame->text_x + self->frame->text_w
                           - self->frame->item_h + PADDING, PADDING,
                           self->frame->item_h - 2*PADDING,
                           self->frame->item_h - 2*PADDING);
-        self->a_bullet->surface.parent = item_a;
-        self->a_bullet->surface.parentx =
+        bullet_a = (self == self->frame->selected ?
+                    self->a_bullet_selected :
+                    self->a_bullet_normal);
+        bullet_a->surface.parent = item_a;
+        bullet_a->surface.parentx =
             self->frame->text_x + self->frame->text_w - self->frame->item_h
             + PADDING;
-        self->a_bullet->surface.parenty = PADDING;
-        RrPaint(self->a_bullet, self->bullet,
+        bullet_a->surface.parenty = PADDING;
+        RrPaint(bullet_a, self->bullet,
                 self->frame->item_h - 2*PADDING,
                 self->frame->item_h - 2*PADDING);
         XMapWindow(ob_display, self->bullet);
index 92cd87934d25b474151183d197d657f7e2106c73..f8a1da820840e8739135cfcbb711f40e356b7f84 100644 (file)
@@ -70,7 +70,8 @@ struct _ObMenuEntryFrame
 
     RrAppearance *a_icon;
     RrAppearance *a_mask;
-    RrAppearance *a_bullet;
+    RrAppearance *a_bullet_normal;
+    RrAppearance *a_bullet_selected;
     RrAppearance *a_separator;
     RrAppearance *a_text_normal;
     RrAppearance *a_text_disabled;
This page took 0.027907 seconds and 4 git commands to generate.