diff options
author | Jan Holesovsky <kendy@suse.cz> | 2013-01-01 22:28:21 +0100 |
---|---|---|
committer | Petr Mladek <pmladek@suse.cz> | 2013-01-08 16:12:46 +0100 |
commit | 2b98abcb30a61058af54e2a6e17126398507fc14 (patch) | |
tree | 168c4dd44a501627761e02b125d39f79fc9fad9e /vcl/source | |
parent | a00ef2b9e75394e60defb7b95f2216b271391ea7 (diff) |
Personas: Make the Persona in the menubar working.
Change-Id: I21a45159f6b27aa7beff5ec07530b14480675729
Signed-off-by: Cor Nouws <oolst@nouenoff.nl>
Signed-off-by: Olivier Hallot <olivier.hallot@documentfoundation.org>
Signed-off-by: Adolfo Jayme Barrientos <fitoschido@ubuntu.com>
Signed-off-by: Michael Meeks <michael.meeks@suse.com>
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/window/menu.cxx | 61 |
1 files changed, 44 insertions, 17 deletions
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index 926438c17fc1..64fe254e929c 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -3856,7 +3856,16 @@ static void ImplInitMenuWindow( Window* pWin, sal_Bool bFont, sal_Bool bMenuBar pWin->SetPointFont( rStyleSettings.GetMenuFont() ); if( bMenuBar ) { - if( pWin->IsNativeControlSupported( CTRL_MENUBAR, PART_ENTIRE_CONTROL ) ) + const BitmapEx* pPersonaBitmap = rStyleSettings.GetPersonaHeader(); + if ( pPersonaBitmap != NULL ) + { + Wallpaper aWallpaper( *pPersonaBitmap ); + aWallpaper.SetStyle( WALLPAPER_TOPRIGHT ); + pWin->SetBackground( aWallpaper ); + pWin->SetPaintTransparent( sal_False ); + pWin->SetParentClipMode( 0 ); + } + else if ( pWin->IsNativeControlSupported( CTRL_MENUBAR, PART_ENTIRE_CONTROL ) ) { pWin->SetBackground(); // background will be drawn by NWF } @@ -5494,13 +5503,19 @@ void MenuBarWindow::HighlightItem( sal_uInt16 nPos, sal_Bool bHighlight ) MenubarValue aControlValue; aControlValue.maTopDockingAreaHeight = ImplGetTopDockingAreaHeight( this ); - Point tmp(0,0); - Rectangle aBgRegion( tmp, GetOutputSizePixel() ); - DrawNativeControl( CTRL_MENUBAR, PART_ENTIRE_CONTROL, - aBgRegion, - CTRL_STATE_ENABLED, - aControlValue, - OUString() ); + if ( GetSettings().GetStyleSettings().GetPersonaHeader() ) + Erase(); + else + { + Point tmp(0,0); + Rectangle aBgRegion( tmp, GetOutputSizePixel() ); + DrawNativeControl( CTRL_MENUBAR, PART_ENTIRE_CONTROL, + aBgRegion, + CTRL_STATE_ENABLED, + aControlValue, + OUString() ); + } + ImplAddNWFSeparator( this, aControlValue ); // draw selected item @@ -5524,12 +5539,18 @@ void MenuBarWindow::HighlightItem( sal_uInt16 nPos, sal_Bool bHighlight ) MenubarValue aMenubarValue; aMenubarValue.maTopDockingAreaHeight = ImplGetTopDockingAreaHeight( this ); - // use full window size to get proper gradient - // but clip accordingly - Point aPt; - Rectangle aCtrlRect( aPt, GetOutputSizePixel() ); + if ( GetSettings().GetStyleSettings().GetPersonaHeader() ) + Erase( aRect ); + else + { + // use full window size to get proper gradient + // but clip accordingly + Point aPt; + Rectangle aCtrlRect( aPt, GetOutputSizePixel() ); + + DrawNativeControl( CTRL_MENUBAR, PART_ENTIRE_CONTROL, aCtrlRect, CTRL_STATE_ENABLED, aMenubarValue, rtl::OUString() ); + } - DrawNativeControl( CTRL_MENUBAR, PART_ENTIRE_CONTROL, aCtrlRect, CTRL_STATE_ENABLED, aMenubarValue, rtl::OUString() ); ImplAddNWFSeparator( this, aMenubarValue ); } else @@ -5751,13 +5772,19 @@ void MenuBarWindow::Paint( const Rectangle& ) if( IsNativeControlSupported( CTRL_MENUBAR, PART_ENTIRE_CONTROL) ) { - Point aPt; - Rectangle aCtrlRegion( aPt, GetOutputSizePixel() ); - MenubarValue aMenubarValue; aMenubarValue.maTopDockingAreaHeight = ImplGetTopDockingAreaHeight( this ); - DrawNativeControl( CTRL_MENUBAR, PART_ENTIRE_CONTROL, aCtrlRegion, CTRL_STATE_ENABLED, aMenubarValue, rtl::OUString() ); + if ( GetSettings().GetStyleSettings().GetPersonaHeader() ) + Erase(); + else + { + Point aPt; + Rectangle aCtrlRegion( aPt, GetOutputSizePixel() ); + + DrawNativeControl( CTRL_MENUBAR, PART_ENTIRE_CONTROL, aCtrlRegion, CTRL_STATE_ENABLED, aMenubarValue, rtl::OUString() ); + } + ImplAddNWFSeparator( this, aMenubarValue ); } SetFillColor( GetSettings().GetStyleSettings().GetMenuColor() ); |