[haiku-commits] haiku: hrev44508 - src/kits/tracker

  • From: stpere@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 10 Aug 2012 06:10:37 +0200 (CEST)

hrev44508 adds 1 changeset to branch 'master'
old head: 741e52463a4e1df441230669a38f1bb8832f9674
new head: 4cf0af0607c9b5ad89fdcb5416725e4ae2eb7890

----------------------------------------------------------------------------

4cf0af0: Tracker: Additional cases to cancel double-click detection
  
  Don't wait for a potential second click (and then trigger Widget editing) 
when:
  
  1. a click occurs on a different pose, on a 'pose-less' area or when right 
clicking
  2. when you start dragging something.

                                [ Philippe Saint-Pierre <stpere@xxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev44508
Commit:      4cf0af0607c9b5ad89fdcb5416725e4ae2eb7890
URL:         http://cgit.haiku-os.org/haiku/commit/?id=4cf0af0
Author:      Philippe Saint-Pierre <stpere@xxxxxxxxx>
Date:        Fri Aug 10 04:07:56 2012 UTC

----------------------------------------------------------------------------

2 files changed, 10 insertions(+), 3 deletions(-)
src/kits/tracker/PoseView.cpp   |   12 +++++++++---
src/kits/tracker/TextWidget.cpp |    1 +

----------------------------------------------------------------------------

diff --git a/src/kits/tracker/PoseView.cpp b/src/kits/tracker/PoseView.cpp
index 7137888..0a07665 100644
--- a/src/kits/tracker/PoseView.cpp
+++ b/src/kits/tracker/PoseView.cpp
@@ -7014,6 +7014,8 @@ BPoseView::MouseMoved(BPoint where, uint32 transit, const 
BMessage* dragMessage)
 void
 BPoseView::MouseDragged(const BMessage* message)
 {
+       if (fTextWidgetToCheck != NULL)
+               fTextWidgetToCheck->CancelWait();
        fTrackRightMouseUp = false;
 
        BPoint where;
@@ -7100,6 +7102,10 @@ BPoseView::MouseDown(BPoint where)
        if (pose) {
                AddRemoveSelectionRange(where, extendSelection, pose);
 
+               if (fTextWidgetToCheck != NULL && (pose != fLastClickedPose
+                               || (buttons & B_SECONDARY_MOUSE_BUTTON) != 0))
+                       fTextWidgetToCheck->CancelWait();
+
                if (!extendSelection && !fTrackRightMouseUp && 
WasDoubleClick(pose, where)) {
                        // special handling for Path field double-clicks
                        if (!WasClickInPath(pose, index, where))
@@ -7108,6 +7114,8 @@ BPoseView::MouseDown(BPoint where)
        } else {
                // click was not in any pose
                fLastClickedPose = NULL;
+               if (fTextWidgetToCheck != NULL)
+                       fTextWidgetToCheck->CancelWait();
 
                window->Activate();
                window->UpdateIfNeeded();
@@ -7224,10 +7232,8 @@ BPoseView::WasDoubleClick(const BPose* pose, BPoint 
point)
                fLastClickPt.Set(LONG_MAX, LONG_MAX);
                fLastClickedPose = NULL;
                fLastClickTime = 0;
-               if (fTextWidgetToCheck != NULL) {
+               if (fTextWidgetToCheck != NULL)
                        fTextWidgetToCheck->CancelWait();
-                       fTextWidgetToCheck = NULL;
-               }
                return true;
        }
 
diff --git a/src/kits/tracker/TextWidget.cpp b/src/kits/tracker/TextWidget.cpp
index 46333ad..1a0f93e 100644
--- a/src/kits/tracker/TextWidget.cpp
+++ b/src/kits/tracker/TextWidget.cpp
@@ -245,6 +245,7 @@ void
 BTextWidget::CancelWait()
 {
        fLastClickedTime = 0;
+       fParams.poseView->SetTextWidgetToCheck(NULL);
 }
 
 


Other related posts:

  • » [haiku-commits] haiku: hrev44508 - src/kits/tracker - stpere