diff options
Diffstat (limited to 'vcl/source/window/menu.cxx')
-rw-r--r-- | vcl/source/window/menu.cxx | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index ccf75dbd59b3..ebd4475a80fc 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -557,7 +557,7 @@ public: void DataChanged( const DataChangedEvent& rDCEvt ); - void SetImages( long nMaxHeight = 0 ); + void SetImages( long nMaxHeight = 0, bool bForce = false ); void calcMinSize(); Size getMinSize(); @@ -591,7 +591,7 @@ void DecoToolBox::DataChanged( const DataChangedEvent& rDCEvt ) { calcMinSize(); SetBackground(); - SetImages(); + SetImages( 0, true); } } @@ -625,7 +625,7 @@ Size DecoToolBox::getMinSize() return maMinSize; } -void DecoToolBox::SetImages( long nMaxHeight ) +void DecoToolBox::SetImages( long nMaxHeight, bool bForce ) { long border = getMinSize().Height() - maImage.GetSizePixel().Height(); @@ -635,13 +635,13 @@ void DecoToolBox::SetImages( long nMaxHeight ) if( nMaxHeight < getMinSize().Height() ) nMaxHeight = getMinSize().Height(); - if( lastSize != nMaxHeight - border ) + if( (lastSize != nMaxHeight - border) || bForce ) { lastSize = nMaxHeight - border; Color aEraseColor( 255, 255, 255, 255 ); BitmapEx aBmpExDst( maImage.GetBitmapEx() ); - BitmapEx aBmpExSrc( GetSettings().GetStyleSettings().GetMenuBarColor().IsDark() ? + BitmapEx aBmpExSrc( GetSettings().GetStyleSettings().GetHighContrastMode() ? maImageHC.GetBitmapEx() : aBmpExDst ); aEraseColor.SetTransparency( 255 ); @@ -2731,7 +2731,14 @@ void Menu::ImplPaint( Window* pWin, USHORT nBorder, long nStartY, MenuItemData* } if ( pThisItemOnly && bHighlighted ) - pWin->SetTextColor( rSettings.GetMenuTextColor() ); + { + // This restores the normal menu or menu bar text + // color for when it is no longer highlighted. + if ( bIsMenuBar ) + pWin->SetTextColor( rSettings.GetMenuBarTextColor() ); + else + pWin->SetTextColor( rSettings.GetMenuTextColor() ); + } } if( bLayout ) { @@ -3787,7 +3794,10 @@ static void ImplInitMenuWindow( Window* pWin, BOOL bFont, BOOL bMenuBar ) pWin->SetBackground( Wallpaper( rStyleSettings.GetMenuColor() ) ); } - pWin->SetTextColor( rStyleSettings.GetMenuTextColor() ); + if ( bMenuBar ) + pWin->SetTextColor( rStyleSettings.GetMenuBarTextColor() ); + else + pWin->SetTextColor( rStyleSettings.GetMenuTextColor() ); pWin->SetTextFillColor(); pWin->SetLineColor(); } @@ -5056,7 +5066,7 @@ MenuBarWindow::MenuBarWindow( Window* pParent ) : aCloser.SetParentClipMode( PARENTCLIPMODE_NOCLIP ); aCloser.InsertItem( IID_DOCUMENTCLOSE, - GetSettings().GetStyleSettings().GetMenuBarColor().IsDark() ? aCloser.maImageHC : aCloser.maImage, 0 ); + GetSettings().GetStyleSettings().GetHighContrastMode() ? aCloser.maImageHC : aCloser.maImage, 0 ); aCloser.SetSelectHdl( LINK( this, MenuBarWindow, CloserHdl ) ); aCloser.AddEventListener( LINK( this, MenuBarWindow, ToolboxEventHdl ) ); aCloser.SetQuickHelpText( IID_DOCUMENTCLOSE, XubString( ResId( SV_HELPTEXT_CLOSEDOCUMENT, *pResMgr ) ) ); @@ -5697,7 +5707,7 @@ void MenuBarWindow::Paint( const Rectangle& ) // in high contrast mode draw a separating line on the lower edge if( ! IsNativeControlSupported( CTRL_MENUBAR, PART_ENTIRE_CONTROL) && - GetSettings().GetStyleSettings().GetFaceColor().IsDark() ) + GetSettings().GetStyleSettings().GetHighContrastMode() ) { Push( PUSH_LINECOLOR | PUSH_MAPMODE ); SetLineColor( Color( COL_WHITE ) ); |