summaryrefslogtreecommitdiff
path: root/vcl/source/window/brdwin.cxx
AgeCommit message (Collapse)Author
2023-08-18vcl: Deduplicate 2 common lines for border win framesMichael Weghorn
These 2 members are set the same way for all of the 3 branches. Change-Id: I2acbb519e30926eb5798bb52e1ef95dceca47b5d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155796 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-08-02split Point/Size/Rectangle into AbsoluteScreenPixel* typesNoel Grandin
to attempt to make it obvious in code what kind of coordinate system we are dealing with. The idea is that by doing this, the compile-time type checking will flush out inconsistencies between different code. I started with vcl::Window::OutputToAbsoluteScreenPixel and worked outwards from there. Change-Id: Ia967d7a0bb38886695f3a761b85c8b9340ddb1c0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154676 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-11-02also apply PaintTransparent to a widget's SubEdit if it has oneCaolán McNamara
Change-Id: If56e54929dd2ba988c2fa012370100378c2b2c13 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142175 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-10-07Related: tdf#98067 do RollOver for Edit as well as SpinButtonCaolán McNamara
Change-Id: I058cc965a9b0d85e5491191e2ac712c01f700043 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141086 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-10-07Related: tdf#98067 use EP_EDITBORDER_NOSCROLL for EditsCaolán McNamara
which gives a border which indicates if the Edit has focus or not. In High Contrast Black this is a bright yellow and I see it in notepad and visual studio, so lets do that too. MultilineEdit left alone for now Change-Id: I6785e3cdef7d563509a3a6ea8617ab5f89602a6f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141085 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-07-28gtk4: don't attempt to create a visual junction between float and launcherCaolán McNamara
the alignment won't match when using GtkPopover to implement these, there's an extra border+margin between the launcher and the contents Change-Id: Idb78d903874fee5a28e87c89951d9b3f9063c547 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137554 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-01-18Avoid endless recursion in ImplSmallBorderWindowView::InitStephan Bergmann
At least on macOS, some `make screenshot` tests crashed for me due to endless recursion, like the processing of modules/swriter/ui/converttexttable.ui in CppunitTest_sw_dialogs_test for LO_TEST_LOCALE=gu: [...] > ImplSmallBorderWindowView::Init at vcl/source/window/brdwin.cxx:557:20 > ImplBorderWindow::Resize at vcl/source/window/brdwin.cxx:1736 > vcl::Window::queue_resize at vcl/source/window/window2.cxx:1351:28 > ImplSmallBorderWindowView::Init at vcl/source/window/brdwin.cxx:557:20 > ImplBorderWindow::Resize at vcl/source/window/brdwin.cxx:1736 > vcl::Window::queue_resize at vcl/source/window/window2.cxx:1351:28 > ImplSmallBorderWindowView::Init at vcl/source/window/brdwin.cxx:557:20 [...] where in the calls to ImplSmallBorderWindowView::Init, nWidth=24 and nHeight=31, as well as mnLeftBorder=6, mnTopBorder=6, and mnBottomBorder=6 remain stable, but mnRightBorder keeps changing between 6 and 5. This appears to be caused by instabilities in the ImplLogicToDevicePixel and ImplDevicePixelToLogic calculations in OutputDevice::GetNativeControlRegion (vcl/source/outdev/nativecontrols.cxx), which can be avoided when we compute a hypothetical native control region from aCtrolRegion that includes the borders, and only remove the borders from the resulting aBounds and aContent. (The code to shrink aCtrlRegion prior to calling GetNativeControlRegion had been introduced with 27be8a263eddb54cb6b66cc0f832bfd02016a694 "KDE4 fix edit box borders".) Change-Id: I88c0d15ae7045a6888768226ca4d5fdd66bb41ca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128549 Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de> Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins
2021-09-23WB_DEFAULTWIN should be sufficient to flag that no icon is requiredCaolán McNamara
Change-Id: Ibb5d8331d5d47e2b5c163c2797b2e7b5cee4b285 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122517 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-09-23tdf#144624 Prevent infinite recursion when loading SVG iconAleksei Nikiforov
When Generic/X11 VCL backend plugin loads SVG icon, it creates virtual device for rasterizing an SVG icon, which in turn tries to load an SVG icon, and thus infinite recursion happens. Change-Id: I7559b6255e6718e64ef4a6e7c79d597375e5823a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122344 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-09-20clean up ambiguous confusing rectangle APIs like IsInside()Luboš Luňák
Reading 'rectA.IsInside( rectB )' kind of suggests that the code checks whether 'rectA is inside rectB', but it's actually the other way around. Rename IsInside() -> Contains(), IsOver() -> Overlaps(), which should make it clear which way the logic goes. Change-Id: I9347450fe7dc34c96df6d636a4e3e660de1801ac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122271 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Luboš Luňák <l.lunak@collabora.com> Tested-by: Jenkins
2021-08-03Pass context and resource string down to boost::locale separatelyNoel Grandin
because this is often on a hot path, and we can avoid the splitting and joining of strings like this. Change-Id: I2a24a123a64b762fd0741c45eaca3ad4bdd5580d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119884 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-06-28loplugin:indentation improve checks for brace alignmentNoel Grandin
Change-Id: I333100fda7e181f68f36b03279b3fbb8cb768310 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117615 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-18fix some castsNoel Grandin
after commit 9090dc1f3b27195f5defd35586ac79357992be21 Date: Mon Jan 18 18:27:19 2021 +0200 split OutputDevice from Window Change-Id: I2622c9814ec18c98364a7eb18084759f17c80f14 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115762 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-17split OutputDevice from WindowNoel Grandin
as part of a longer-term goal of doing our widget rendering only inside a top-level render- context. I moved all of the OutputDevice-related code that existed in vcl::Window into a new subclass of OutputDevice called WindowOutputDevice. Notes for further work (*) not sure why we are getting an 1x1 surface in SvpSalGraphics::releaseCairoContext, but to fix it I clamp the size there (*) might have to dump VCLXDevice, and move it's code down into VCLXWindow and VCLXVirtualDevice (*) can we remove use of VCLXDevice in other places, in favour of just talking to the VCL code? Change-Id: I105946377f5322677d6f7d0c1c23847178a720b6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113204 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-03-04macOS: use HITheme to draw listbox window borderNoel Grandin
Change-Id: I39fd6f643649bc405447d10e7072ae6dabd679b6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111935 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-03-03vcl/floatwin.hxx can be toolkit only nowCaolán McNamara
Change-Id: Ifd8f58771ea6f9212a0dca7d4550c86ebecd9333 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111814 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-02-25drop archaic rollable supportCaolán McNamara
Change-Id: I69f94cd8013a31f8f6bcf62d703b99f659a1ebb4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111555 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-02-25drop WB_ROLLABLECaolán McNamara
as far as I can see Rollable isn't a thing anymore Change-Id: I274e9dc88c793a5833e26bce292b4e92617ae084 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111554 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-01-28tdf#122714 Avoid tracking mode for a toolbar's title menu buttonMaxim Monastirsky
Regression of commit c3e552ac25be001a623469c549ee8d0719b98133 ("wayland: Make popup menus not show off-screen"). Apparently executing the menu async used to give the tracking mode a chance to be turned off. Avoid the problem by not activating that mode in the first place. And because the Tracking method will no longer be executed, we also need to reset the "pressed" state here instead. Change-Id: Iab63f1eaada1f4945507d6bdd05dc6171e6afbab Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110029 Tested-by: Jenkins Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
2020-10-22tdf#136866 VCL don't drop the control backgroundJan-Marek Glogowski
Since tdf#136094, we handle the background color for native controls. So we shouldn't set the control window to transparent, if a control background is set. I'm not sure, if this just papers over a more general bug, but even if we report a border in native painting, the original window shouldn't be painted anyway. Change-Id: I86267028214586d46ca9ba0b2288d4729abef16f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104621 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins
2020-10-19use tools::Long in vclNoel
Change-Id: Ice1055021e8568634e9a66ba89d3bb4ef4e731df Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104522 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-10-16WindowType::CALCINPUTLINE newly unusedCaolán McNamara
originally introduced by... commit cba0dad4566652f63ea3114660da4e5c7dd88c31 Date: Wed Jun 13 14:08:28 2012 +0200 calc input line: Fix crash with accessibility enabled. Change-Id: Iee0914b79d3b48f4479e62622fbdb5dbdf26d527 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104356 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-02move Edit into toolkit only headersCaolán McNamara
Change-Id: If51bf7143116721e8f16272cf8aff797651d5ed1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101880 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-08-25tdf#136094 Handle background color in drawNativeControlMichael Weghorn
Make gtk3's 'GtkSalGraphics::drawNativeControl' take into account a control's background color, if any is explicitly set: Set background/fill color (in 'Edit::ApplySettings') also for the case where the control is drawn "natively", but don't draw the background in the generic 'Window::Erase' method for the case of native drawing; instead handle it when drawing the control itself. This adds an additional parameter to pass the background color to the relevant '{d,D}rawNativeControl' methods (defaulting to 'COL_AUTO') and implements the required handling to apply the background color for the gtk3 case. qt5/kf5 will probably be handled in an upcoming commit as well. Windows as well as the "gen" VCL plugin were not affected by the issue, so remain unchanged and just ignore the new parameter. In a quick test on on macOS, the rendering of the controls in the sample doc was broken beyond just the missing background colors (s. screenshot attached to tdf#136094); the behavior there also remains unchanged by this patch, the new parameter is ignored for now. Change-Id: I01923a504fea2367ae96032104f09099e35f410e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101284 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Michael Weghorn <m.weghorn@posteo.de>
2020-08-04loplugin:flatten in vcl/windowNoel Grandin
Change-Id: I94e69e988f038e85b1fb78985211d478bb5ed9b4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100033 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-03remove some dead WindowType valuesNoel Grandin
Change-Id: I7eb67e48a87e8cc2babbd46d482294877b08ab99 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97828 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-29tdf#133498 Make native drawing of FormattedField work (again)Michael Weghorn
Commit 2a694f9e0e7789b4b3b792a9eedd29366fa10c1c ("lok: fix the window type of the formatted field control", 2020-05-06) had introduced the new 'WindowType::FORMATTEDFIELD' and sets it for the 'FormattedField' control, instead of using the previous default value set in the 'SpinField' ctor, which is 'WindowType::SPINFIELD'. This commit adds the corresponding 'WindowType::FORMATTEDFIELD' cases relevant to make native drawing of the control work (again). Also map the corresponding accessibility roles. Change-Id: Ied0b0548c03dee3feaf1b6252c81b2a33b68b938 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95156 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2020-04-17loplugin:buriedassign in vclNoel Grandin
Change-Id: I529052c1ba7591d91d3848080af8b06e077b6f14 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92409 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-26remove some unused local varsNoel Grandin
found by a more aggressive variant of loplugin:unusedvariables. This is my first pass, committing the simplest and most obviously unnecessary vars Change-Id: I9676a6e39a101937097788548764506c93811c57 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87414 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-18vcl: sfx2: LOK: Support per-view popup windowsAshod Nakashian
While we do support multiple views, there is only one state for popup/floating windows, that also includes the dialogs open and related windows/data. This adds support to allow each view to have its own popups and state, thus allowing multiple users to interact with the dialogs independently of one another. (cherry picked from commit b50c341a53911f1d725947a4d8d3d2f782c94079) Change-Id: I3786a561ca6ca113ad12425bdb491e5a30bd1a28 Reviewed-on: https://gerrit.libreoffice.org/82440 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Ashod Nakashian <ashnakash@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/85221 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2019-10-08loplugin:redundantpointerops simplify *p.get()Noel Grandin
Change-Id: I12517651fb3f777fd08e384992bb3e84b340ad85 Reviewed-on: https://gerrit.libreoffice.org/80382 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-06Fixing '....' and '..'Andrea Gelmini
Change-Id: I926069d6c1f2712e5020d930f7ff6c62fd00e912 Reviewed-on: https://gerrit.libreoffice.org/78667 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-08-28tdf#42949 Fix IWYU warnings in vcl/source/[o-w]*/Gabor Kelemen
Plus a quick recheck for files in vcl/source/[a-g]*/ Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Ia1ae951047be2e034da5f3b0422613ddb0a091ad Reviewed-on: https://gerrit.libreoffice.org/78065 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-07-19Engine to add Extension inside extension tab in NotebookBarSumit Chauhan
The patch provides backend for adding the extension.Schema for the adding extension in notebookbar can be seen here https://gerrit.libreoffice.org/#/c/75134/ Change-Id: I10f0e83d1aaec5330c80b3b53cf59a21b93be015 Reviewed-on: https://gerrit.libreoffice.org/75650 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
2019-02-13Pointer is pointlessNoel Grandin
since it is just a wrapper around PointerStyle Change-Id: I51f065e0d4ad8bd91f5c84c5819048c720a19267 Reviewed-on: https://gerrit.libreoffice.org/67711 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-29Rename Mac OS X to official name macOS in comments and documentationBartosz Kosiorek
Change-Id: I651b7f202fa52ff5f5357a11aa72c43eb7dc7f95 Reviewed-on: https://gerrit.libreoffice.org/64102 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2018-11-21loplugin:redundantfcast improvementsNoel Grandin
check for calls to constructors, and extend the list of types we check for unnecessary temporary creation Change-Id: Ia2c1f202b41ed6866779fff5343c821128033eec Reviewed-on: https://gerrit.libreoffice.org/63472 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-15loplugin:staticmethods in vclNoel Grandin
Change-Id: I00333677db711761510a35dfae5ce70d61fb9491 Reviewed-on: https://gerrit.libreoffice.org/63397 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-03tdf#120703 PVS: V547 Expression is always true/falseMike Kaganski
Change-Id: I856345576ff5c10a41509a97ad4539272bd55568 Reviewed-on: https://gerrit.libreoffice.org/62803 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-10-24clang-tidy performance-unnecessary-copy-init in test..xmlscriptNoel Grandin
Change-Id: I1ae16467a8e58e8a50f59b7a140e9f8b68bde07e Reviewed-on: https://gerrit.libreoffice.org/62254 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-27loplugin:returnconstant in vclNoel Grandin
Change-Id: I597ef6d75d1c21cdc15a91bf7f549bc14c851506 Reviewed-on: https://gerrit.libreoffice.org/58086 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-06tdf#107266 made background continous for menubar and notebookbarKshitij Pathania
Change-Id: Ieed538741f2a252c8acf1e751bb2ddbe6361b2fa Reviewed-on: https://gerrit.libreoffice.org/55118 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Tested-by: Szymon Kłos <szymon.klos@collabora.com>
2018-04-16loplugin:useuniqueptr in ImplBorderWindowNoel Grandin
Change-Id: Iabff2048cd3f990fe359b8a281a1eb3af2bb9c32 Reviewed-on: https://gerrit.libreoffice.org/52890 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-26loplugin:oncevar extend to tools/gen.hxx typesNoel Grandin
Change-Id: I5c75875da44334569c02e2ff039b33c38397a0a2 Reviewed-on: https://gerrit.libreoffice.org/50283 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-22loplugin:changetoolsgen in vclNoel Grandin
Change-Id: I0fc68cf51fb23ed9bb86a5087e8247c81b024494 Reviewed-on: https://gerrit.libreoffice.org/50107 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-21Make the condition more obviousMaxim Monastirsky
No need to look at possible enum values each time. Change-Id: I3191ab08d91c8f954ecfb027f1ab26b25a021f14 Reviewed-on: https://gerrit.libreoffice.org/48258 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
2018-01-19new loplugin:emptyifNoel Grandin
Change-Id: I1092115a0ceb3a5e6680a4b724b129f98a892c42 Reviewed-on: https://gerrit.libreoffice.org/48128 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-18Move toolbars to the border window tearoff mechanismMaxim Monastirsky
and remove the one from ImplPopupFloatWin. Implemented using the FloatWinTitleType::TearOff case, which was unused otherwise. Change-Id: I82a86e5f5897ce1f2e76a2404bb382cbc007700c Reviewed-on: https://gerrit.libreoffice.org/48095 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
2018-01-18tdf#115057 Never use ImplPopupFloatWin for anything except ToolBoxMaxim Monastirsky
ImplPopupFloatWin draws the window title and frame directly on the client window, which is incompatible with .ui layouts, as they try to occupy the whole available space. Instead just use a plain FloatingWindow whenever possible, and change the border window code to mimic the behavior of ImplPopupFloatWin, wrt removing part of the frame of toolbar popups w/o a title. Change-Id: If72ea89e31f913470faad7fcb8083f9b9787c9a8 Reviewed-on: https://gerrit.libreoffice.org/48094 Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com> Tested-by: Maxim Monastirsky <momonasmon@gmail.com>
2017-09-23vcl: Drop a couple of unused member variablesTakeshi Abe
Its usage was gone at df6ba2adbaeea9c5abe6e3ea0a583ec78ca9e7bd. Change-Id: Ia153cb8fb9247818684be09a81ac5eabdb1120e4 Reviewed-on: https://gerrit.libreoffice.org/42682 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>