mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-06 14:30:50 -08:00
(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'.
This commit is contained in:
parent
fe75e6d023
commit
ef93458b2f
2 changed files with 14 additions and 13 deletions
|
|
@ -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>
|
2002-05-06 Pavel Jan,Bm(Bk <Pavel@Janik.cz>
|
||||||
|
|
||||||
* xlwmenu.c (xlwMenuResources): New resource.
|
* xlwmenu.c (xlwMenuResources): New resource.
|
||||||
|
|
|
||||||
|
|
@ -1455,8 +1455,7 @@ make_drawing_gcs (mw)
|
||||||
XlwMenuWidget mw;
|
XlwMenuWidget mw;
|
||||||
{
|
{
|
||||||
XGCValues xgcv;
|
XGCValues xgcv;
|
||||||
XColor temp;
|
float scale;
|
||||||
int delta;
|
|
||||||
|
|
||||||
xgcv.font = mw->menu.font->fid;
|
xgcv.font = mw->menu.font->fid;
|
||||||
xgcv.foreground = mw->menu.foreground;
|
xgcv.foreground = mw->menu.foreground;
|
||||||
|
|
@ -1478,23 +1477,17 @@ make_drawing_gcs (mw)
|
||||||
#define BRIGHTNESS(color) (((color) & 0xff) + (((color) >> 8) & 0xff) + (((color) >> 16) & 0xff))
|
#define BRIGHTNESS(color) (((color) & 0xff) + (((color) >> 8) & 0xff) + (((color) >> 16) & 0xff))
|
||||||
|
|
||||||
/* Allocate color for disabled menu-items. */
|
/* Allocate color for disabled menu-items. */
|
||||||
|
mw->menu.disabled_foreground = mw->menu.foreground;
|
||||||
if (BRIGHTNESS(mw->menu.foreground) < BRIGHTNESS(mw->core.background_pixel))
|
if (BRIGHTNESS(mw->menu.foreground) < BRIGHTNESS(mw->core.background_pixel))
|
||||||
{
|
scale = 2.3;
|
||||||
delta = 2.3;
|
|
||||||
temp.pixel = mw->menu.foreground;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
scale = 0.55;
|
||||||
delta = 1.2;
|
|
||||||
temp.pixel = mw->core.background_pixel;
|
|
||||||
}
|
|
||||||
|
|
||||||
x_alloc_lighter_color_for_widget ((Widget) mw, XtDisplay ((Widget) mw),
|
x_alloc_lighter_color_for_widget ((Widget) mw, XtDisplay ((Widget) mw),
|
||||||
mw->core.colormap,
|
mw->core.colormap,
|
||||||
&temp.pixel,
|
&mw->menu.disabled_foreground,
|
||||||
delta,
|
scale,
|
||||||
0x8000);
|
0x8000);
|
||||||
mw->menu.disabled_foreground = temp.pixel;
|
|
||||||
|
|
||||||
if (mw->menu.foreground == mw->menu.disabled_foreground
|
if (mw->menu.foreground == mw->menu.disabled_foreground
|
||||||
|| mw->core.background_pixel == mw->menu.disabled_foreground)
|
|| mw->core.background_pixel == mw->menu.disabled_foreground)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue