https://bugs.documentfoundation.org/show_bug.cgi?id=92243
Bug ID: 92243
Summary: Menu highlighting incorrect with libreoffice-gtk
Product: LibreOffice
Version: 4.3.3.2 release
Hardware: Other
OS: All
Status: UNCONFIRMED
Severity: normal
Priority: medium
Component: UI
Assignee: [email protected]
Reporter: [email protected]
If the libreoffice-gtk library is loaded, the menu highlight colours are not
correctly loaded from the GTK theme. The highlight colour itself is correct,
but the foreground colour used by native GTK applications is ignored. The
following patch fixes this and uses the correct text highlight colour:
--- vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
+++ vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
@@ -3870,9 +3875,7 @@ void GtkSalGraphics::updateSettings( AllSettings&
rSettings )
}
aHighlightColor = getColor( pMenuItemStyle->bg[ GTK_STATE_SELECTED ] );
- aHighlightTextColor = getColor( pMenuTextStyle->fg[ GTK_STATE_PRELIGHT ]
);
- if( aHighlightColor == aHighlightTextColor )
- aHighlightTextColor = (aHighlightColor.GetLuminance() < 128) ? Color(
COL_WHITE ) : Color( COL_BLACK );
+ aHighlightTextColor = getColor( pMenuItemStyle->fg[ GTK_STATE_SELECTED ]
);
aStyleSet.SetMenuHighlightColor( aHighlightColor );
aStyleSet.SetMenuHighlightTextColor( aHighlightTextColor );
However, this reveals another bug, which is that the highlight colour is also
used for the menu header when active, which should not happen in a native GTK
application. This is fixed by the following patch:
--- vcl/source/window/menu.cxx
+++ vcl/source/window/menu.cxx
@@ -2642,6 +2642,8 @@ void Menu::ImplPaint( Window* pWin, sal_uInt16 nBorder,
long nStartY, MenuItemDa
{
if ( bIsMenuBar && bRollover )
pWin->SetTextColor(
rSettings.GetMenuBarRolloverTextColor() );
+ else if ( bIsMenuBar )
+ pWin->SetTextColor( rSettings.GetMenuBarTextColor() );
else if ( bHighlighted )
pWin->SetTextColor( rSettings.GetMenuHighlightTextColor()
);
}
--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs