summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-09-14 23:34:57 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-09-14 23:34:57 +0300
commit28e6ce451c3d01333a805f11286dacc9f3157c54 (patch)
treee9e4dd49e9a155e77d79977c4c9ad93677c35cdf
parentb09c19d27ceb2a3695cd688b1ccffcb3084f0e46 (diff)
SL-20269 Tab's focus jumps over item when clicking on edge items
-rw-r--r--indra/llui/lltabcontainer.cpp8
-rw-r--r--indra/llui/lltabcontainer.h1
2 files changed, 8 insertions, 1 deletions
diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp
index f15e9771c0..76b9e448a1 100644
--- a/indra/llui/lltabcontainer.cpp
+++ b/indra/llui/lltabcontainer.cpp
@@ -605,6 +605,7 @@ BOOL LLTabContainer::handleMouseDown( S32 x, S32 y, MASK mask )
LLButton* tab_button = getTab(index)->mButton;
gFocusMgr.setMouseCapture(this);
tab_button->setFocus(TRUE);
+ mMouseDownTimer.start();
}
}
if (handled) {
@@ -653,7 +654,11 @@ BOOL LLTabContainer::handleHover( S32 x, S32 y, MASK mask )
handled = LLPanel::handleHover(x, y, mask);
}
- commitHoveredButton(x, y);
+ F32 drag_delay = 0.25f; // filter out clicks from dragging
+ if (mMouseDownTimer.getElapsedTimeF32() > drag_delay)
+ {
+ commitHoveredButton(x, y);
+ }
return handled;
}
@@ -699,6 +704,7 @@ BOOL LLTabContainer::handleMouseUp( S32 x, S32 y, MASK mask )
}
commitHoveredButton(x, y);
+ mMouseDownTimer.stop();
LLPanel* cur_panel = getCurrentPanel();
if (hasMouseCapture())
{
diff --git a/indra/llui/lltabcontainer.h b/indra/llui/lltabcontainer.h
index 8f8cedb1b9..aa4a08c4ff 100644
--- a/indra/llui/lltabcontainer.h
+++ b/indra/llui/lltabcontainer.h
@@ -320,6 +320,7 @@ private:
LLUIColor mTabsFlashingColor;
S32 mTabIconCtrlPad;
bool mUseTabEllipses;
+ LLFrameTimer mMouseDownTimer;
};
#endif // LL_TABCONTAINER_H