summaryrefslogtreecommitdiff
path: root/cui/source/dialogs/about.cxx
diff options
context:
space:
mode:
authorPedro Pinto Silva <pedro.silva@collabora.com>2021-06-22 15:36:15 +0200
committerAndras Timar <andras.timar@collabora.com>2021-06-23 11:48:34 +0200
commit51f433008ece1f18f187b6293d55fb6bb739aa65 (patch)
tree34eacaaab21fdc02e5a480f9d1800369cdd29d53 /cui/source/dialogs/about.cxx
parent8282c7ab422b4d5592edfbaaff59c96c1b9f1eb9 (diff)
About: Darkmode: Use different about imageco-21.06.1-1
Fixes the use of the same about.svg even on darkmode Also do not check twice if it's dark mode, check once and then use the same variable Signed-off-by: Pedro Pinto Silva <pedro.silva@collabora.com> Change-Id: Ib1a95f7d7a2be62b9b001b4c811c22104cc01b2f
Diffstat (limited to 'cui/source/dialogs/about.cxx')
-rw-r--r--cui/source/dialogs/about.cxx12
1 files changed, 4 insertions, 8 deletions
diff --git a/cui/source/dialogs/about.cxx b/cui/source/dialogs/about.cxx
index 6295f6dea6dd..fa44179142e8 100644
--- a/cui/source/dialogs/about.cxx
+++ b/cui/source/dialogs/about.cxx
@@ -93,13 +93,9 @@ AboutDialog::AboutDialog(weld::Window *pParent)
const tools::Long nWidth(m_pCopyrightLabel->get_preferred_size().getWidth());
BitmapEx aBackgroundBitmap;
- if (SfxApplication::loadBrandSvg(Application::GetSettings()
- .GetStyleSettings()
- .GetDialogColor()
- .IsDark()
- ? "shell/logo_inverted"
- : "shell/logo",
- aBackgroundBitmap, nWidth * 0.8)) {
+ bool bIsDark = Application::GetSettings().GetStyleSettings().GetDialogColor().IsDark();
+
+ if (SfxApplication::loadBrandSvg(bIsDark ? "shell/logo_inverted" : "shell/logo", aBackgroundBitmap, nWidth * 0.8)) {
ScopedVclPtr<VirtualDevice> m_pVirDev =
m_pBrandImage->create_virtual_device();
m_pVirDev->SetOutputSizePixel(aBackgroundBitmap.GetSizePixel());
@@ -107,7 +103,7 @@ AboutDialog::AboutDialog(weld::Window *pParent)
m_pBrandImage->set_image(m_pVirDev.get());
m_pVirDev.disposeAndClear();
}
- if (SfxApplication::loadBrandSvg("shell/about", aBackgroundBitmap, nWidth * 0.9)) {
+ if (SfxApplication::loadBrandSvg(bIsDark ? "shell/about_inverted" : "shell/about", aBackgroundBitmap, nWidth * 0.9)) {
ScopedVclPtr<VirtualDevice> m_pVirDev =
m_pAboutImage->create_virtual_device();
m_pVirDev->SetOutputSizePixel(aBackgroundBitmap.GetSizePixel());