summaryrefslogtreecommitdiff
path: root/vcl/source/window/menubarwindow.cxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2019-05-31 14:56:46 +0200
committerMiklos Vajna <vmiklos@collabora.com>2019-05-31 20:19:56 +0200
commit42bf893a8479f70d7d8f00e03105ce15e8545f8b (patch)
treed5d5ee25619aede0583a2b4cb6066493b51b5131 /vcl/source/window/menubarwindow.cxx
parenta415ba29f067d457669576e89b4df8fb3fa96c52 (diff)
tdf#125550 vcl menu bar / floating window: fix text color
Regression from commit e8d5b8beb5958147235ff955ed38c47b51d860ff (tdf#113714 vcl menu bar window: avoid flicker, 2019-05-20), the problem was that a freshly created VirtualDevice doesn't have the default text color, so we need to initialize that explicitly based on the render context text color. Also introduce a BufferDevice to do this initialization, instead of fixing this in MenuBarWindow::Paint(), then copy&pasting the fix to MenuFloatingWindow::Paint(). Change-Id: Ib171cd52e7cabe0bc3c639821f558d8303039fe6 Reviewed-on: https://gerrit.libreoffice.org/73269 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'vcl/source/window/menubarwindow.cxx')
-rw-r--r--vcl/source/window/menubarwindow.cxx11
1 files changed, 2 insertions, 9 deletions
diff --git a/vcl/source/window/menubarwindow.cxx b/vcl/source/window/menubarwindow.cxx
index b32e38790cd4..81e7cbe573c6 100644
--- a/vcl/source/window/menubarwindow.cxx
+++ b/vcl/source/window/menubarwindow.cxx
@@ -33,6 +33,7 @@
#include <strings.hrc>
#include <bitmaps.hlst>
#include <window.h>
+#include "bufferdevice.hxx"
// document closing button
#define IID_DOCUMENTCLOSE 1
@@ -914,11 +915,7 @@ void MenuBarWindow::Paint(vcl::RenderContext& rRenderContext, const tools::Recta
}
// Make sure that all actual rendering happens in one go to avoid flicker.
- ScopedVclPtrInstance<VirtualDevice> pBuffer;
- pBuffer->SetOutputSizePixel(aOutputSize, false);
- // Copy the current state to the buffer.
- pBuffer->DrawOutDev(Point(0, 0), GetOutputSizePixel(), Point(0, 0), GetOutputSizePixel(),
- rRenderContext);
+ vcl::BufferDevice pBuffer(this, rRenderContext);
if (rRenderContext.IsNativeControlSupported(ControlType::Menubar, ControlPart::Entire))
{
@@ -961,10 +958,6 @@ void MenuBarWindow::Paint(vcl::RenderContext& rRenderContext, const tools::Recta
Point(aSize.Width() - 1, aSize.Height() - 1));
pBuffer->Pop();
}
-
- // Copy the current state from the buffer.
- rRenderContext.DrawOutDev(Point(0, 0), GetOutputSizePixel(), Point(0, 0), GetOutputSizePixel(),
- *pBuffer);
}
void MenuBarWindow::Resize()