From 51f433008ece1f18f187b6293d55fb6bb739aa65 Mon Sep 17 00:00:00 2001 From: Pedro Pinto Silva Date: Tue, 22 Jun 2021 15:36:15 +0200 Subject: About: Darkmode: Use different about image 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 Change-Id: Ib1a95f7d7a2be62b9b001b4c811c22104cc01b2f --- cui/source/dialogs/about.cxx | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'cui/source/dialogs/about.cxx') 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 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 m_pVirDev = m_pAboutImage->create_virtual_device(); m_pVirDev->SetOutputSizePixel(aBackgroundBitmap.GetSizePixel()); -- cgit v1.2.3