summaryrefslogtreecommitdiff
path: root/vcl/source/window/menufloatingwindow.cxx
AgeCommit message (Collapse)AuthorFilesLines
2020-08-04loplugin:flatten in vcl/windowNoel Grandin1-113/+113
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-05-07tdf#132267 vcl: fix missing scrollers with non-native renderingMiklos Vajna1-4/+7
Regression from c04169c586ef1d55b1d0ac469bb4fbd4f50bd08a (tdf#125415 vcl menu floating window: avoid flicker, 2019-05-21) the problem was that the clip region was set on the buffer, not on the render context. This means the original clip was used to determine what gets copied from the buffer to the screen, so the scroller arrows were not rendered. Change-Id: Id173e6333721891798da58baf2092f4cd21a62ba Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93642 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2020-04-11rename vcl::Window::Update to PaintImmediatelyNoel Grandin1-2/+2
To make the code easier to read. Change-Id: Iebc648150391939fba5d1cd815c72dbcf02ceec6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90378 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-18vcl: sfx2: LOK: Support per-view popup windowsAshod Nakashian1-1/+1
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-04loplugin:singlevalfieldsNoel Grandin1-3/+2
Change-Id: Ic74b400f0b929b4c57ad70d0b0936983a3d46360 Reviewed-on: https://gerrit.libreoffice.org/80154 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-28tdf#42949 Fix IWYU warnings in vcl/source/[o-w]*/Gabor Kelemen1-2/+0
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-05-31tdf#125550 vcl menu bar / floating window: fix text colorMiklos Vajna1-7/+2
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
2019-05-21tdf#125415 vcl menu floating window: avoid flickerMiklos Vajna1-13/+23
This is similar to e8d5b8beb5958147235ff955ed38c47b51d860ff (tdf#113714 vcl menu bar window: avoid flicker, 2019-05-20), except that was for the menu bar window, and this is for the floating window opening from that one. Change-Id: Ib24f4999ad3e8cbbecc058368e9d112e106e9178 Reviewed-on: https://gerrit.libreoffice.org/72688 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2019-03-06loplugin:unnecessaryparen improve member expressionNoel Grandin1-1/+1
Change-Id: I304621018cb1e2a47e478e86df4229bcf2176741 Reviewed-on: https://gerrit.libreoffice.org/68757 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-01-10Resolves: tdf#120632 consider submenus on restoring focus from menuCaolán McNamara1-1/+11
additionally to the menu having focus, if a submenu of that menu has focus, then restore the focus when the whole hierarchy execution ends return focus to the toplevel menu's saved focus widget Change-Id: Iefd467fb1ba67ffd0a303505a893d2453e0ffbb3 Reviewed-on: https://gerrit.libreoffice.org/66115 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-11-27remove unused HelpEventMode enum valueNoel Grandin1-1/+1
Change-Id: I0fffa7b02ac61ef009e566d04b903cc02e9b4b3d Reviewed-on: https://gerrit.libreoffice.org/64062 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-09custom widgets: Fix various warnings.Jan Holesovsky1-1/+1
Change-Id: I5d657fa4d6f63b93ad3775a5641d08c6e0f3a615
2018-11-09LOK: custom widgets: support custom menu colorsAshod Nakashian1-1/+16
Change-Id: Icd6367fa40f9655cd58816461f0d2fca6f6932e2
2018-10-16drop LazyDeletorCaolán McNamara1-2/+2
Change-Id: I7d2e00466f321994a46b0529d645e342f229c929 Reviewed-on: https://gerrit.libreoffice.org/61718 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-10-01pass menuitem ident around directly, instead of deriving from itemidCaolán McNamara1-1/+8
sidestepping the while duplicate itemids in separate submenus problem Change-Id: Icb57ac805f3c8c4fc3a68341e318375c6492cbb1 Reviewed-on: https://gerrit.libreoffice.org/61189 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-07-31Add missing sal/log.hxx headersGabor Kelemen1-0/+1
rtl/string.hxx and rtl/ustring.hxx both unnecessarily #include <sal/log.hxx> (and don't make use of it themselves), but many other files happen to depend on it. This is a continuation of commit 6ff2d84ade299cb3d14d4110e4cf1a4b8070c030 to be able to remove those unneeded includes. This commit adds missing headers to every file found by: grep -FwL sal/log.hxx $(git grep -Elw 'SAL_INFO|SAL_INFO_IF|SAL_WARN|SAL_WARN_IF|SAL_DETAIL_LOG_STREAM|SAL_WHERE|SAL_STREAM|SAL_DEBUG') to directory vcl Change-Id: I205fe0f4e80a66cd9c3b19f7e9716411da1d1cf5 Reviewed-on: https://gerrit.libreoffice.org/58221 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-07-16cppcheck: useInitializationList in vclJochen Nitschke1-14/+13
reorder members of GIFLZWDecompressor to ease initialization. use rtl_allocateZeroMemory in ImplVectMap to avoid memset in ctor. Change-Id: Icfcfe73ec7e52988036995d8dbc604361aee893b Reviewed-on: https://gerrit.libreoffice.org/57481 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2018-06-09return and hold SalMenuItem by std::unique_ptrNoel Grandin1-0/+1
and drop DestroyMenuItem, all the implementations were just deleting the pointer Change-Id: I058817b963988b1e399279f61f45716a2cdba023 Reviewed-on: https://gerrit.libreoffice.org/55500 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-18Related: tdf#117068 inform salframe that there's a modal dialog runningCaolán McNamara1-2/+2
Change-Id: Ie95fbc1586e11396271fb43e6117f39f4f61cb0e Reviewed-on: https://gerrit.libreoffice.org/53086 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-02-26loplugin:oncevar extend to tools/gen.hxx typesNoel Grandin1-2/+1
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 Grandin1-11/+11
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-12More loplugin:cstylecast: vclStephan Bergmann1-4/+4
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable loplugin:cstylecast for some more cases" plus solenv/clang-format/reformat-formatted-files Change-Id: I363c01a1ae9e863fca4fb4589829492d7280d711
2017-12-19menu: pass paint size to ImplPaint and account for buttonsTomaž Vajngerl1-2/+2
When a menu bar is painted it needs to take into account that the buttons (close) is positioned at the right side of the paint area. To do this we need to pass what the output size is when painting (ImplPaint) on the common menu code, instead of assuming the whole area can be used. Change-Id: I2e9d6c686929fe1cd7e28368a8055c1e2df13c49 Reviewed-on: https://gerrit.libreoffice.org/46710 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2017-11-15loplugin:flatten in vclNoel Grandin1-38/+39
Change-Id: I3527477277a9ae96eaf9fd068232f672da7c28c3 Reviewed-on: https://gerrit.libreoffice.org/44753 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-09-11Translate German comments/debug strings (leftovers in dirs vbahelper and vcl)Johnny_M1-1/+1
Translates leftovers found using a custom regex. Additionally: - Translated the "SGV Fonts for StarView" INI file parameter group in vcl/source/filter/sgf.ini and .../sgvtext.cxx Change-Id: I1360aac1a2f3fa825f86d77ac1b05e2de9ffb007 Reviewed-on: https://gerrit.libreoffice.org/42145 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-09-04tdf#39468 Translate German comments/termsAndreas Brandner1-2/+1
Change-Id: I528e7e4b4d365ff512cd03ea22f7517319541e05 Reviewed-on: https://gerrit.libreoffice.org/41907 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2017-08-17remove UL/L suffixes from integer constants on the RHS of expressionsNoel Grandin1-1/+1
Change-Id: I899a8126c9d971601fea6c77eca165718aea0ac5 Reviewed-on: https://gerrit.libreoffice.org/41237 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-20loplugin:unusedfields in vclNoel Grandin1-18/+6
Change-Id: I207866df495ec81bb9288e6d0f664b96d90251d6 Reviewed-on: https://gerrit.libreoffice.org/40217 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-17loplugin:unusedfields in vcl part2Noel Grandin1-1/+0
Change-Id: Icd02f63e9738c0bb91348e2084649f9edc281e67 Reviewed-on: https://gerrit.libreoffice.org/38833 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-04tdf#104686: do not crash if Menu has been somehow disposedAron Budea1-29/+45
The rare crashes in MenuFloatingWindow::ImplGetStartY() and MenuFloatingWindow::ImplScroll(bool) likely happen because of a disposed Menu. Let's guard against invalid accesses. Change-Id: Ie31240abbc48c06edd40d0a95f319725cdb3db16 Reviewed-on: https://gerrit.libreoffice.org/36026 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2017-03-31tdf#82580 tools: rename Rectangle to tools::RectangleMiklos Vajna1-16/+16
Mostly generated using make check COMPILER_EXTERNAL_TOOL=1 CCACHE_PREFIX=clang-rename-wrapper RENAME_ARGS="-qualified-name=Rectangle -new-name=tools::Rectangle" Except some modules have their own foo::tools namespace, so there have to use ::tools::Rectangle. This commit just moves the class from the global namespace, it does not update pre/postwin.h yet. Change-Id: I42b2de3c6f769fcf28cfe086f98eb31e42a305f2 Reviewed-on: https://gerrit.libreoffice.org/35923 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-03-23loplugins:redundantcast teach it about c-style typedef castsNoel Grandin1-1/+1
Change-Id: I1ac11a2481c0f4d8be1e1fd7c7637ac0ece3d65c Reviewed-on: https://gerrit.libreoffice.org/35558 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-25Propagate sal_uInt16/size_t mismatch out of MenuItemList::SearchItemStephan Bergmann1-2/+2
Change-Id: I31ae81876c541979600ecd25ab7a6e3a0e3b0d0b
2017-01-23Change all Idle* LINKs to be Timer*Jan-Marek Glogowski1-3/+3
Seem UBSAN doesn't like my forced reinterpret_cast to set the Idles Link in the Timer class. Now there are two possible solution: 1. convert all (DECL|IMPL).*_LINK call sites to use a Timer* or 2. split the inheritance of Idle from Timer again to maintain different Link<>s and move all common code into a TimerBase. While the 1st is more correct, the 2nd has a better indicator for Idles. This implements the first solution. And while at it, this also converts all call sites of SetTimeoutHdl and SetIdleHdl to SetInvokeHandler and gets rid of some local Link objects, which are just passed to the SetInvokeHandler call. It also introduces ClearInvokeHandler() and replaces the respective call sites of SetInvokeHandler( Link<Timer *, void>() ). Change-Id: I40c4167b1493997b7f136add4dad2f4ff5504b69
2017-01-17tdf#97087 GDB pretty print the Scheduler task listJan-Marek Glogowski1-0/+5
In addition to the GDB pretty printer, this annotates a lot more Timers and Idles. Change-Id: I5b93fab02161b23bb753e65ef92643a04fb0789c
2016-12-07convert VCLEVENT constants to scoped enumNoel Grandin1-7/+7
Change-Id: Ic8ccb0a9715ec05182dacddab2c015b0de6a0fba Reviewed-on: https://gerrit.libreoffice.org/31675 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-14Resolves: tdf#103914 if menu no longer has focus, leave focus where it isCaolán McNamara1-3/+3
In the normal course of events, the menu, or its children, has focus when its popped down, in this case continue to restored the focus to the previous focus window which had it when the menu appeared. If some other non-child window of the menu has focus as popdown time, leave the focus where it is. Change-Id: Ia860f90350653ad4d8056738dacbc434fb364989
2016-11-03tdf#95341: Make last item of menus clickable againXisco Fauli1-1/+1
Regression from 4f1dca5083c5a301181786b563b165f19a9dec7f Change-Id: I7b7f3594499cd049ae59064da244e3f82dff7757 Reviewed-on: https://gerrit.libreoffice.org/28617 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: jan iversen <jani@documentfoundation.org>
2016-10-05Remove _TYPED suffix from tools/link.hxx macrosStephan Bergmann1-5/+5
...which was introduced with 3ead3ad52f9bb2f9d1d6cf8dfc73a0a25e6778ed "Gradually typed Link" to distinguish the new, typed versions from the old, untyped ones, but is no longer necessary since 382eb1a23c390154619c385414bdbe6f6e461173 "remove untyped Link<>" removed the old versions. Change-Id: I494025df486a16a45861fcd8192dfe0275b1103c
2016-09-27Resolves: tdf#102177 focus not restored from context menusCaolán McNamara1-13/+36
the problem being that the attempt to restore the focus in the document in the floatingwindow tear down is blocked because the menus have set that window as modal so the focus isn't set. The attempt to set the focus in the floatingwindow teardown causes the SavedFocus in the menufloatingwindow to be dropped, so the extra layer of code to restore focus after modality is removed doesn't do anything this is fallout from... commit dd46727b99d4bb5135451aa7e5e1bdb197373843 Author: Caolán McNamara <caolanm@redhat.com> Date: Tue Apr 5 15:27:38 2016 +0100 Resolves: tdf#87120 no keyboard navigation inside floating windows which allows the focus to "truly" enter the menus, triggering the floatingwindow attempt, which fails but blocks the menufloatingwindow attempt easiest thing seems to make the restoring modality, and then restore focus, something that MenuFloatingWindow does before it finishes Change-Id: I97a4ac71419dcb04709e4667586d8343e89ddbeb
2016-09-27detangle code that now looks silly since...Caolán McNamara1-12/+6
commit 9b7dfb10641ba7978ffcbd1db0507163411ae027 Author: Caolán McNamara <caolanm@redhat.com> Date: Thu Jun 9 16:52:21 2016 +0100 EndSaveFocus does nothing on the !bRestore case removed the code that made it look like it made sense Change-Id: I2e7280fd6643e86d65cba04c8302be099d6f3d0e
2016-09-27the only place the default xFocusId arg isn't used...Caolán McNamara1-3/+3
the argument is (effectively) equal to the default Change-Id: I26fcd43d2bc8e37e6887c244f728e3231328e34e
2016-08-02gtk2: toggle menubar mnemonics on if any keyinput on it or submenusCaolán McNamara1-1/+17
this is closer to how I seem to see the gtk menubars work (gtk3 is native now so this doesn't affect that) Change-Id: Ie5225d2ccda698946f26408aae95d2a50cbb928b
2016-08-02Related: tdf#92516 make menu accelerators always work even if...Caolán McNamara1-10/+1
keyboard not used yet. The gtk2/3 menus appear to work this way. (And when not in gtk2/3 it shouldn't disable the accelerators for other platforms anyway) Change-Id: Ib7a99bd9039cd07120b3b77380f810b5b028fd57
2016-07-06restore loplugin:vclwidget checking for calling clear() on VclPtr fieldsNoel Grandin1-1/+3
Change-Id: I85eda1c33016c1461d897fc0a3b70457209a7405 Reviewed-on: https://gerrit.libreoffice.org/26806 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-23tdf#97527 - vcl: reference-count MenuNoel Grandin1-8/+8
some places are marked with "dodgy"- need to check those to see what is going on, because they are leaving dangling pointers behind in the Menu class Change-Id: I41d5c7c0fec2f70ce9e3ffdc48cd03d26c0a869b Reviewed-on: https://gerrit.libreoffice.org/26516 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-20Convert PART to scoped enumNoel Grandin1-7/+7
Change-Id: If4c2849beb207593d3d450ae3846ed24eaf66ca4 Reviewed-on: https://gerrit.libreoffice.org/26173 Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-17convert DBG_ASSERT in vclNoel Grandin1-6/+6
Change-Id: I732fb1a789f90ca7a7f393cc41a6afe84fecf3d3 Reviewed-on: https://gerrit.libreoffice.org/26200 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-09Resolves: tdf#100248 vcl menu scroll timer still active post disposeCaolán McNamara1-0/+6
Change-Id: I8988a42e7e505c967661c4a5f3c1e4ef3fbc08e0
2016-06-09EndSaveFocus does nothing on the !bRestore caseCaolán McNamara1-1/+0
Change-Id: I8e199535803faf364469f9b9df46f339febe25c6