Kaydet (Commit) c6fc963c authored tarafından Jan-Marek Glogowski's avatar Jan-Marek Glogowski

KDE4 enable and handle rollover menubar

Change-Id: Ice2657c8e8ecccb67d1b14292514a42ff37caa39
üst 843b9d5d
...@@ -46,6 +46,8 @@ void KDEData::initNWF() ...@@ -46,6 +46,8 @@ void KDEData::initNWF()
pSVData->maNWFData.mbDockingAreaSeparateTB = true; pSVData->maNWFData.mbDockingAreaSeparateTB = true;
// no borders for menu, theming does that // no borders for menu, theming does that
pSVData->maNWFData.mbFlatMenu = true; pSVData->maNWFData.mbFlatMenu = true;
// Qt theme engines may support a rollover menubar
pSVData->maNWFData.mbRolloverMenubar = true;
// Styled menus need additional space // Styled menus need additional space
QStyle *style = QApplication::style(); QStyle *style = QApplication::style();
......
...@@ -208,6 +208,10 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings ) ...@@ -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 aFore = toColor( pal.color( QPalette::Active, QPalette::WindowText ) );
Color aBack = toColor( pal.color( QPalette::Active, QPalette::Window ) ); Color aBack = toColor( pal.color( QPalette::Active, QPalette::Window ) );
Color aText = toColor( pal.color( QPalette::Active, QPalette::Text ) ); Color aText = toColor( pal.color( QPalette::Active, QPalette::Text ) );
...@@ -215,6 +219,9 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings ) ...@@ -215,6 +219,9 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings )
Color aButn = toColor( pal.color( QPalette::Active, QPalette::ButtonText ) ); Color aButn = toColor( pal.color( QPalette::Active, QPalette::ButtonText ) );
Color aMid = toColor( pal.color( QPalette::Active, QPalette::Mid ) ); Color aMid = toColor( pal.color( QPalette::Active, QPalette::Mid ) );
Color aHigh = toColor( pal.color( QPalette::Active, QPalette::Highlight ) ); Color aHigh = toColor( pal.color( QPalette::Active, QPalette::Highlight ) );
Color aHighText = toColor( pal.color( QPalette::Active, QPalette::HighlightedText ) );
style.SetSkipDisabledInMenus( TRUE );
// Foreground // Foreground
style.SetRadioCheckTextColor( aFore ); style.SetRadioCheckTextColor( aFore );
...@@ -257,7 +264,7 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings ) ...@@ -257,7 +264,7 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings )
// Selection // Selection
style.SetHighlightColor( aHigh ); style.SetHighlightColor( aHigh );
style.SetHighlightTextColor( toColor(pal.color( QPalette::HighlightedText)) ); style.SetHighlightTextColor( aHighText );
// Tooltip // Tooltip
style.SetHelpColor( toColor( QToolTip::palette().color( QPalette::Active, QPalette::ToolTipBase ))); style.SetHelpColor( toColor( QToolTip::palette().color( QPalette::Active, QPalette::ToolTipBase )));
...@@ -269,7 +276,6 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings ) ...@@ -269,7 +276,6 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings )
style.SetAppFont( aFont ); style.SetAppFont( aFont );
style.SetMenuFont( aFont ); // will be changed according to pMenuBar style.SetMenuFont( aFont ); // will be changed according to pMenuBar
//style.SetToolFont( aFont ); //already set above
style.SetLabelFont( aFont ); style.SetLabelFont( aFont );
style.SetInfoFont( aFont ); style.SetInfoFont( aFont );
style.SetRadioCheckFont( aFont ); style.SetRadioCheckFont( aFont );
...@@ -291,13 +297,6 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings ) ...@@ -291,13 +297,6 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings )
int flash_time = QApplication::cursorFlashTime(); int flash_time = QApplication::cursorFlashTime();
style.SetCursorBlinkTime( flash_time != 0 ? flash_time/2 : STYLE_CURSOR_NOBLINKTIME ); 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 // Menu text and background color, theme specific
Color aMenuFore = toColor( qMenuCG.color( QPalette::WindowText ) ); Color aMenuFore = toColor( qMenuCG.color( QPalette::WindowText ) );
Color aMenuBack = toColor( qMenuCG.color( QPalette::Window ) ); Color aMenuBack = toColor( qMenuCG.color( QPalette::Window ) );
...@@ -307,7 +306,7 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings ) ...@@ -307,7 +306,7 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings )
style.SetMenuColor( aMenuBack ); style.SetMenuColor( aMenuBack );
style.SetMenuBarColor( aMenuBack ); style.SetMenuBarColor( aMenuBack );
style.SetMenuHighlightColor( toColor ( qMenuCG.color( QPalette::Highlight ) ) ); style.SetMenuHighlightColor( toColor ( qMenuCG.color( QPalette::Highlight ) ) );
style.SetMenuHighlightTextColor( aMenuFore ); style.SetMenuHighlightTextColor( toColor ( qMenuCG.color( QPalette::HighlightedText ) ) );
// set special menubar higlight text color // set special menubar higlight text color
if ( QApplication::style()->inherits( "HighContrastStyle" ) ) if ( QApplication::style()->inherits( "HighContrastStyle" ) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment