summaryrefslogtreecommitdiff
path: root/indra/llui/lltabcontainer.cpp
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2023-10-04 08:45:47 -0400
committerNat Goodspeed <nat@lindenlab.com>2023-10-04 08:45:47 -0400
commitc26123e11f576a43a3bbe3125e86814038096f74 (patch)
tree383c0101a79348e59037c854c3418571e05694d7 /indra/llui/lltabcontainer.cpp
parente2ea42cb6a078d250a5d1c7ee81be355bde669bc (diff)
parent2465470817957c8378e81ec1a7e32551fbac7b26 (diff)
SL-18837: Merge branch 'main' of secondlife/viewer into actions
Diffstat (limited to 'indra/llui/lltabcontainer.cpp')
-rw-r--r--indra/llui/lltabcontainer.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp
index 8c841540a5..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())
{
@@ -1002,7 +1008,7 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel)
}
else
{
- //Scip tab button space if they are invisible(EXT - 576)
+ // Skip tab button space if tabs are invisible (EXT-576)
tab_panel_top = getRect().getHeight();
tab_panel_bottom = LLPANEL_BORDER_WIDTH;
}
@@ -1017,9 +1023,9 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel)
}
else
{
- tab_panel_rect = LLRect(LLPANEL_BORDER_WIDTH,
+ tab_panel_rect = LLRect(LLPANEL_BORDER_WIDTH * 3,
tab_panel_top,
- getRect().getWidth()-LLPANEL_BORDER_WIDTH,
+ getRect().getWidth() - LLPANEL_BORDER_WIDTH * 2,
tab_panel_bottom );
}
child->setFollowsAll();
@@ -1106,7 +1112,7 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel)
p.follows.flags = p.follows.flags() | FOLLOWS_TOP;
}
else
- {
+ {
p.name("htab_"+std::string(child->getName()));
p.visible(false);
p.image_unselected(tab_img);