summaryrefslogtreecommitdiff
path: root/slideshow/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-11-08 16:02:14 +0000
committerCaolán McNamara <caolanm@redhat.com>2022-11-09 11:57:31 +0100
commitd39303f7ea696d36c4ab65286d4b7d8d1bb9069a (patch)
tree8ff3ac13be3ace022c6a1cd4dff98f5b30487e1a /slideshow/source
parent4170b94c443b3bd68b4cc75b8c344ecca3c249b0 (diff)
Resolves: tdf#148884 impress slideshow uses white text on white in dark mode
In dark mode impress's auto text color assumes it will render against the DOCCOLOR by default, so leaving this as white gives white on white, this looks the simplest approach, propogate DOCCOLOR as the default slideshow background instead of reformatting to render onto a white slideshow Change-Id: Id484e14ce96fd05cb16a35586d83e37b36933c20 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142464 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'slideshow/source')
-rw-r--r--slideshow/source/engine/tools.cxx30
1 files changed, 21 insertions, 9 deletions
diff --git a/slideshow/source/engine/tools.cxx b/slideshow/source/engine/tools.cxx
index 3567fa5c146b..d48bda952462 100644
--- a/slideshow/source/engine/tools.cxx
+++ b/slideshow/source/engine/tools.cxx
@@ -42,6 +42,8 @@
#include <cppcanvas/basegfxfactory.hxx>
+#include <svtools/colorcfg.hxx>
+
#include <unoview.hxx>
#include <slideshowexceptions.hxx>
#include <smilfunctionparser.hxx>
@@ -688,19 +690,29 @@ namespace slideshow::internal
rSize.getY() ),
0x000000FFU );
- // fill the bounds rectangle in white. Subtract one pixel
- // from both width and height, because the slide size is
- // chosen one pixel larger than given by the drawing
- // layer. This is because shapes with line style, that
- // have the size of the slide would otherwise be cut
- // off. OTOH, every other slide background (solid fill,
- // gradient, bitmap) render one pixel less, thus revealing
- // ugly white pixel to the right and the bottom.
+ // tdf#148884 in dark mode impress's auto text color assumes it will render against
+ // the DOCCOLOR by default, so leaving this as white gives white on white, this
+ // looks the simplest approach, propogate dark mode into slideshow mode instead
+ // of reformatting to render onto a white slideshow
+ svtools::ColorConfig aColorConfig;
+ Color aApplicationDocumentColor = aColorConfig.GetColorValue(svtools::DOCCOLOR).nColor;
+ cppcanvas::IntSRGBA nCanvasColor = cppcanvas::makeColor(aApplicationDocumentColor.GetRed(),
+ aApplicationDocumentColor.GetGreen(),
+ aApplicationDocumentColor.GetBlue(),
+ 0xFF);
+
+ // fill the bounds rectangle in DOCCOLOR (typically white).
+ // Subtract one pixel from both width and height, because the slide
+ // size is chosen one pixel larger than given by the drawing layer.
+ // This is because shapes with line style, that have the size of
+ // the slide would otherwise be cut off. OTOH, every other slide
+ // background (solid fill, gradient, bitmap) render one pixel less,
+ // thus revealing ugly white pixel to the right and the bottom.
fillRect( pCanvas,
::basegfx::B2DRectangle( 0.0, 0.0,
rSize.getX()-1,
rSize.getY()-1 ),
- 0xFFFFFFFFU );
+ nCanvasColor );
}
::basegfx::B2DRectangle getAPIShapeBounds( const uno::Reference< drawing::XShape >& xShape )