aboutsummaryrefslogtreecommitdiffstats
path: root/lwlib
diff options
context:
space:
mode:
authorPavel Janík2002-05-07 05:22:48 +0000
committerPavel Janík2002-05-07 05:22:48 +0000
commitef93458b2f8ae0e15c8e85656d68e22bb4f230b3 (patch)
treebcc17825eeba1ff3225f93373b4f336186f9fda2 /lwlib
parentfe75e6d0237955a3d5bb2c23dfad6bb9c36bc17d (diff)
downloademacs-ef93458b2f8ae0e15c8e85656d68e22bb4f230b3.tar.gz
emacs-ef93458b2f8ae0e15c8e85656d68e22bb4f230b3.zip
(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'.
Diffstat (limited to 'lwlib')
-rw-r--r--lwlib/ChangeLog8
-rw-r--r--lwlib/xlwmenu.c19
2 files changed, 14 insertions, 13 deletions
diff --git a/lwlib/ChangeLog b/lwlib/ChangeLog
index b4c18ee2654..8bbd084133c 100644
--- a/lwlib/ChangeLog
+++ b/lwlib/ChangeLog
@@ -1,3 +1,11 @@
12002-05-07 Miles Bader <miles@gnu.org>
2
3 * xlwmenu.c (make_drawing_gcs): The scaling factor passed to
4 `x_alloc_lighter_color_for_widget' is a float, not an int, and
5 it's a multiplicative factor, so the name `delta' is inaccurate.
6 Always base disabled foreground on the normal foreground.
7 Don't use the temporary variable `temp'.
8
12002-05-06 Pavel Jan,Bm(Bk <Pavel@Janik.cz> 92002-05-06 Pavel Jan,Bm(Bk <Pavel@Janik.cz>
2 10
3 * xlwmenu.c (xlwMenuResources): New resource. 11 * xlwmenu.c (xlwMenuResources): New resource.
diff --git a/lwlib/xlwmenu.c b/lwlib/xlwmenu.c
index e712ed80717..b33c35ea5ad 100644
--- a/lwlib/xlwmenu.c
+++ b/lwlib/xlwmenu.c
@@ -1455,8 +1455,7 @@ make_drawing_gcs (mw)
1455 XlwMenuWidget mw; 1455 XlwMenuWidget mw;
1456{ 1456{
1457 XGCValues xgcv; 1457 XGCValues xgcv;
1458 XColor temp; 1458 float scale;
1459 int delta;
1460 1459
1461 xgcv.font = mw->menu.font->fid; 1460 xgcv.font = mw->menu.font->fid;
1462 xgcv.foreground = mw->menu.foreground; 1461 xgcv.foreground = mw->menu.foreground;
@@ -1478,23 +1477,17 @@ make_drawing_gcs (mw)
1478#define BRIGHTNESS(color) (((color) & 0xff) + (((color) >> 8) & 0xff) + (((color) >> 16) & 0xff)) 1477#define BRIGHTNESS(color) (((color) & 0xff) + (((color) >> 8) & 0xff) + (((color) >> 16) & 0xff))
1479 1478
1480 /* Allocate color for disabled menu-items. */ 1479 /* Allocate color for disabled menu-items. */
1480 mw->menu.disabled_foreground = mw->menu.foreground;
1481 if (BRIGHTNESS(mw->menu.foreground) < BRIGHTNESS(mw->core.background_pixel)) 1481 if (BRIGHTNESS(mw->menu.foreground) < BRIGHTNESS(mw->core.background_pixel))
1482 { 1482 scale = 2.3;
1483 delta = 2.3;
1484 temp.pixel = mw->menu.foreground;
1485 }
1486 else 1483 else
1487 { 1484 scale = 0.55;
1488 delta = 1.2;
1489 temp.pixel = mw->core.background_pixel;
1490 }
1491 1485
1492 x_alloc_lighter_color_for_widget ((Widget) mw, XtDisplay ((Widget) mw), 1486 x_alloc_lighter_color_for_widget ((Widget) mw, XtDisplay ((Widget) mw),
1493 mw->core.colormap, 1487 mw->core.colormap,
1494 &temp.pixel, 1488 &mw->menu.disabled_foreground,
1495 delta, 1489 scale,
1496 0x8000); 1490 0x8000);
1497 mw->menu.disabled_foreground = temp.pixel;
1498 1491
1499 if (mw->menu.foreground == mw->menu.disabled_foreground 1492 if (mw->menu.foreground == mw->menu.disabled_foreground
1500 || mw->core.background_pixel == mw->menu.disabled_foreground) 1493 || mw->core.background_pixel == mw->menu.disabled_foreground)