summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2016-09-22 18:35:38 +0200
committerJan-Marek Glogowski <glogow@fbihome.de>2016-09-22 20:13:10 +0200
commitc6fc963c534bc9069ef975246e5d619777b9f570 (patch)
treef4c2e7a66a8e76d0771ca792b28ba6c860cfce5f /vcl
parent843b9d5dba5098c2676491dda66bed31e57f4329 (diff)
KDE4 enable and handle rollover menubar
Change-Id: Ice2657c8e8ecccb67d1b14292514a42ff37caa39
Diffstat (limited to 'vcl')
-rw-r--r--vcl/unx/kde4/KDEData.cxx2
-rw-r--r--vcl/unx/kde4/KDESalFrame.cxx19
2 files changed, 11 insertions, 10 deletions
diff --git a/vcl/unx/kde4/KDEData.cxx b/vcl/unx/kde4/KDEData.cxx
index 71267a020c25..1caf6e87d4d1 100644
--- a/vcl/unx/kde4/KDEData.cxx
+++ b/vcl/unx/kde4/KDEData.cxx
@@ -46,6 +46,8 @@ void KDEData::initNWF()
pSVData->maNWFData.mbDockingAreaSeparateTB = true;
// no borders for menu, theming does that
pSVData->maNWFData.mbFlatMenu = true;
+ // Qt theme engines may support a rollover menubar
+ pSVData->maNWFData.mbRolloverMenubar = true;
// Styled menus need additional space
QStyle *style = QApplication::style();
diff --git a/vcl/unx/kde4/KDESalFrame.cxx b/vcl/unx/kde4/KDESalFrame.cxx
index a1086bafbb66..23a780502b5f 100644
--- a/vcl/unx/kde4/KDESalFrame.cxx
+++ b/vcl/unx/kde4/KDESalFrame.cxx
@@ -208,6 +208,10 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings )
}
}
+ // Menu
+ std::unique_ptr<KMenuBar> pMenuBar = std::unique_ptr<KMenuBar>( new KMenuBar() );
+ QPalette qMenuCG = pMenuBar->palette();
+
Color aFore = toColor( pal.color( QPalette::Active, QPalette::WindowText ) );
Color aBack = toColor( pal.color( QPalette::Active, QPalette::Window ) );
Color aText = toColor( pal.color( QPalette::Active, QPalette::Text ) );
@@ -215,6 +219,9 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings )
Color aButn = toColor( pal.color( QPalette::Active, QPalette::ButtonText ) );
Color aMid = toColor( pal.color( QPalette::Active, QPalette::Mid ) );
Color aHigh = toColor( pal.color( QPalette::Active, QPalette::Highlight ) );
+ Color aHighText = toColor( pal.color( QPalette::Active, QPalette::HighlightedText ) );
+
+ style.SetSkipDisabledInMenus( TRUE );
// Foreground
style.SetRadioCheckTextColor( aFore );
@@ -257,7 +264,7 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings )
// Selection
style.SetHighlightColor( aHigh );
- style.SetHighlightTextColor( toColor(pal.color( QPalette::HighlightedText)) );
+ style.SetHighlightTextColor( aHighText );
// Tooltip
style.SetHelpColor( toColor( QToolTip::palette().color( QPalette::Active, QPalette::ToolTipBase )));
@@ -269,7 +276,6 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings )
style.SetAppFont( aFont );
style.SetMenuFont( aFont ); // will be changed according to pMenuBar
- //style.SetToolFont( aFont ); //already set above
style.SetLabelFont( aFont );
style.SetInfoFont( aFont );
style.SetRadioCheckFont( aFont );
@@ -291,13 +297,6 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings )
int flash_time = QApplication::cursorFlashTime();
style.SetCursorBlinkTime( flash_time != 0 ? flash_time/2 : STYLE_CURSOR_NOBLINKTIME );
- // Menu
- style.SetSkipDisabledInMenus( TRUE );
- std::unique_ptr<KMenuBar> pMenuBar = std::unique_ptr<KMenuBar>( new KMenuBar() );
-
- // Color
- QPalette qMenuCG = pMenuBar->palette();
-
// Menu text and background color, theme specific
Color aMenuFore = toColor( qMenuCG.color( QPalette::WindowText ) );
Color aMenuBack = toColor( qMenuCG.color( QPalette::Window ) );
@@ -307,7 +306,7 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings )
style.SetMenuColor( aMenuBack );
style.SetMenuBarColor( aMenuBack );
style.SetMenuHighlightColor( toColor ( qMenuCG.color( QPalette::Highlight ) ) );
- style.SetMenuHighlightTextColor( aMenuFore );
+ style.SetMenuHighlightTextColor( toColor ( qMenuCG.color( QPalette::HighlightedText ) ) );
// set special menubar higlight text color
if ( QApplication::style()->inherits( "HighContrastStyle" ) )