Skip to content

Commit 39b35df

Browse files
committed
[[ Bug 20839 ]] Replace stipple effect with 50% opacity for disabled motif button text / icons
1 parent e7dd12b commit 39b35df

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

engine/src/buttondraw.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ void MCButton::draw(MCDC *dc, const MCRectangle& p_dirty, bool p_isolated, bool
109109
bool t_isvista = MCmajorosversion >= 0x0600 && MCcurtheme != NULL;
110110

111111
bool t_themed_menu = false;
112+
bool t_use_alpha_layer = false;
112113

113114
if (entry != NULL)
114115
{
@@ -352,7 +353,9 @@ void MCButton::draw(MCDC *dc, const MCRectangle& p_dirty, bool p_isolated, bool
352353
if (MClook == LF_MOTIF)
353354
{
354355
setforeground(dc, DI_FORE, False);
355-
dc->setfillstyle(FillStippled, nil, 0, 0);
356+
dc->setopacity(127);
357+
dc->begin(false);
358+
t_use_alpha_layer = true;
356359
}
357360
else if (IsMacLF())
358361
{
@@ -576,6 +579,9 @@ void MCButton::draw(MCDC *dc, const MCRectangle& p_dirty, bool p_isolated, bool
576579
MCStringRef t_name = MCNameGetString(getname());
577580
drawdirectionaltext(dc, rect.x + leftmargin, starty, t_name, m_font);
578581
}
582+
583+
if (t_use_alpha_layer)
584+
dc->end();
579585

580586
// MW-2012-01-27: [[ Bug 9432 ]] Native GTK handles focus borders itself
581587
// so don't render the win95-style one.
@@ -1608,7 +1614,7 @@ void MCButton::drawtabs(MCDC *dc, MCRectangle &srect)
16081614
{
16091615
case LF_MOTIF:
16101616
setforeground(dc, DI_FORE, False);
1611-
dc->setfillstyle(FillStippled, nil, 0, 0);
1617+
dc->setopacity(127);
16121618
break;
16131619
case LF_MAC:
16141620
dc->setforeground(dc->getgray());

0 commit comments

Comments
 (0)