Kaydet (Commit) 406798f8 authored tarafından Takeshi Abe's avatar Takeshi Abe Kaydeden (comit) Katarina Behrens

tdf#96948 Change color of the area behind Impress slide immediately

after saving Options > Application colours > Application background.

This fixes a regression from 1c481fe6.

Change-Id: I8dc0caf9e351c0b1bf2a10e9097d8f3e895f1471
Reviewed-on: https://gerrit.libreoffice.org/29957Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarKatarina Behrens <Katarina.Behrens@cib.de>
üst 0b4be27b
...@@ -475,6 +475,7 @@ $(eval $(call gb_Library_add_exception_objects,sd,\ ...@@ -475,6 +475,7 @@ $(eval $(call gb_Library_add_exception_objects,sd,\
sd/source/ui/view/drviewsh \ sd/source/ui/view/drviewsh \
sd/source/ui/view/drviewsi \ sd/source/ui/view/drviewsi \
sd/source/ui/view/drviewsj \ sd/source/ui/view/drviewsj \
sd/source/ui/view/drviewsk \
sd/source/ui/view/drvwshrg \ sd/source/ui/view/drvwshrg \
sd/source/ui/view/frmview \ sd/source/ui/view/frmview \
sd/source/ui/view/grviewsh \ sd/source/ui/view/grviewsh \
......
...@@ -43,6 +43,7 @@ class SvNumberFormatter; ...@@ -43,6 +43,7 @@ class SvNumberFormatter;
class SfxErrorHandler; class SfxErrorHandler;
class SdDrawDocument; class SdDrawDocument;
class SfxFrame; class SfxFrame;
namespace svtools { class ColorConfig; }
namespace sd { namespace sd {
class DrawDocShell; class DrawDocShell;
...@@ -129,6 +130,8 @@ public: ...@@ -129,6 +130,8 @@ public:
SdExtPropertySetInfoCache gImplDrawPropertySetInfoCache; SdExtPropertySetInfoCache gImplDrawPropertySetInfoCache;
SdTypesCache gImplTypesCache; SdTypesCache gImplTypesCache;
svtools::ColorConfig& GetColorConfig();
protected: protected:
SdOptions* pImpressOptions; SdOptions* pImpressOptions;
...@@ -176,6 +179,7 @@ private: ...@@ -176,6 +179,7 @@ private:
*/ */
DECL_STATIC_LINK( SdModule, EventListenerHdl, VclSimpleEvent&, void ); DECL_STATIC_LINK( SdModule, EventListenerHdl, VclSimpleEvent&, void );
std::unique_ptr<svtools::ColorConfig> mpColorConfig;
}; };
#define SD_MOD() ( static_cast<SdModule*>(SfxApplication::GetModule(SfxToolsModule::Draw)) ) #define SD_MOD() ( static_cast<SdModule*>(SfxApplication::GetModule(SfxToolsModule::Draw)) )
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#include <svx/svxerr.hxx> #include <svx/svxerr.hxx>
#include <svx/xmlsecctrl.hxx> #include <svx/xmlsecctrl.hxx>
#include <svtools/colorcfg.hxx>
#include "sderror.hxx" #include "sderror.hxx"
#include "sdmod.hxx" #include "sdmod.hxx"
...@@ -77,7 +78,8 @@ SdModule::SdModule(SfxObjectFactory* pFact1, SfxObjectFactory* pFact2 ) ...@@ -77,7 +78,8 @@ SdModule::SdModule(SfxObjectFactory* pFact1, SfxObjectFactory* pFact2 )
pNumberFormatter( nullptr ), pNumberFormatter( nullptr ),
bWaterCan(false), bWaterCan(false),
mpResourceContainer(new ::sd::SdGlobalResourceContainer()), mpResourceContainer(new ::sd::SdGlobalResourceContainer()),
mbEventListenerAdded(false) mbEventListenerAdded(false),
mpColorConfig(new svtools::ColorConfig)
{ {
SetName( "StarDraw" ); // Do not translate! SetName( "StarDraw" ); // Do not translate!
pSearchItem = new SvxSearchItem(SID_SEARCH_ITEM); pSearchItem = new SvxSearchItem(SID_SEARCH_ITEM);
...@@ -220,4 +222,9 @@ OutputDevice* SdModule::GetRefDevice (::sd::DrawDocShell& ) ...@@ -220,4 +222,9 @@ OutputDevice* SdModule::GetRefDevice (::sd::DrawDocShell& )
return GetVirtualRefDevice(); return GetVirtualRefDevice();
} }
svtools::ColorConfig& SdModule::GetColorConfig()
{
return *mpColorConfig;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include <com/sun/star/lang/XEventListener.hpp> #include <com/sun/star/lang/XEventListener.hpp>
#include <com/sun/star/scanner/XScannerManager2.hpp> #include <com/sun/star/scanner/XScannerManager2.hpp>
#include <unotools/caserotate.hxx> #include <unotools/caserotate.hxx>
#include <unotools/options.hxx>
class Outliner; class Outliner;
class SdPage; class SdPage;
...@@ -65,7 +66,8 @@ class ViewOverlayManager; ...@@ -65,7 +66,8 @@ class ViewOverlayManager;
*/ */
class DrawViewShell class DrawViewShell
: public ViewShell, : public ViewShell,
public SfxListener public SfxListener,
public utl::ConfigurationListener
{ {
public: public:
SFX_DECL_INTERFACE(SD_IF_SDDRAWVIEWSHELL) SFX_DECL_INTERFACE(SD_IF_SDDRAWVIEWSHELL)
...@@ -361,8 +363,6 @@ public: ...@@ -361,8 +363,6 @@ public:
OUString GetSidebarContextName() const; OUString GetSidebarContextName() const;
const Color& GetAppBackgroundColor() const { return mnAppBackgroundColor; }
void SetAppBackgroundColor( Color nNewColor ) { mnAppBackgroundColor = nNewColor; }
bool IsInSwitchPage() { return mbIsInSwitchPage; } bool IsInSwitchPage() { return mbIsInSwitchPage; }
//move this method to ViewShell. //move this method to ViewShell.
...@@ -489,6 +489,10 @@ private: ...@@ -489,6 +489,10 @@ private:
std::vector<std::unique_ptr<SdrExternalToolEdit>> m_ExternalEdits; std::vector<std::unique_ptr<SdrExternalToolEdit>> m_ExternalEdits;
virtual void ConfigurationChanged( utl::ConfigurationBroadcaster* pCb, sal_uInt32 ) override;
void ConfigureAppBackgroundColor( svtools::ColorConfig* pColorConfig = nullptr );
// The colour of the area behind the slide (used to be called "Wiese") // The colour of the area behind the slide (used to be called "Wiese")
Color mnAppBackgroundColor; Color mnAppBackgroundColor;
}; };
......
...@@ -380,10 +380,7 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive) ...@@ -380,10 +380,7 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive)
GetViewShellBase().GetToolBarManager()->ResetToolBars(ToolBarManager::TBG_COMMON_TASK); GetViewShellBase().GetToolBarManager()->ResetToolBars(ToolBarManager::TBG_COMMON_TASK);
} }
svtools::ColorConfig aColorConfig; ConfigureAppBackgroundColor();
Color aFillColor( aColorConfig.GetColorValue( svtools::APPBACKGROUND ).nColor );
if (comphelper::LibreOfficeKit::isActive())
aFillColor = COL_TRANSPARENT;
if (meEditMode == EditMode::Page) if (meEditMode == EditMode::Page)
{ {
...@@ -410,8 +407,6 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive) ...@@ -410,8 +407,6 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive)
maTabControl->SetCurPageId(nActualPageNum + 1); maTabControl->SetCurPageId(nActualPageNum + 1);
SetAppBackgroundColor( aFillColor );
SwitchPage(nActualPageNum); SwitchPage(nActualPageNum);
//tdf#102343 re-enable common undo on switch back from master mode //tdf#102343 re-enable common undo on switch back from master mode
...@@ -451,9 +446,6 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive) ...@@ -451,9 +446,6 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive)
} }
} }
aFillColor.DecreaseLuminance( 64 );
SetAppBackgroundColor( aFillColor );
maTabControl->SetCurPageId(nActualMasterPageNum + 1); maTabControl->SetCurPageId(nActualMasterPageNum + 1);
SwitchPage(nActualMasterPageNum); SwitchPage(nActualMasterPageNum);
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#include <com/sun/star/drawing/XDrawPagesSupplier.hpp> #include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
#include "DrawViewShell.hxx" #include "DrawViewShell.hxx"
#include <comphelper/lok.hxx>
#include <vcl/msgbox.hxx> #include <vcl/msgbox.hxx>
#include <svl/urlbmk.hxx> #include <svl/urlbmk.hxx>
#include <svx/svdpagv.hxx> #include <svx/svdpagv.hxx>
...@@ -342,14 +341,8 @@ void DrawViewShell::MouseMove(const MouseEvent& rMEvt, ::sd::Window* pWin) ...@@ -342,14 +341,8 @@ void DrawViewShell::MouseMove(const MouseEvent& rMEvt, ::sd::Window* pWin)
// is needed it is necessary to set it here. // is needed it is necessary to set it here.
if (GetDoc()) if (GetDoc())
{ {
svtools::ColorConfig aColorConfig; ConfigureAppBackgroundColor();
Color aFillColor; mpDrawView->SetApplicationBackgroundColor( mnAppBackgroundColor );
aFillColor = Color( aColorConfig.GetColorValue( svtools::APPBACKGROUND ).nColor );
if (comphelper::LibreOfficeKit::isActive())
aFillColor = COL_TRANSPARENT;
mpDrawView->SetApplicationBackgroundColor(aFillColor);
} }
ViewShell::MouseMove(rMEvt, pWin); ViewShell::MouseMove(rMEvt, pWin);
......
...@@ -414,7 +414,7 @@ void DrawViewShell::Paint(const Rectangle& rRect, ::sd::Window* pWin) ...@@ -414,7 +414,7 @@ void DrawViewShell::Paint(const Rectangle& rRect, ::sd::Window* pWin)
GetDoc()->GetDrawOutliner().SetDefaultLanguage( GetDoc()->GetLanguage( EE_CHAR_LANGUAGE ) ); GetDoc()->GetDrawOutliner().SetDefaultLanguage( GetDoc()->GetLanguage( EE_CHAR_LANGUAGE ) );
// Set Application Background color for usage in SdrPaintView(s) // Set Application Background color for usage in SdrPaintView(s)
mpDrawView->SetApplicationBackgroundColor(GetAppBackgroundColor()); mpDrawView->SetApplicationBackgroundColor( mnAppBackgroundColor );
/* This is done before each text edit, so why not do it before every paint. /* This is done before each text edit, so why not do it before every paint.
The default language is only used if the outliner only contains one The default language is only used if the outliner only contains one
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#include "DrawViewShell.hxx" #include "DrawViewShell.hxx"
#include <com/sun/star/scanner/ScannerManager.hpp> #include <com/sun/star/scanner/ScannerManager.hpp>
#include <cppuhelper/implbase.hxx> #include <cppuhelper/implbase.hxx>
#include <comphelper/lok.hxx>
#include <comphelper/processfactory.hxx> #include <comphelper/processfactory.hxx>
#include <editeng/sizeitem.hxx> #include <editeng/sizeitem.hxx>
#include <svx/svdlayer.hxx> #include <svx/svdlayer.hxx>
...@@ -128,10 +127,15 @@ DrawViewShell::DrawViewShell( SfxViewFrame* pFrame, ViewShellBase& rViewShellBas ...@@ -128,10 +127,15 @@ DrawViewShell::DrawViewShell( SfxViewFrame* pFrame, ViewShellBase& rViewShellBas
SetContextName(GetSidebarContextName()); SetContextName(GetSidebarContextName());
doShow(); doShow();
ConfigureAppBackgroundColor();
SD_MOD()->GetColorConfig().AddListener(this);
} }
DrawViewShell::~DrawViewShell() DrawViewShell::~DrawViewShell()
{ {
SD_MOD()->GetColorConfig().RemoveListener(this);
mpSelectionChangeHandler->Disconnect(); mpSelectionChangeHandler->Disconnect();
mpAnnotationManager.reset(); mpAnnotationManager.reset();
...@@ -205,11 +209,6 @@ void DrawViewShell::Construct(DrawDocShell* pDocSh, PageKind eInitialPageKind) ...@@ -205,11 +209,6 @@ void DrawViewShell::Construct(DrawDocShell* pDocSh, PageKind eInitialPageKind)
mbPastePossible = false; mbPastePossible = false;
mbIsLayerModeActive = false; mbIsLayerModeActive = false;
svtools::ColorConfig aColorConfig;
mnAppBackgroundColor = Color( aColorConfig.GetColorValue( svtools::APPBACKGROUND ).nColor );
if (comphelper::LibreOfficeKit::isActive())
mnAppBackgroundColor = COL_TRANSPARENT;
mpFrameView->Connect(); mpFrameView->Connect();
OSL_ASSERT (GetViewShell()!=nullptr); OSL_ASSERT (GetViewShell()!=nullptr);
......
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include "DrawViewShell.hxx"
#include "sdmod.hxx"
#include <comphelper/lok.hxx>
namespace sd {
void DrawViewShell::ConfigurationChanged( utl::ConfigurationBroadcaster* pCb, sal_uInt32 )
{
ConfigureAppBackgroundColor( dynamic_cast<svtools::ColorConfig*>(pCb) );
}
void DrawViewShell::ConfigureAppBackgroundColor( svtools::ColorConfig *pColorConfig )
{
if (!pColorConfig)
pColorConfig = &SD_MOD()->GetColorConfig();
Color aFillColor( pColorConfig->GetColorValue( svtools::APPBACKGROUND ).nColor );
if (comphelper::LibreOfficeKit::isActive())
aFillColor = COL_TRANSPARENT;
// tdf#87905 Use darker background color for master view
if (meEditMode == EditMode::MasterPage)
aFillColor.DecreaseLuminance( 64 );
mnAppBackgroundColor = aFillColor;
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment