android: Update app-specific/MIME type icons
[LibreOffice.git] / sd / source / ui / view / drviewsk.cxx
blob92a00d5d2dedd8695d59e223d2294ce9d370e161
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
10 #include <DrawViewShell.hxx>
11 #include <ViewShellBase.hxx>
12 #include <sdmod.hxx>
14 #include <comphelper/lok.hxx>
15 #include <comphelper/servicehelper.hxx>
16 #include <sfx2/lokhelper.hxx>
17 #include <LibreOfficeKit/LibreOfficeKitEnums.h>
18 #include <unomodel.hxx>
20 namespace sd {
22 void DrawViewShell::ConfigurationChanged( utl::ConfigurationBroadcaster* pCb, ConfigurationHints )
24 svtools::ColorConfig *pColorConfig = dynamic_cast<svtools::ColorConfig*>(pCb);
25 ConfigureAppBackgroundColor(pColorConfig);
26 if (comphelper::LibreOfficeKit::isActive())
28 SfxViewShell* pCurrentShell = SfxViewShell::Current();
29 ViewShellBase* pShellBase = dynamic_cast<ViewShellBase*>(pCurrentShell);
30 if (!pShellBase)
31 return;
32 if (DrawViewShell* pCurrentDrawShell = dynamic_cast<DrawViewShell*>(pShellBase->GetMainViewShell().get()))
34 pCurrentDrawShell->maViewOptions.mnDocBackgroundColor = pColorConfig->GetColorValue(svtools::DOCCOLOR).nColor;
35 pCurrentDrawShell->maViewOptions.msColorSchemeName = svtools::ColorConfig::GetCurrentSchemeName();
37 SdXImpressDocument* pDoc = comphelper::getFromUnoTunnel<SdXImpressDocument>(pCurrentShell->GetCurrentDocument());
38 SfxLokHelper::notifyViewRenderState(pCurrentShell, pDoc);
39 Color aFillColor(pColorConfig->GetColorValue(svtools::APPBACKGROUND).nColor);
40 pCurrentShell->libreOfficeKitViewCallback(LOK_CALLBACK_APPLICATION_BACKGROUND_COLOR,
41 aFillColor.AsRGBHexString().toUtf8());
45 void DrawViewShell::ConfigureAppBackgroundColor( svtools::ColorConfig *pColorConfig )
47 if (!pColorConfig)
48 pColorConfig = &SD_MOD()->GetColorConfig();
49 Color aFillColor( pColorConfig->GetColorValue( svtools::APPBACKGROUND ).nColor );
50 if (comphelper::LibreOfficeKit::isActive())
51 aFillColor = COL_TRANSPARENT;
52 // tdf#87905 Use darker background color for master view
53 if (meEditMode == EditMode::MasterPage)
54 aFillColor.DecreaseLuminance( 64 );
55 maViewOptions.mnAppBackgroundColor = aFillColor;
60 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */