summaryrefslogtreecommitdiff
path: root/vcl
AgeCommit message (Collapse)Author
2021-11-23O[U]String::replaceAt overloads that take string_viewNoel Grandin
which results in lots of nice string_view improvements picked up by the plugins Change-Id: Ib0ec3887816b3d4436d003b739d9814f83e244b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125657 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-23tdf#129638 print preview: use new paper size after switching pageJustin Luth
This is a partial revert of LO 6.3 commit 2c23a96f7b6888c0e05fdc2aba57f03cd797b647. Change-Id: I17525d06d96779671caaa84e1e48629289453ad2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125685 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2021-11-23gtk3: reuse popover replacement as mouse event widgetCaolán McNamara
Change-Id: I99aa1f1843c5ff6e4c76716178e721a96ae284fa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125676 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-11-22Use less DegreeN::get()Mike Kaganski
Change-Id: I97b8d6282c72307cc29a913af221d283523f2fae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125653 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-11-22handle filling and stroking at the same time if possibleLuboš Luňák
All tests still pass, so the end result should be the same, but this way it's done in one call. Change-Id: If5da34837a45ad600ae30568e4ba7651ac5838bf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125644 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-11-22move code to helper functionsLuboš Luňák
I'll want some common extra functionality there later. Change-Id: I249f9ca4662fc8e8d52c58b1bd33293f363464d8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125643 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-11-22tdf#133835 speedup calc autofilter (7)Noel Grandin
vcl::Font avoid allocating a new instance if the setter doesn't change anything, saves 5% Change-Id: I461a2a8e3709b3f3f20e431cb3b976ad47bed0ac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125625 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-22Related: tdf#145786 cooperate between our own grabsCaolán McNamara
don't try to workaround a grab if the grab is done by another of our own popups, and on tearing down one of our popups, restore the grab of its parent if that parent was one of our own popups. This typically matters on X where we don't use GtkPopovers (unlike wayland, where Popovers can escape the parent window). Things to test are: writer's watermark dialog: click the color button to get the 1st level popup, then click the combobox to get the 2nd level one, select an entry to return to the 1st level. a) Clicking a valueset element should select that color, not dismiss the popup without selecting a color. b) Clicking the combobox to get the popup again should result in a popup where the focus still follows the mouse (i.e. the 1st level popup doesn't try and steal away the 2nd level grab) sidebar: same scenario as above, except a color popover parented to a sidebar pane and not a dialog. Change-Id: Ib5d765b22b8a9b6b1a7806676c8fe3cfb7709734 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125638 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-11-22gtk3: popover replacement for GtkMenuButton has to be modalCaolán McNamara
Change-Id: If1b18c4b39fbe82fd613ff0f62f0ff60fdaeeed8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125637 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-11-21gtk3: consider replacement for popovers visibility when queryed for itCaolán McNamara
Change-Id: I4ca71f8544720e99514abe78717dcd07617c00cc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125475 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-11-20gtk3: don't double close popover replacementCaolán McNamara
Change-Id: Ibdd7de56ab1cadd76748422c08e21904f912532a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125567 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-11-20Use C++17 hexadecimal exponent floating point literalsHossein
Using new syntax for the power of 2 exponent instead of using shift left (<<) operator Change-Id: Iaa627800fb35af37a6b0efcd939f1d5f78f70e5a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125458 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-11-19add placement to Popover popup_at_rectCaolán McNamara
Change-Id: Iaa12a48f62037dd985d526993a07762b10bd0cee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125474 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-11-19fix gtk4 buildRene Engelhard
res is only defined if NDEBUG is *not* defined. So it doesn't exist in a "standard" build using -DNDEBUG and shouldn't be used. Change-Id: Iebae9898d50030f994a7289e2bc3fe3052172dee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125582 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-11-19Use more basegfx::deg2rad<N> and basegfx::rad2deg<N>Mike Kaganski
Change-Id: I9dc57628b98f67994d546f6887e96389be1efe62 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125568 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-11-19gtk3: treat standalone GtkPopover similarly to the GtkMenuButton managed oneCaolán McNamara
so do the same replacement with GtkWindow under X11 for gtk3 that we do in MenuButtons for the popover with direct popovers when the constraint is GTK_POPOVER_CONSTRAINT_NONE Change-Id: Ia903b24c54e6d3acc18df1ab912600e07b7f844d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125543 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-11-19Drop F_PI1800/F_PI18000, and unify deg2rad/rad2deg conversionsMike Kaganski
Change-Id: Ib89b00c3dc8cd440e8a88906eea133becd1cef64 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125509 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
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>