1455 |
XlwMenuWidget mw; |
XlwMenuWidget mw; |
1456 |
{ |
{ |
1457 |
XGCValues xgcv; |
XGCValues xgcv; |
1458 |
XColor temp; |
float scale; |
|
int delta; |
|
1459 |
|
|
1460 |
xgcv.font = mw->menu.font->fid; |
xgcv.font = mw->menu.font->fid; |
1461 |
xgcv.foreground = mw->menu.foreground; |
xgcv.foreground = mw->menu.foreground; |
1477 |
#define BRIGHTNESS(color) (((color) & 0xff) + (((color) >> 8) & 0xff) + (((color) >> 16) & 0xff)) |
#define BRIGHTNESS(color) (((color) & 0xff) + (((color) >> 8) & 0xff) + (((color) >> 16) & 0xff)) |
1478 |
|
|
1479 |
/* Allocate color for disabled menu-items. */ |
/* 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)) |
if (BRIGHTNESS(mw->menu.foreground) < BRIGHTNESS(mw->core.background_pixel)) |
1482 |
{ |
scale = 2.3; |
|
delta = 2.3; |
|
|
temp.pixel = mw->menu.foreground; |
|
|
} |
|
1483 |
else |
else |
1484 |
{ |
scale = 0.55; |
|
delta = 1.2; |
|
|
temp.pixel = mw->core.background_pixel; |
|
|
} |
|
1485 |
|
|
1486 |
x_alloc_lighter_color_for_widget ((Widget) mw, XtDisplay ((Widget) mw), |
x_alloc_lighter_color_for_widget ((Widget) mw, XtDisplay ((Widget) mw), |
1487 |
mw->core.colormap, |
mw->core.colormap, |
1488 |
&temp.pixel, |
&mw->menu.disabled_foreground, |
1489 |
delta, |
scale, |
1490 |
0x8000); |
0x8000); |
|
mw->menu.disabled_foreground = temp.pixel; |
|
1491 |
|
|
1492 |
if (mw->menu.foreground == mw->menu.disabled_foreground |
if (mw->menu.foreground == mw->menu.disabled_foreground |
1493 |
|| mw->core.background_pixel == mw->menu.disabled_foreground) |
|| mw->core.background_pixel == mw->menu.disabled_foreground) |