diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2018-07-05 18:10:27 +0200 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2018-07-06 10:47:33 +0200 |
commit | bd39726fe67cad9eb133daf4a8ab8c2b19dddfe1 (patch) | |
tree | 869349f7fd05d85986b2ffc4f05ad0580a1cb10c /vcl | |
parent | 30bf6b73178a6cf793cddb9c646560808f5faba7 (diff) |
Qt5 implement invert for blinking cursor
The different modes are quite probably not correctly implemented,
as multiple backends disagree here.
Change-Id: I08fc3096487ca95f4905ae9f0e4b5d3897fca483
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/qt5/Qt5Graphics_GDI.cxx | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/vcl/qt5/Qt5Graphics_GDI.cxx b/vcl/qt5/Qt5Graphics_GDI.cxx index 08c620c11796..146849007035 100644 --- a/vcl/qt5/Qt5Graphics_GDI.cxx +++ b/vcl/qt5/Qt5Graphics_GDI.cxx @@ -444,9 +444,30 @@ std::shared_ptr<SalBitmap> Qt5Graphics::getBitmap(long nX, long nY, long nWidth, Color Qt5Graphics::getPixel(long nX, long nY) { return m_pQImage->pixel(nX, nY); } -void Qt5Graphics::invert(long /*nX*/, long /*nY*/, long /*nWidth*/, long /*nHeight*/, - SalInvert /*nFlags*/) +void Qt5Graphics::invert(long nX, long nY, long nWidth, long nHeight, SalInvert nFlags) { + Qt5Painter aPainter(*this); + if (SalInvert::N50 & nFlags) + { + aPainter.setCompositionMode(QPainter::RasterOp_SourceXorDestination); + aPainter.setBrush(Qt::DiagCrossPattern); + aPainter.fillRect(nX, nY, nWidth, nHeight, aPainter.brush()); + } + else + { + if (SalInvert::TrackFrame & nFlags) + { + aPainter.setCompositionMode(QPainter::RasterOp_SourceXorDestination); + aPainter.setPen(Qt::DashLine); + aPainter.drawRect(nX, nY, nWidth, nHeight); + } + else + { + aPainter.setCompositionMode(QPainter::RasterOp_SourceXorDestination); + aPainter.fillRect(nX, nY, nWidth, nHeight, Qt::white); + } + } + aPainter.update(nX, nY, nWidth, nHeight); } void Qt5Graphics::invert(sal_uInt32 /*nPoints*/, const SalPoint* /*pPtAry*/, SalInvert /*nFlags*/) |