From 23a1b7bad5147ee48d7f920085426d8846559af7 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 15 May 2020 14:54:58 +0100 Subject: Resolves: tdf#132461 set color on mouse release, not press MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit and rearrange to allow dnd to drop the currently selected color, not the one seen by SelectHdl which is now called on mouse release which allows the dnd from color bar to gradiant tool to work as expected Change-Id: Ib54850ff8f73dc3a0d08c76060309a7a74d2cc8b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94314 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- svtools/source/control/valueset.cxx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'svtools') diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx index e195f195f48d..4bc20997393f 100644 --- a/svtools/source/control/valueset.cxx +++ b/svtools/source/control/valueset.cxx @@ -477,7 +477,6 @@ bool ValueSet::MouseButtonDown( const MouseEvent& rMouseEvent ) SelectItem( pItem->mnId ); if (!(GetStyle() & WB_NOPOINTERFOCUS)) GrabFocus(); - Select(); } else if ( rMouseEvent.GetClicks() == 2 ) maDoubleClickHdl.Call( this ); @@ -489,6 +488,17 @@ bool ValueSet::MouseButtonDown( const MouseEvent& rMouseEvent ) return CustomWidgetController::MouseButtonDown( rMouseEvent ); } +bool ValueSet::MouseButtonUp( const MouseEvent& rMouseEvent ) +{ + if (rMouseEvent.IsLeft() && !rMouseEvent.IsMod2()) + { + Select(); + return true; + } + + return CustomWidgetController::MouseButtonUp( rMouseEvent ); +} + bool ValueSet::MouseMove(const MouseEvent& rMouseEvent) { // because of SelectionMode -- cgit