cui/source/dialogs/about.cxx |   12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

New commits:
commit 1d3e9fc71f8a1d048f1035b13c30cdbbcc27a970
Author:     Pedro Pinto Silva <pedro.si...@collabora.com>
AuthorDate: Tue Jun 22 15:36:15 2021 +0200
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Sun Feb 13 19:14:14 2022 +0100

    About: Darkmode: Use different about image
    
    Fixes the use of the same about.svg even on darkmode
    
    The way we are loading the svgs makes, when in presence of dark mode,
    the rendering of svgs very very poor on those dialogs. It adds artifacts
    , doesn't render gradients properly (at least when compared to
    light mode) and adds white outlines everywhere.
    
    Fix this by providing a simpler and more legible svgs to be use in
    dark mode and load them only in that mode.
    
    Signed-off-by: Pedro Pinto Silva <pedro.si...@collabora.com>
    Change-Id: Ib1a95f7d7a2be62b9b001b4c811c22104cc01b2f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117663
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Andras Timar <andras.ti...@collabora.com>

diff --git a/cui/source/dialogs/about.cxx b/cui/source/dialogs/about.cxx
index 9bb4042a2955..29a5310168c0 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());

Reply via email to