diff options
-rw-r--r-- | vcl/unx/kde/salnativewidgets-kde.cxx | 18 | ||||
-rw-r--r-- | vcl/unx/kde4/KDESalFrame.cxx | 15 | ||||
-rw-r--r-- | vcl/unx/kde4/KDESalGraphics.cxx | 3 |
3 files changed, 23 insertions, 13 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 ); diff --git a/vcl/unx/kde4/KDESalFrame.cxx b/vcl/unx/kde4/KDESalFrame.cxx index fee3ff128d90..be1fb61d28ff 100644 --- a/vcl/unx/kde4/KDESalFrame.cxx +++ b/vcl/unx/kde4/KDESalFrame.cxx @@ -301,21 +301,24 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings ) style.SetMenuBarTextColor( aMenuFore ); style.SetMenuColor( aMenuBack ); style.SetMenuBarColor( aMenuBack ); - style.SetMenuHighlightColor( toColor ( qMenuCG.color( QPalette::Highlight ) ) ); - style.SetMenuBarRolloverColor( toColor ( qMenuCG.color( QPalette::Highlight ) ) ); - style.SetMenuHighlightTextColor( aMenuFore ); // set special menubar higlight text color if ( kapp->style()->inherits( "HighContrastStyle" ) ) - { ImplGetSVData()->maNWFData.maMenuBarHighlightTextColor = toColor( qMenuCG.color( QPalette::HighlightedText ) ); - style.SetMenuBarRolloverTextColor( toColor( qMenuCG.color( QPalette::HighlightedText ) ) ); + else + ImplGetSVData()->maNWFData.maMenuBarHighlightTextColor = aMenuFore; + + // set menubar rollover color + if ( pMenuBar->style()->styleHint( QStyle::SH_MenuBar_MouseTracking ) ) + { + style.SetMenuBarRolloverColor( toColor ( qMenuCG.color( QPalette::Highlight ) ) ); + style.SetMenuBarRolloverTextColor( ImplGetSVData()->maNWFData.maMenuBarHighlightTextColor ); } else { - ImplGetSVData()->maNWFData.maMenuBarHighlightTextColor = aMenuFore; + style.SetMenuBarRolloverColor( aMenuBack ); style.SetMenuBarRolloverTextColor( aMenuFore ); } diff --git a/vcl/unx/kde4/KDESalGraphics.cxx b/vcl/unx/kde4/KDESalGraphics.cxx index 5434e7c227ec..9caeae9b3f3a 100644 --- a/vcl/unx/kde4/KDESalGraphics.cxx +++ b/vcl/unx/kde4/KDESalGraphics.cxx @@ -297,7 +297,8 @@ sal_Bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part, if (part == PART_MENU_ITEM) { QStyleOptionMenuItem option; - if ( nControlState & CTRL_STATE_ROLLOVER ) + if ( ( nControlState & CTRL_STATE_ROLLOVER ) + && kapp->style()->styleHint( QStyle::SH_MenuBar_MouseTracking ) ) option.state |= QStyle::State_Selected; if ( nControlState & CTRL_STATE_SELECTED ) // Passing State_Sunken is currently not documented. |