diff options
author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2023-10-03 19:28:18 +0300 |
---|---|---|
committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2023-10-03 19:42:47 +0300 |
commit | 13f1273c1d0cd7af382b282bd54da2b7efcc70b3 (patch) | |
tree | 31a0e89bd7fe86a91b0fccf3f33642af0741c7bc /indra/llui/llview.cpp | |
parent | 78f5dbd95f1295af14093807ca125b92e6f5a9d3 (diff) | |
parent | 2465470817957c8378e81ec1a7e32551fbac7b26 (diff) |
Merge branch 'main' into DRTVWR-588-maint-W
# Conflicts:
# indra/llui/lltooltip.h
# indra/newview/llinventoryfunctions.cpp
# indra/newview/llvovolume.cpp
# indra/newview/skins/default/textures/textures.xml
Diffstat (limited to 'indra/llui/llview.cpp')
-rw-r--r-- | indra/llui/llview.cpp | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 3344300635..da7868d804 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -311,7 +311,13 @@ bool LLView::addChild(LLView* child, S32 tab_group) } child->mParentView = this; - updateBoundingRect(); + if (getVisible() && child->getVisible()) + { + // if child isn't visible it won't affect bounding rect + // if current view is not visible it will be recalculated + // on visibility change + updateBoundingRect(); + } mLastTabGroup = tab_group; return true; } @@ -581,6 +587,7 @@ void LLView::deleteAllChildren() delete viewp; mChildList.pop_front(); } + updateBoundingRect(); } void LLView::setAllChildrenEnabled(BOOL b) @@ -879,6 +886,17 @@ LLView* LLView::childFromPoint(S32 x, S32 y, bool recur) return 0; } +F32 LLView::getTooltipTimeout() +{ + static LLCachedControl<F32> tooltip_fast_delay(*LLUI::getInstance()->mSettingGroups["config"], "ToolTipFastDelay", 0.1f); + static LLCachedControl<F32> tooltip_delay(*LLUI::getInstance()->mSettingGroups["config"], "ToolTipDelay", 0.7f); + // allow "scrubbing" over ui by showing next tooltip immediately + // if previous one was still visible + return (F32)(LLToolTipMgr::instance().toolTipVisible() + ? tooltip_fast_delay + : tooltip_delay); +} + BOOL LLView::handleToolTip(S32 x, S32 y, MASK mask) { BOOL handled = FALSE; @@ -888,14 +906,7 @@ BOOL LLView::handleToolTip(S32 x, S32 y, MASK mask) std::string tooltip = getToolTip(); if (!tooltip.empty()) { - static LLCachedControl<F32> tooltip_fast_delay(*LLUI::getInstance()->mSettingGroups["config"], "ToolTipFastDelay", 0.1f); - static LLCachedControl<F32> tooltip_delay(*LLUI::getInstance()->mSettingGroups["config"], "ToolTipDelay", 0.7f); static LLCachedControl<bool> allow_ui_tooltips(*LLUI::getInstance()->mSettingGroups["config"], "BasicUITooltips", true); - // allow "scrubbing" over ui by showing next tooltip immediately - // if previous one was still visible - F32 timeout = LLToolTipMgr::instance().toolTipVisible() - ? tooltip_fast_delay - : tooltip_delay; // Even if we don't show tooltips, consume the event, nothing below should show tooltip if (allow_ui_tooltips) @@ -903,7 +914,7 @@ BOOL LLView::handleToolTip(S32 x, S32 y, MASK mask) LLToolTipMgr::instance().show(LLToolTip::Params() .message(tooltip) .sticky_rect(calcScreenRect()) - .delay_time(timeout)); + .delay_time(getTooltipTimeout())); } handled = TRUE; } |