summaryrefslogtreecommitdiff
path: root/vcl
AgeCommit message (Collapse)Author
2021-11-19remove unused definesNoel Grandin
Change-Id: I1140d7dc2f40dafcba6a314c7a641c3b2d886af4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125554 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-19gtk4: GtkPopover parent must be set before its shownCaolán McNamara
Change-Id: I6184422b92d3629f31141215bed588400b30289c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125542 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-11-19Qt set QPainter AntiAlias hint from SalGraphicsArmin Le Grand (Allotropia)
Change-Id: I1a9e6014ead24b6edff1dbb41b70c809204d01cc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125549 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2021-11-19loplugin:stringliteraldefine in vclNoel Grandin
Change-Id: Id14cc8613fdfb67790efd6c33ee243f6bdb522f3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125546 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-19gtk3: take default modality from the popover it replacesCaolán McNamara
Change-Id: I0404dc17bd816a7dd403c50692f4f5325aacaf31 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125503 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-11-19Upgrade to un-deprecated API and fix a crash in the pasteboard.mm helper toolTor Lillqvist
Change-Id: Ic0b839df686fb93c64ef844848028ded39225ced
2021-11-19gtk4: remove constrain-to propertyCaolán McNamara
Change-Id: I18f0b72fff31f555873a0808f171e4c1746a4411 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125539 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-11-19rtl::Static->thread-safe static in vclNoel Grandin
Change-Id: I748c3b5608b76b4b847273856f6b1c66b53aced1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125497 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-19refactor for potential reuse outside MenuButtonCaolán McNamara
Change-Id: I36729364550dc7c505fdc396442f51809fc58073 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125489 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-11-19Drop F_2PIMike Kaganski
Change-Id: Ie98606607b2ce262e4eed76bb8cd86fbfe846f76 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125506 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-11-19Use M_PI* instead of F_PI*Mike Kaganski
Change-Id: Ie2b7a1c74fc516781a17a20157b8217bc41e383d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125504 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-11-19tdf#137924 qt (>=5.14): Use proper DPI without requiring window handleMichael Weghorn
For Qt >= 5.14, don't require a window handle to retrieve the screen and then the associated DPI value from that one, but directly use 'QWidget::screen' (introduced in QT 5.14) to retrieve the screen. Previously, no DPI values would be set in case there was no window handle. This makes UI scaling work without having to manually set 'SAL_FORCEDPI' on Wayland. While various UI elements (like e.g. the "Help" -> "About LibreOffice" still look quite broken with the qt5 and kf5 VCL plugins in a Plasma Wayland session (at least on my Debian testing with Qt 5.15.2 and Plasma 5.23), they look OK when using the qt6 VCL plugin with a custom build of qtbase and qtwayland from Qt's "dev" git branches. Change-Id: I5feae46ed86a8b7d3cf92d4a973f7a0f9a9f95de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125507 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2021-11-18Qt implement QtFont::GetGlyphOutlineArmin Le Grand (Allotropia)
Fixes FontWork with QFont based rendering. Change-Id: I294fe89d2753b6e82a559ff847b44126f9ea3bfc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125500 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2021-11-18Drop F_PI180Mike Kaganski
Change-Id: I36783d6fd6f439a71bc46959cd859b48d65ee30f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125449 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-11-18draw symbols using polygons instead of raster of linesLuboš Luňák
On HiDPI those lines become obvious. Change-Id: I2b0cce3950abb4d06a56ba022100bc74026b5de7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125481 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-11-18add an extra margin to native control drawing on Skia/MacLuboš Luňák
Some controls draw outside of their given area, which would get cropped when first drawing to a temporary context limited to just that size. I haven't managed to find a way to calculate the proper marging, so just add something that's hopefully enough but not too big. Change-Id: I1a15a3ab8cbd26cbe4fb52628b300ee70c8d51ad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125469 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-11-18fix background color of some native controls with Skia/Mac (tdf#145748)Luboš Luňák
Some of the control drawing calls use CGContextFillRect() to draw background for controls, so since we use a temporary context, set up colors for such drawing. Change-Id: I41cfa29e29fcf86598d49fbbed0b159c48c63d6a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125468 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-11-18draw Mac widget controls at proper size when HiDPILuboš Luňák
This code was drawing them at non-HiDPI size and then scaling up. Change-Id: I90abfd36adaff4e7c4929cd28d0aa50d919449a4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125467 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-11-18Fix typosAndrea Gelmini
Change-Id: Idd21ee0026d8a36653f0fb25b350dae37315f603 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125336 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-18allow vcl gen menus to have non-square imagesCaolán McNamara
for the color menu in the calc autofilter Change-Id: I90a4ccefa9c44f5c9d0b0e49dd8c254d13be0fe1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125444 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-11-18handle also curved lines for nojoin skia polylines (tdf#143837)Luboš Luňák
Change-Id: I2f5aa12eb656f6b337843d81a2a30de277dff7b7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125410 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-11-17vcl: split GetGradientSteps() into Get{Complex|Linear}GradientSteps()Chris Sherlock
Change-Id: Ieb0d5d6f1a7c9fff3671ef74ffac9eaf37dcb0e1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123060 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-11-17weld colormenuCaolán McNamara
Change-Id: I6feef72cf924865e2407a96cdd0b6e60c835dbc3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125417 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-11-17allow menu placement either under or at endCaolán McNamara
Change-Id: Id76cbe69464f439eec900bf9b80b0c63d99b6597 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125416 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-11-17drop unused PopupMenuFlags::NoHorzPlacementCaolán McNamara
Change-Id: Ic279160f96e5aa2a37690f987c2323b91b2ec49c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125415 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-11-17Qt resolve native winId() on demandJan-Marek Glogowski
As for gtk3 in commit ac9789dbb36f45dcc1caf7dd2951353b1574c8ea ("tdf#139609 avoid fetching unnecessary xid under gtk3"). Change-Id: I82b2c22437e5ab957706c25fcc118b28abb07242 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125395 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins
2021-11-17Qt refactor SystemEnvData setupJan-Marek Glogowski
Change-Id: I900d1079c9a832a9b5170e58ce4e7a8b81d7d01b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125393 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins
2021-11-17Skia dumping is no longer dbgutil-onlyLuboš Luňák
This is a mistake from f33b76b4e675818deae244427cef84c576a1a1f8. Change-Id: Iae69ae0099a62451d156c80255f55b1f6aad4725 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125370 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-11-17fix SkiaTest::testDrawDelayedScaleImage() with GPU+HiDPILuboš Luňák
Change-Id: I0bdaf2679f1f20f6ba0c28641cd8cc6756e4316b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125369 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-11-17loplugin:simplifyboolStephan Bergmann
Change-Id: Ifb7c6d8a4506808b5f56492e692ef7172a367e26 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125344 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-11-16loplugin:finalprotectedStephan Bergmann
Change-Id: I16d32d51266fc32e8ee37f9e1deed4c9577764b5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125316 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-11-16fix drawBitmap() unittests with Skia/HiDPILuboš Luňák
Force non-smooth scaling to get exact pixel values. Introduced in 6792e6e5e49d11a54256b75c4c5a476bb2f10b4a. Change-Id: Iec2633e9ef8e930688c95ceb1037696456f344f5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125312 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-11-16try to avoid scaling bitmaps twice in Skia when drawingLuboš Luňák
The scenario is that something scales a bitmap and then asks for it to be drawn (possibly drawn scaled again). One example is OutputDevice::DrawBitmap() subsampling the bitmap that according to c0ce7ca4884f7f6d1 is supposed to improve quality with headless(?) backend, but with Skia it's pointless and it breaks things like caching during repeated drawing, because then GetSkImage() will need to generate a new SkImage each time. Since Skia backend uses delayed scaling, these cases can be sorted out by checking the stored SkImage and using it if suitable, as the original image is as good as the rescaled one, but often it's better - it may be cached, sometimes the scaling operations cancel each other out (often the case in HiDPI mode). Change-Id: I0af32f7abdf057a3bdda75247d2dc374eaf1bc4b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125311 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-11-16make SkiaHelper::dump() available also in non-dbgutil buildsLuboš Luňák
They are just a set of small functions, and I sometimes need to debug optimized builds too. Change-Id: I6350476e8c7fef85460a88b9e3d56d02213764ea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125310 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-11-16add a vcl backend test that draws a sheared bitmapLuboš Luňák
Change-Id: I06838e01ed41ac41c8b578fd6c7d984f1c073e31 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125298 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-11-16Related: tdf#142706 mask with GDK_MODIFIER_MASK to ignore unwanted bitsCaolán McNamara
Change-Id: I6d3f6fb6e9385b8077c23d5b7f78c43d9fb7b9d3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125295 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-11-16avoid using always-show-arrow in gtk4 < 4.4Caolán McNamara
Change-Id: Ie2df9cd91a5ea857965d24dc669a6c1d94c965a4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125293 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-11-16Resolves: tdf#143511 SysObj is clipped out if the widget is out of viewCaolán McNamara
so the sizes and relative positions are invalid under gtk, unclip the SysObj when using get_extents_relative_to Change-Id: Ibdaff20531a2a40b3b9b7dc9ac880d014db07d5a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125272 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-11-16optimize Skia's copyArea() to copy less dataLuboš Luňák
Change-Id: Ia1cd0522643b58ea1be3ad974c1fc5f7fed657d4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125268 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-11-16log also whether SkiaSalBitmap has any pending scalingLuboš Luňák
Change-Id: I09a1921e203e1088577abf75350c8b41e4c78381 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125265 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-11-16don't bother caching bitmaps that prefer shadersLuboš Luňák
Change-Id: Ibc78371f9e2ba92470714847bb6a5b8b96d1037f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125264 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-11-16when caching bitmaps in skia, take into account HiDPILuboš Luňák
Since the image will be actually eventually drawn twice as big, cache an image that is twice as big. Change-Id: Iea0340cd92c102e453330723c797659c742feb63 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125263 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-11-16apply SAL_FORCE_HIDPI_SCALING on X11 even while drawingLuboš Luňák
It'll draw double-sized 1/4 of the content in the topleft corner of windows, but it's still useful for some tests. Change-Id: I20c6d2382d704ddcd67b8cb81eb7abf37b57a92f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125262 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-11-16implement HiDPI support for Skia/Mac (tdf#144214)Luboš Luňák
The basic idea is the same as the 'aqua' backend, simply set up a scaling matrix for all drawing. That will take care of the basic drawing everything twice as large, which is twice the resolution. And then blit this data to the window, which expects data this way. Converting back from backing surface needs explicit coordinate conversions, and when converting to a bitmap the bitmap needs to be scaled down in order to appear normally sized. Fortunately I've already implemented delayed scaling, which means that if the bitmap is drawn later again without any modifications, no data would be lost (to be done in a follow-up commit). Unittests occassionally need special handling, as such scaling down to bitmap not being smoothed, because they expect exact color values. Change-Id: Ieadf2c3693f7c9676c31c7394d46299addf7880c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125060 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-11-15Fix typo in codeAndrea Gelmini
Change-Id: Idf4fcf16a11f62334ad77db05974a55b5de5d718 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125206 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2021-11-15qt6: Fix crash on exitMichael Weghorn
Extend the solution from commit fd4bcd5f33fed46cacaa00f90a271b18b6355345 Date: Fri Jun 11 11:50:39 2021 +0200 qt5/kf5: Fix crash on exit to qt6 as well, after seeing equivalent crashes there. Change-Id: If135a60ed4e6302e9ff4fa51cbc12f8b45b797e9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125254 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2021-11-15gtk4: complete do_collect_screenshot_dataCaolán McNamara
Change-Id: I6bb13ca5d174d8a5cccff24953bc2b3057769c78 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125243 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-11-15gtk4: implement CreateChildFrameCaolán McNamara
which gets the extension options tab pages working, e.g. "English Sentence Checking" Change-Id: Ib98f366fdcc7c51f4399372a78f78a655b3c0b86 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125242 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-11-15gtk4: fill in more of the assistant codeCaolán McNamara
Change-Id: Ibcc4eca0abd37c733d60042025c0688a3932002b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125244 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-11-15gtk4: fill in some missing parts of Widget::drawCaolán McNamara
Change-Id: I43af62289369b846f332d350a1a8caa56b6cbe20 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125227 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>