tdf#92243 Read menu highlight text colour correctly from GTK theme
Change-Id: Iade050c8504a1cc65b5ac345141da32898e7ebff Reviewed-on: https://gerrit.libreoffice.org/16887 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
committed by
Caolán McNamara
parent
5cf4deebeb
commit
ae4ec7a75b
@@ -1853,12 +1853,11 @@ void Menu::ImplPaint(vcl::RenderContext& rRenderContext,
|
|||||||
rRenderContext.SetTextColor(rSettings.GetMenuBarRolloverTextColor());
|
rRenderContext.SetTextColor(rSettings.GetMenuBarRolloverTextColor());
|
||||||
else if (bHighlighted)
|
else if (bHighlighted)
|
||||||
rRenderContext.SetTextColor(rSettings.GetMenuBarHighlightTextColor());
|
rRenderContext.SetTextColor(rSettings.GetMenuBarHighlightTextColor());
|
||||||
|
else
|
||||||
|
rRenderContext.SetTextColor(rSettings.GetMenuBarTextColor());
|
||||||
}
|
}
|
||||||
else
|
else if (bHighlighted)
|
||||||
{
|
rRenderContext.SetTextColor(rSettings.GetMenuHighlightTextColor());
|
||||||
if (bHighlighted)
|
|
||||||
rRenderContext.SetTextColor(rSettings.GetMenuHighlightTextColor());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Point aPos(aTopLeft);
|
Point aPos(aTopLeft);
|
||||||
|
@@ -4017,8 +4017,8 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
|
|||||||
|
|
||||||
aTextColor = aStyleSet.GetPersonaMenuBarTextColor().get_value_or( getColor( pMenubarStyle->fg[GTK_STATE_NORMAL] ) );
|
aTextColor = aStyleSet.GetPersonaMenuBarTextColor().get_value_or( getColor( pMenubarStyle->fg[GTK_STATE_NORMAL] ) );
|
||||||
aStyleSet.SetMenuBarTextColor( aTextColor );
|
aStyleSet.SetMenuBarTextColor( aTextColor );
|
||||||
aStyleSet.SetMenuBarRolloverTextColor( aTextColor );
|
aStyleSet.SetMenuBarRolloverTextColor(getColor(pMenubarStyle->fg[GTK_STATE_PRELIGHT]));
|
||||||
aStyleSet.SetMenuBarHighlightTextColor(aStyleSet.GetMenuHighlightTextColor());
|
aStyleSet.SetMenuBarHighlightTextColor(getColor(pMenubarStyle->fg[GTK_STATE_SELECTED]));
|
||||||
|
|
||||||
#if OSL_DEBUG_LEVEL > 1
|
#if OSL_DEBUG_LEVEL > 1
|
||||||
std::fprintf( stderr, "==\n" );
|
std::fprintf( stderr, "==\n" );
|
||||||
@@ -4049,9 +4049,7 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
|
|||||||
}
|
}
|
||||||
|
|
||||||
aHighlightColor = getColor( pMenuItemStyle->bg[ GTK_STATE_SELECTED ] );
|
aHighlightColor = getColor( pMenuItemStyle->bg[ GTK_STATE_SELECTED ] );
|
||||||
aHighlightTextColor = getColor( pMenuTextStyle->fg[ GTK_STATE_PRELIGHT ] );
|
aHighlightTextColor = getColor( pMenuItemStyle->fg[ GTK_STATE_SELECTED ] );
|
||||||
if( aHighlightColor == aHighlightTextColor )
|
|
||||||
aHighlightTextColor = (aHighlightColor.GetLuminance() < 128) ? Color( COL_WHITE ) : Color( COL_BLACK );
|
|
||||||
aStyleSet.SetMenuHighlightColor( aHighlightColor );
|
aStyleSet.SetMenuHighlightColor( aHighlightColor );
|
||||||
aStyleSet.SetMenuHighlightTextColor( aHighlightTextColor );
|
aStyleSet.SetMenuHighlightTextColor( aHighlightTextColor );
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user