diff options
author | Isamu Mogi <saturday6c@gmail.com> | 2013-05-24 09:47:20 +0900 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2013-05-27 06:37:09 +0000 |
commit | 8645239c91dbd7d56691ccdc91118d24eb7df1bc (patch) | |
tree | f950d32d657d4466730d368ac7553a10b66e1233 /vcl/unx/kde/salnativewidgets-kde.cxx | |
parent | 97852d41dd3c7a9c08fdf0d6f0340536e9e3dcae (diff) |
vcl: Check SH_MenuBar_MouseTracking when menubar is drawn on KDE
If QStyle::SH_MenuBar_MouseTracking is 0, it makes a mouse rollover
effect minimize. By this, a menubar item of CDE and Motif styles becomes
closer to standard behavior.
Change-Id: I87dccbd30bf7b9f0d82d1a6e67355c1b25d22dc8
Reviewed-on: https://gerrit.libreoffice.org/4018
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
Diffstat (limited to 'vcl/unx/kde/salnativewidgets-kde.cxx')
-rw-r--r-- | vcl/unx/kde/salnativewidgets-kde.cxx | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/vcl/unx/kde/salnativewidgets-kde.cxx b/vcl/unx/kde/salnativewidgets-kde.cxx index 85b9a148552c..e1923ac39502 100644 --- a/vcl/unx/kde/salnativewidgets-kde.cxx +++ b/vcl/unx/kde/salnativewidgets-kde.cxx @@ -777,7 +777,8 @@ sal_Bool WidgetPainter::drawStyledWidget( QWidget *pWidget, int nMenuItem = ( nStyle & QStyle::Style_Enabled )? m_nMenuBarEnabledItem: m_nMenuBarDisabledItem; QMenuItem *pMenuItem = static_cast<QMenuBar*>( pWidget )->findItem( nMenuItem ); - if ( nStyle & QStyle::Style_MouseOver ) + if ( ( nStyle & QStyle::Style_MouseOver ) + && kapp->style().styleHint( QStyle::SH_MenuBar_MouseTracking ) ) nStyle |= QStyle::Style_Active; if ( nStyle & QStyle::Style_Selected ) @@ -1984,9 +1985,7 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings ) aStyleSettings.SetMenuBarTextColor( aMenuFore ); aStyleSettings.SetMenuColor( aMenuBack ); aStyleSettings.SetMenuBarColor( aMenuBack ); - aStyleSettings.SetMenuHighlightColor( toColor ( qMenuCG.highlight() ) ); - aStyleSettings.SetMenuBarRolloverColor( toColor ( qMenuCG.highlight() ) ); // Menu items higlight text color, theme specific if ( kapp->style().inherits( "HighContrastStyle" ) || @@ -2002,15 +2001,22 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings ) // set special menubar higlight text color if ( kapp->style().inherits( "HighContrastStyle" ) ) - { ImplGetSVData()->maNWFData.maMenuBarHighlightTextColor = toColor( qMenuCG.highlightedText() ); - aStyleSettings.SetMenuBarRolloverTextColor( toColor( qMenuCG.highlightedText() ) ); + else + ImplGetSVData()->maNWFData.maMenuBarHighlightTextColor = aMenuFore; + + // set menubar rollover color + if ( kapp->style().styleHint( QStyle::SH_MenuBar_MouseTracking ) ) + { + aStyleSettings.SetMenuBarRolloverColor( toColor ( qMenuCG.highlight() ) ); + aStyleSettings.SetMenuBarRolloverTextColor( ImplGetSVData()->maNWFData.maMenuBarHighlightTextColor ); } else { - ImplGetSVData()->maNWFData.maMenuBarHighlightTextColor = aMenuFore; + aStyleSettings.SetMenuBarRolloverColor( aMenuBack ); aStyleSettings.SetMenuBarRolloverTextColor( aMenuFore ); } + // Font aFont = toFont( pMenuBar->font(), rSettings.GetUILanguageTag().getLocale() ); aStyleSettings.SetMenuFont( aFont ); |