diff options
author | Pavel Janík <Pavel@Janik.cz> | 2002-05-07 05:22:48 +0000 |
---|---|---|
committer | Pavel Janík <Pavel@Janik.cz> | 2002-05-07 05:22:48 +0000 |
commit | ef93458b2f8ae0e15c8e85656d68e22bb4f230b3 (patch) | |
tree | bcc17825eeba1ff3225f93373b4f336186f9fda2 /lwlib | |
parent | fe75e6d0237955a3d5bb2c23dfad6bb9c36bc17d (diff) | |
download | emacs-ef93458b2f8ae0e15c8e85656d68e22bb4f230b3.tar.gz |
(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/ChangeLog | 8 | ||||
-rw-r--r-- | lwlib/xlwmenu.c | 19 |
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 @@ +2002-05-07 Miles Bader <miles@gnu.org> + + * xlwmenu.c (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'. + 2002-05-06 Pavel Jan,Bm(Bk <Pavel@Janik.cz> * 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) 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 @@ make_drawing_gcs (mw) #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) |