summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@suse.cz>2013-01-01 22:28:21 +0100
committerJan Holesovsky <kendy@suse.cz>2013-03-04 16:20:16 +0100
commite752b2eb39be1cb0c34cfb62583e78200759177b (patch)
treea7cb19d9aef3ad9b536a1d8253c6c8dfe9165fd3 /vcl
parentdfd14eb2803b353f653d5817d9239da691598217 (diff)
Personas: Make the Persona in the menubar working.
Change-Id: I21a45159f6b27aa7beff5ec07530b14480675729
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/window/menu.cxx61
-rw-r--r--vcl/win/source/gdi/salnativewidgets-luna.cxx2
2 files changed, 45 insertions, 18 deletions
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 3b4ac0d693e2..53a15706f8dd 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -3865,7 +3865,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
}
@@ -5508,13 +5517,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
@@ -5538,12 +5553,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
@@ -5773,13 +5794,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() );
diff --git a/vcl/win/source/gdi/salnativewidgets-luna.cxx b/vcl/win/source/gdi/salnativewidgets-luna.cxx
index 685249bff785..582767e3b8dc 100644
--- a/vcl/win/source/gdi/salnativewidgets-luna.cxx
+++ b/vcl/win/source/gdi/salnativewidgets-luna.cxx
@@ -461,7 +461,7 @@ void ImplConvertSpinbuttonValues( int nControlPart, const ControlState& rState,
}
/// Draw an own toolbar style on Windows Vista or later, looks better there
-void impl_drawAeroToolbar( HDC hDC, RECT rc, bool bHorizontal )
+static void impl_drawAeroToolbar( HDC hDC, RECT rc, bool bHorizontal )
{
if ( rc.top == 0 && bHorizontal )
{