diff options
author | Michael Jaumann <meta_dev@yahoo.com> | 2014-09-23 12:34:54 +0000 |
---|---|---|
committer | Samuel Mehrbrodt <s.mehrbrodt@gmail.com> | 2014-09-29 17:44:07 +0000 |
commit | 0ed0974298992ae871a8fbe79f856cf2588aeec6 (patch) | |
tree | 3ef38e7bd8cc98824a2912e20357a6f843290708 | |
parent | e5bbc721d6bd5536bdd34f33fc79933a379f2919 (diff) |
fdo#59299 Personas for bottom toolbars
Change-Id: If823964bf3bb67563504db61b6c5d557cab89243
Reviewed-on: https://gerrit.libreoffice.org/11609
Reviewed-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com>
Tested-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com>
-rw-r--r-- | include/vcl/settings.hxx | 2 | ||||
-rw-r--r-- | vcl/source/app/settings.cxx | 11 | ||||
-rw-r--r-- | vcl/source/window/dockingarea.cxx | 17 | ||||
-rw-r--r-- | vcl/source/window/toolbox.cxx | 9 |
4 files changed, 29 insertions, 10 deletions
diff --git a/include/vcl/settings.hxx b/include/vcl/settings.hxx index 10ae6a60854f..fb16ee3cff06 100644 --- a/include/vcl/settings.hxx +++ b/include/vcl/settings.hxx @@ -522,6 +522,8 @@ public: const BitmapEx GetPersonaHeader() const; + const BitmapEx GetPersonaFooter() const; + const boost::optional<Color>& GetPersonaMenuBarTextColor() const; // global switch to allow EdgeBlenging; currently possible for ValueSet and ListBox diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx index 184c3f1db0eb..a4fb97e2c357 100644 --- a/vcl/source/app/settings.cxx +++ b/vcl/source/app/settings.cxx @@ -2116,8 +2116,9 @@ static void setupPersonaHeaderFooter( WhichPersona eWhich, OUString& rHeaderFoot OUString aPersona( officecfg::Office::Common::Misc::Persona::get( xContext ) ); OUString aPersonaSettings( officecfg::Office::Common::Misc::PersonaSettings::get( xContext ) ); - // have the settings changed? - OUString aOldValue( aPersona + ";" + aPersonaSettings ); + // have the settings changed? marks if header /footer prepared before + //should maybe extended to a flag that marks if header /footer /both are loaded + OUString aOldValue= eWhich==PERSONA_HEADER?OUString(aPersona + ";" + aPersonaSettings+";h" ):OUString(aPersona + ";" + aPersonaSettings+";f" ); if ( rHeaderFooter == aOldValue ) return; @@ -2186,6 +2187,12 @@ const BitmapEx StyleSettings::GetPersonaHeader() const return mpData->maPersonaHeaderBitmap; } +const BitmapEx StyleSettings::GetPersonaFooter() const +{ + setupPersonaHeaderFooter( PERSONA_FOOTER, mpData->maPersonaHeaderFooter, mpData->maPersonaFooterBitmap, mpData->maPersonaMenuBarTextColor ); + return mpData->maPersonaFooterBitmap; +} + const boost::optional<Color>& StyleSettings::GetPersonaMenuBarTextColor() const { GetPersonaHeader(); diff --git a/vcl/source/window/dockingarea.cxx b/vcl/source/window/dockingarea.cxx index bda794bc1631..6d6416d6ce04 100644 --- a/vcl/source/window/dockingarea.cxx +++ b/vcl/source/window/dockingarea.cxx @@ -46,12 +46,16 @@ DockingAreaWindow::ImplData::~ImplData() static void ImplInitBackground( DockingAreaWindow* pThis ) { - const BitmapEx& rPersonaBitmap = Application::GetSettings().GetStyleSettings().GetPersonaHeader(); - if ( !rPersonaBitmap.IsEmpty() && pThis->GetAlign() == WINDOWALIGN_TOP ) + const StyleSettings rSetting = Application::GetSettings().GetStyleSettings(); + const BitmapEx& rPersonaBitmap = pThis->GetAlign() == WINDOWALIGN_TOP ? rSetting.GetPersonaHeader() :rSetting.GetPersonaFooter(); + if ( !rPersonaBitmap.IsEmpty() &&( pThis->GetAlign() == WINDOWALIGN_TOP|| pThis->GetAlign()==WINDOWALIGN_BOTTOM ) ) { Wallpaper aWallpaper( rPersonaBitmap ); - aWallpaper.SetStyle( WALLPAPER_TOPRIGHT ); - aWallpaper.SetColor( Application::GetSettings().GetStyleSettings().GetWorkspaceColor() ); + if(pThis->GetAlign()==WINDOWALIGN_TOP ) + aWallpaper.SetStyle( WALLPAPER_TOPRIGHT ); + else + aWallpaper.SetStyle( WALLPAPER_BOTTOMRIGHT ); + aWallpaper.SetColor( rSetting.GetWorkspaceColor() ); // we need to shift the bitmap vertically so that it spans over the // menubar conveniently @@ -155,6 +159,7 @@ void DockingAreaWindow::Paint( const Rectangle& ) if( IsNativeControlSupported( CTRL_TOOLBAR, PART_ENTIRE_CONTROL ) ) { ToolbarValue aControlValue; + const StyleSettings rSetting = Application::GetSettings().GetStyleSettings(); if( GetAlign() == WINDOWALIGN_TOP && ImplGetSVData()->maNWFData.mbMenuBarDockingAreaCommonBG ) { @@ -162,9 +167,11 @@ void DockingAreaWindow::Paint( const Rectangle& ) // useful for special gradient effects that should cover both windows aControlValue.mbIsTopDockingArea = true; } + ControlState nState = CTRL_STATE_ENABLED; + const bool isFooter = GetAlign() == WINDOWALIGN_BOTTOM && !rSetting.GetPersonaFooter().IsEmpty(); - if ( GetAlign() == WINDOWALIGN_TOP && !Application::GetSettings().GetStyleSettings().GetPersonaHeader().IsEmpty() ) + if (( GetAlign() == WINDOWALIGN_TOP && !rSetting.GetPersonaHeader().IsEmpty() ) || isFooter ) Erase(); else if ( !ImplGetSVData()->maNWFData.mbDockingAreaSeparateTB ) { diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index c42f80f5a45f..b8ac59a5bad7 100644 --- a/vcl/source/window/toolbox.cxx +++ b/vcl/source/window/toolbox.cxx @@ -524,11 +524,12 @@ void ToolBox::ImplDrawBackground( ToolBox* pThis, const Rectangle &rRect ) bool bNativeOk = false; if( pThis->ImplIsFloatingMode() && pThis->IsNativeControlSupported( CTRL_TOOLBAR, PART_ENTIRE_CONTROL) ) bNativeOk = ImplDrawNativeBackground( pThis, aPaintRegion ); - + const StyleSettings rSetting = Application::GetSettings().GetStyleSettings(); if( !bNativeOk ) { + const bool isFooter = pThis->GetAlign() == WINDOWALIGN_BOTTOM && !rSetting.GetPersonaFooter().IsEmpty(); if( !pThis->IsBackground() || - ( pThis->GetAlign() == WINDOWALIGN_TOP && !Application::GetSettings().GetStyleSettings().GetPersonaHeader().IsEmpty() ) ) + (( pThis->GetAlign() == WINDOWALIGN_TOP && ! rSetting.GetPersonaHeader().IsEmpty() ) || isFooter ) ) { if( !pThis->IsInPaint() ) ImplDrawTransparentBackground( pThis, aPaintRegion ); @@ -1468,9 +1469,11 @@ void ToolBox::ImplInitSettings( bool bFont, else { if( IsNativeControlSupported( CTRL_TOOLBAR, PART_ENTIRE_CONTROL ) || - ( GetAlign() == WINDOWALIGN_TOP && !Application::GetSettings().GetStyleSettings().GetPersonaHeader().IsEmpty() ) ) + ( GetAlign() == WINDOWALIGN_TOP && !Application::GetSettings().GetStyleSettings().GetPersonaHeader().IsEmpty() )|| + ( GetAlign() == WINDOWALIGN_BOTTOM && !Application::GetSettings().GetStyleSettings().GetPersonaFooter().IsEmpty()) ) { SetBackground(); + SetTextColor(rStyleSettings.GetMenuBarTextColor()); SetPaintTransparent( true ); SetParentClipMode( PARENTCLIPMODE_NOCLIP ); mpData->maDisplayBackground = Wallpaper( rStyleSettings.GetFaceColor() ); |