summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@suse.cz>2013-01-04 02:46:44 +0100
committerJan Holesovsky <kendy@suse.cz>2013-01-04 22:02:52 +0100
commit3fc8c364cc58429bd840f47a80a9258de21ed131 (patch)
treefdf04c0b0490dbb21b4b98b3a2d58d24e50cd703
parent46505e82ad0f2bd9586e6c853e6e68635dc54007 (diff)
Personas: Make the Persona working in the top docking area too.
Change-Id: I1d3986675ceb7a2748a77b736beb8a654a514e0d
-rw-r--r--vcl/source/window/dockingarea.cxx28
1 files changed, 26 insertions, 2 deletions
diff --git a/vcl/source/window/dockingarea.cxx b/vcl/source/window/dockingarea.cxx
index 8f2adee9bab3..81f67db697b0 100644
--- a/vcl/source/window/dockingarea.cxx
+++ b/vcl/source/window/dockingarea.cxx
@@ -50,7 +50,27 @@ DockingAreaWindow::ImplData::~ImplData()
static void ImplInitBackground( DockingAreaWindow* pThis )
{
- if( !pThis->IsNativeControlSupported( CTRL_TOOLBAR, PART_ENTIRE_CONTROL ) )
+ const BitmapEx* pPersonaBitmap = pThis->GetSettings().GetStyleSettings().GetPersonaHeader();
+ if ( pPersonaBitmap != NULL && pThis->GetAlign() == WINDOWALIGN_TOP )
+ {
+ Wallpaper aWallpaper( *pPersonaBitmap );
+ aWallpaper.SetStyle( WALLPAPER_TOPRIGHT );
+
+ // we need to shift the bitmap vertically so that it spans over the
+ // menubar conveniently
+ long nMenubarHeight = 0;
+ SystemWindow *pSysWin = pThis->GetSystemWindow();
+ if ( pSysWin && pSysWin->GetMenuBar() )
+ {
+ Window *pMenubarWin = pSysWin->GetMenuBar()->GetWindow();
+ if ( pMenubarWin )
+ nMenubarHeight = pMenubarWin->GetOutputHeightPixel();
+ }
+ aWallpaper.SetRect( Rectangle( Point( 0, -nMenubarHeight ), Size( pThis->GetOutputWidthPixel(), pThis->GetOutputHeightPixel() + nMenubarHeight ) ) );
+
+ pThis->SetBackground( aWallpaper );
+ }
+ else if( !pThis->IsNativeControlSupported( CTRL_TOOLBAR, PART_ENTIRE_CONTROL ) )
{
Wallpaper aWallpaper;
aWallpaper.SetStyle( WALLPAPER_APPLICATIONGRADIENT );
@@ -127,6 +147,7 @@ void DockingAreaWindow::SetAlign( WindowAlign eNewAlign )
if( eNewAlign != mpImplData->meAlign )
{
mpImplData->meAlign = eNewAlign;
+ ImplInitBackground( this );
Invalidate();
}
}
@@ -153,7 +174,9 @@ void DockingAreaWindow::Paint( const Rectangle& )
}
ControlState nState = CTRL_STATE_ENABLED;
- if( !ImplGetSVData()->maNWFData.mbDockingAreaSeparateTB )
+ if ( GetAlign() == WINDOWALIGN_TOP && GetSettings().GetStyleSettings().GetPersonaHeader() )
+ Erase();
+ else if ( !ImplGetSVData()->maNWFData.mbDockingAreaSeparateTB )
{
// draw a single toolbar background covering the whole docking area
Point tmp;
@@ -231,6 +254,7 @@ void DockingAreaWindow::Paint( const Rectangle& )
void DockingAreaWindow::Resize()
{
+ ImplInitBackground( this );
ImplInvalidateMenubar( this );
if( IsNativeControlSupported( CTRL_TOOLBAR, PART_ENTIRE_CONTROL ) )
Invalidate();