summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@suse.cz>2013-01-04 02:46:44 +0100
committerPetr Mladek <pmladek@suse.cz>2013-01-08 16:12:46 +0100
commit9bf06ab84fa4c2a3c69676d8a4a2f222bf204db3 (patch)
tree0bb336ca3b90b95d8248ea7ecca591f28eeae3bd /vcl
parent2b98abcb30a61058af54e2a6e17126398507fc14 (diff)
Personas: Make the Persona working in the top docking area too.
Change-Id: I1d3986675ceb7a2748a77b736beb8a654a514e0d 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')
-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();