Subject: Patch for ActiveColorstyle in Menus

From: Darren Stuart Embry <[email-masked]>
Date: Sun, 6 Feb 2000 18:31:16 -0500

This patch against the CVS tree makes the active menu item also
display the ActiveColorset's highlight and shadow colors.

Darren

-- 
Darren Stuart Embry keeps the bad karma away.
http://www.slug.louisville.edu/~dsembr01/
    The C Progamming Language: ``It's not just a language, it's a grade.''
      -- Jamie Zawinski, in alt.religion.emacs
Index: fvwm/ChangeLog
===================================================================
RCS file: /home/cvs/fvwm/fvwm/ChangeLog,v
retrieving revision 1.854
diff -u -r1.854 ChangeLog
--- fvwm/ChangeLog	2000/02/05 20:04:27	1.854
+++ fvwm/ChangeLog	2000/02/06 23:17:58
@@ -1,3 +1,11 @@
+2000-02-06  Darren Stuart Embry  <[email-masked]>
+
+	* fvwm/menus.h (MenuLook): 
+	* fvwm/menus.c (paint_item): 
+	(FreeMenuStyle): 
+	(UpdateMenuStyle): 
+	ActiveColorstyle relief and shadow colors are now used in menus.
+
 2000-02-05  Mikhael Goikhman  <[email-masked]>
 
 	* fvwm/menus.c (paint_item): fixed the text y coordinate in
