summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-02-01 00:35:22 +0200
committerakleshchev <117672381+akleshchev@users.noreply.github.com>2023-02-01 16:38:47 +0200
commit6ada89ce0b9372d6a7f49ac45bad6713ad5d3355 (patch)
tree7e9f024aa51b30a03b7b6490f13c5259b9e4f8bc /indra/llui
parentaa6c7902af2ab2cc10bc86000a91078edafb522f (diff)
SL-19117 Extend texture preview to show thumbnails when present
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llview.cpp20
-rw-r--r--indra/llui/llview.h1
2 files changed, 13 insertions, 8 deletions
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index 9ba71913d0..10e4755cd3 100644
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -877,6 +877,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;
@@ -886,14 +897,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)
@@ -901,7 +905,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;
}
diff --git a/indra/llui/llview.h b/indra/llui/llview.h
index bec45df78a..444a4c3cb5 100644
--- a/indra/llui/llview.h
+++ b/indra/llui/llview.h
@@ -243,6 +243,7 @@ public:
ECursorType getHoverCursor() { return mHoverCursor; }
+ static F32 getTooltipTimeout();
virtual const std::string getToolTip() const { return mToolTipMsg.getString(); }
void sendChildToFront(LLView* child);