diff options
author | Armin Le Grand (Allotropia) <Armin.Le.Grand@me.com> | 2021-07-28 19:01:15 +0200 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@me.com> | 2021-07-31 18:37:01 +0200 |
commit | ca7dab5d96e73b7b4b045e2460e0b2ee150757db (patch) | |
tree | 2edf938e81dbea8bfc707958f257dabf55dacede /vcl/inc/svimpbox.hxx | |
parent | 95f5c4fb555407461fc1ab41aedbb9043105b9d6 (diff) |
tdf#143114 Avoid StartDrag on TreeListBox when CaptureOnButton
The original method SvTreeListBox::StartDrag always triggers
a MouseButtonUp event and tries to initiate a Drag of a Line of
a TreeListBox (on MouseMove, btw).
This is not wanted if the last MouseButtonDown started a
ButtonActive mode and activated CaptureMouse, prepared to
trigger Action on that Button on MouseButtonUp. It leads to
unwanted/strange behaviour of Buttons/CheckBoxes when used in
TreeListBoxes.
The behaviour is also dependent on the UI implementation used
under Linux (gen/gtk3_kde5/gtk3/qt5/kf5) which are all
(unfortunately) behaving differently, but a first suggestion/
step to enhance the situation.
Found now for gen/qt5/kf5 that when on the LineEntry, but
not on the CheckBox, on MouseButtonUp the other line gets
switched. Corrected that.
Note: for gtk3_kde5/gtk3 there remains the problem that the
CheckBoxes get switched on MouseButtonDown, butt these are
generic widgets and this needs to be solved differently.
Change-Id: If4cfe894b716185293beff64fc7e482d6f6313d3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119644
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
Diffstat (limited to 'vcl/inc/svimpbox.hxx')
-rw-r--r-- | vcl/inc/svimpbox.hxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/vcl/inc/svimpbox.hxx b/vcl/inc/svimpbox.hxx index 554c5a8070ae..c46003c35dd4 100644 --- a/vcl/inc/svimpbox.hxx +++ b/vcl/inc/svimpbox.hxx @@ -310,8 +310,17 @@ public: bool IsSelectable( const SvTreeListEntry* pEntry ); void SetForceMakeVisible(bool bEnable) { mbForceMakeVisible = bEnable; } + + // tdf#143114 allow to ask if CaptureOnButton is active + // (MouseButtonDown hit on SvLBoxButton, CaptureMouse() active) + bool IsCaptureOnButtonActive() const; }; +inline bool SvImpLBox::IsCaptureOnButtonActive() const +{ + return nullptr != m_pActiveButton && nullptr != m_pActiveEntry; +} + inline Image& SvImpLBox::implGetImageLocation( const ImageType _eType ) { return m_aNodeAndEntryImages[_eType]; |