diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-10-26 16:59:53 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-10-26 20:50:17 +0200 |
commit | 5714eb5fe369672cde2459e8fe4ec0169190dff0 (patch) | |
tree | 7745aee0d13bfa2ddfa3dbe05dc650753634f0fa /svtools | |
parent | 20572726601760dfc59422e25dd2e56aa4069291 (diff) |
grab focus if clicked on anywhere, not just on a specific value
Change-Id: I03b47080707c469d49e6cd9148573522d7f79da9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124232
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/control/valueset.cxx | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx index c30ada1d4ba3..c2baa2d5a483 100644 --- a/svtools/source/control/valueset.cxx +++ b/svtools/source/control/valueset.cxx @@ -481,20 +481,27 @@ bool ValueSet::MouseButtonDown( const MouseEvent& rMouseEvent ) { if (rMouseEvent.IsLeft() && !rMouseEvent.IsMod2()) { + bool bConsumed = false; ValueSetItem* pItem = ImplGetItem( ImplGetItem( rMouseEvent.GetPosPixel() ) ); - if (pItem) + if (rMouseEvent.GetClicks() == 1) { - if (rMouseEvent.GetClicks() == 1) + if (pItem) { - SelectItem( pItem->mnId ); - if (!(GetStyle() & WB_NOPOINTERFOCUS)) - GrabFocus(); + SelectItem(pItem->mnId); + bConsumed = true; } - else if ( rMouseEvent.GetClicks() == 2 ) - maDoubleClickHdl.Call( this ); - - return true; + if (!(GetStyle() & WB_NOPOINTERFOCUS)) + { + GrabFocus(); + bConsumed = true; + } + } + else if (pItem && rMouseEvent.GetClicks() == 2) + { + maDoubleClickHdl.Call(this); + bConsumed = true; } + return bConsumed; } return CustomWidgetController::MouseButtonDown( rMouseEvent ); |