changeset 45152:0e9984418269

(make_drawing_gcs): The scaling factor passed to `x_alloc_lighter_color_for_widget' is a float, not an int, and it's a multiplicative factor, so the name `delta' is inaccurate. Always base disabled foreground on the normal foreground. Don't use the temporary variable `temp'.
author Pavel Janík <Pavel@Janik.cz>
date Tue, 07 May 2002 05:22:29 +0000
parents e5a353edec82
children 99a48943a879
files lwlib/xlwmenu.c
diffstat 1 files changed, 6 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/lwlib/xlwmenu.c	Mon May 06 21:12:42 2002 +0000
+++ b/lwlib/xlwmenu.c	Tue May 07 05:22:29 2002 +0000
@@ -1455,8 +1455,7 @@
      XlwMenuWidget mw;
 {
   XGCValues xgcv;
-  XColor temp;
-  int delta;
+  float scale;
 
   xgcv.font = mw->menu.font->fid;
   xgcv.foreground = mw->menu.foreground;
@@ -1478,23 +1477,17 @@
 #define BRIGHTNESS(color) (((color) & 0xff) + (((color) >> 8) & 0xff) + (((color) >> 16) & 0xff))
 
   /* Allocate color for disabled menu-items.  */
+  mw->menu.disabled_foreground = mw->menu.foreground;
   if (BRIGHTNESS(mw->menu.foreground) < BRIGHTNESS(mw->core.background_pixel))
-    {
-      delta = 2.3;
-      temp.pixel = mw->menu.foreground;
-    }
+    scale = 2.3;
   else
-    {
-      delta = 1.2;
-      temp.pixel = mw->core.background_pixel;
-    }
+    scale = 0.55;
 
   x_alloc_lighter_color_for_widget ((Widget) mw, XtDisplay ((Widget) mw),
 				    mw->core.colormap,
-				    &temp.pixel,
-				    delta,
+				    &mw->menu.disabled_foreground,
+				    scale,
 				    0x8000);
-  mw->menu.disabled_foreground = temp.pixel;
 
   if (mw->menu.foreground == mw->menu.disabled_foreground
       || mw->core.background_pixel == mw->menu.disabled_foreground)