diff options
author | Pedro Pinto Silva <pedro.silva@collabora.com> | 2021-06-22 15:36:15 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2024-01-15 11:43:16 +0100 |
commit | 780468365ac6dfaaa919d93ff1b148a80319733a (patch) | |
tree | 6c118446b69a24417e7dc7f4c3b8fab9e2796e51 /cui | |
parent | 91bbf703221f42c825cc85c287c24afbe4ff8372 (diff) |
[cp] 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.silva@collabora.com>
Change-Id: Ib1a95f7d7a2be62b9b001b4c811c22104cc01b2f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117663
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/dialogs/about.cxx | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/cui/source/dialogs/about.cxx b/cui/source/dialogs/about.cxx index 0ead4b573700..0c90c748d0d7 100644 --- a/cui/source/dialogs/about.cxx +++ b/cui/source/dialogs/about.cxx @@ -98,13 +98,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)) { // Eliminate white background when Skia is disabled by not drawing the // background bitmap to a VirtualDevice. On most platforms, non-Skia // VirtualDevices will be filled with a solid color when drawing @@ -112,7 +108,7 @@ AboutDialog::AboutDialog(weld::Window *pParent) Graphic aGraphic(aBackgroundBitmap); m_pBrandImage->set_image(aGraphic.GetXGraphic()); } - if (SfxApplication::loadBrandSvg("shell/about", aBackgroundBitmap, nWidth * 0.9)) { + if (SfxApplication::loadBrandSvg(bIsDark ? "shell/about_inverted" : "shell/about", aBackgroundBitmap, nWidth * 0.9)) { // Eliminate white background when Skia is disabled by not drawing the // background bitmap to a VirtualDevice. On most platforms, non-Skia // VirtualDevices will be filled with a solid color when drawing |