Index: fvwm/fvwm/menus.c
===================================================================
RCS file: /home/cvs/fvwm/fvwm/fvwm/menus.c,v
retrieving revision 1.181
diff -u -r1.181 menus.c
--- fvwm/fvwm/menus.c	2000/02/05 20:04:29	1.181
+++ fvwm/fvwm/menus.c	2000/02/06 23:17:59
@@ -2971,6 +2971,10 @@
   /* Hilight 3D */
   if (is_item_selected && relief_thickness > 0)
   {
+    if (MST_HAS_MENU_CSET(mr)) {
+      ReliefGC = MST_MENU_ACTIVE_RELIEF_GC(mr);
+      ShadowGC = MST_MENU_ACTIVE_SHADOW_GC(mr);
+    }
     if (MR_HILIGHT_WIDTH(mr) - 2 * relief_thickness > 0)
     {
       /* The relief reaches down into the next item, hence the value for the
@@ -5202,6 +5206,10 @@
     XFreeGC(dpy, ST_MENU_ACTIVE_GC(ms));
   if(ST_MENU_ACTIVE_BACK_GC(ms))
     XFreeGC(dpy, ST_MENU_ACTIVE_BACK_GC(ms));
+  if(ST_MENU_ACTIVE_RELIEF_GC(ms))
+    XFreeGC(dpy, ST_MENU_ACTIVE_RELIEF_GC(ms));
+  if(ST_MENU_ACTIVE_SHADOW_GC(ms))
+    XFreeGC(dpy, ST_MENU_ACTIVE_SHADOW_GC(ms));
   if(ST_MENU_RELIEF_GC(ms))
     XFreeGC(dpy, ST_MENU_RELIEF_GC(ms));
   if(ST_MENU_STIPPLE_GC(ms))
@@ -5276,6 +5284,8 @@
   Pixel relief_back;
   Pixel active_fore;
   Pixel active_back;
+  Pixel active_relief_fore;
+  Pixel active_relief_back;
   colorset_struct *menu_cs = &Colorset[ST_CSET_MENU(ms)];
   colorset_struct *active_cs = &Colorset[ST_CSET_ACTIVE(ms)];
   colorset_struct *greyed_cs = &Colorset[ST_CSET_GREYED(ms)];
@@ -5317,6 +5327,8 @@
     menu_back = menu_cs->bg;
     relief_fore = menu_cs->hilite;
     relief_back = menu_cs->shadow;
+    active_relief_fore = menu_cs->hilite;
+    active_relief_back = menu_cs->shadow;
   }
   else
   {
@@ -5324,11 +5336,15 @@
     menu_back = ST_MENU_COLORS(ms).back;
     relief_fore = ST_MENU_RELIEF_COLORS(ms).fore;
     relief_back = ST_MENU_RELIEF_COLORS(ms).back;
+    active_relief_fore = ST_MENU_RELIEF_COLORS(ms).fore;
+    active_relief_back = ST_MENU_RELIEF_COLORS(ms).back;
   }
   if (ST_HAS_ACTIVE_CSET(ms))
   {
     active_fore = active_cs->fg;
     active_back = active_cs->bg;
+    active_relief_fore = active_cs->hilite;
+    active_relief_back = active_cs->shadow;
   }
   else
   {
@@ -5367,6 +5383,22 @@
     XChangeGC(dpy, ST_MENU_ACTIVE_GC(ms), gcm, &gcv);
   else
     ST_MENU_ACTIVE_GC(ms) = XCreateGC(dpy, Scr.NoFocusWin, gcm, &gcv);
+
+  /* update active relief gc */
+  gcv.foreground = active_relief_fore;
+  gcv.background = active_relief_back;
+  if(ST_MENU_ACTIVE_RELIEF_GC(ms))
+    XChangeGC(dpy, ST_MENU_ACTIVE_RELIEF_GC(ms), gcm, &gcv);
+  else
+    ST_MENU_ACTIVE_RELIEF_GC(ms) = XCreateGC(dpy, Scr.NoFocusWin, gcm, &gcv);
+
+  /* update active shadow gc */
+  gcv.foreground = active_relief_back;
+  gcv.background = active_relief_fore;
+  if(ST_MENU_ACTIVE_SHADOW_GC(ms))
+    XChangeGC(dpy, ST_MENU_ACTIVE_SHADOW_GC(ms), gcm, &gcv);
+  else
+    ST_MENU_ACTIVE_SHADOW_GC(ms) = XCreateGC(dpy, Scr.NoFocusWin, gcm, &gcv);
 
   /* update active back gc */
   gcv.foreground = active_back;
Index: fvwm/fvwm/menus.h
===================================================================
RCS file: /home/cvs/fvwm/fvwm/fvwm/menus.h,v
retrieving revision 1.50
diff -u -r1.50 menus.h
--- fvwm/fvwm/menus.h	2000/01/29 14:09:07	1.50
+++ fvwm/fvwm/menus.h	2000/02/06 23:17:59
@@ -159,6 +159,8 @@
   GC MenuStippleGC;
   GC MenuReliefGC;
   GC MenuShadowGC;
+  GC MenuActiveReliefGC;
+  GC MenuActiveShadowGC;
   ColorPair MenuColors;
   ColorPair MenuActiveColors;
   ColorPair MenuStippleColors;
@@ -246,6 +248,10 @@
 #define MST_MENU_ACTIVE_GC(m)         ((m)->s->ms->look.MenuActiveGC)
 #define ST_MENU_ACTIVE_BACK_GC(s)     ((s)->look.MenuActiveBackGC)
 #define MST_MENU_ACTIVE_BACK_GC(m)    ((m)->s->ms->look.MenuActiveBackGC)
+#define ST_MENU_ACTIVE_RELIEF_GC(s)   ((s)->look.MenuActiveReliefGC)
+#define MST_MENU_ACTIVE_RELIEF_GC(m)  ((m)->s->ms->look.MenuActiveReliefGC)
+#define ST_MENU_ACTIVE_SHADOW_GC(s)   ((s)->look.MenuActiveShadowGC)
+#define MST_MENU_ACTIVE_SHADOW_GC(m)  ((m)->s->ms->look.MenuActiveShadowGC)
 #define ST_MENU_STIPPLE_GC(s)         ((s)->look.MenuStippleGC)
 #define MST_MENU_STIPPLE_GC(m)        ((m)->s->ms->look.MenuStippleGC)
 #define ST_MENU_RELIEF_GC(s)          ((s)->look.MenuReliefGC)

---

From: Dominik Vogt <[email-masked]>
Date: Tue, 08 Feb 2000 11:49:20 +0100

> display the ActiveColorset's highlight and shadow colors.

I'll apply this patch shortly.

Bye

Dominik ^_^

-- 
Dominik Vogt, Agilent Technologies, Dept. BVS
Herrenberger Str.130, 71034 Boeblingen, Germany
phone: 07031/464-4596, fax: 07031/464-3883, [email-masked]
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]