From 5430efbb31cfc0f57eac7fd130bb43aafa85143a Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Tue, 15 Aug 2023 20:38:02 +0300 Subject: SL-20139 pressing the Tab key should paste tooltip only when hovering functions in LSL editor --- indra/llui/lltooltip.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'indra/llui/lltooltip.cpp') diff --git a/indra/llui/lltooltip.cpp b/indra/llui/lltooltip.cpp index 2f56a8b1d0..c4b132317f 100644 --- a/indra/llui/lltooltip.cpp +++ b/indra/llui/lltooltip.cpp @@ -154,7 +154,8 @@ LLToolTip::Params::Params() text_color("text_color"), time_based_media("time_based_media", false), web_based_media("web_based_media", false), - media_playing("media_playing", false) + media_playing("media_playing", false), + allow_paste_tooltip("allow_paste_tooltip", false) { changeDefault(chrome, true); } @@ -166,7 +167,8 @@ LLToolTip::LLToolTip(const LLToolTip::Params& p) mTextBox(NULL), mInfoButton(NULL), mPlayMediaButton(NULL), - mHomePageButton(NULL) + mHomePageButton(NULL), + mIsTooltipPastable(p.allow_paste_tooltip) { LLTextBox::Params params; params.name = params.initial_value().asString(); @@ -308,6 +310,8 @@ void LLToolTip::initFromParams(const LLToolTip::Params& p) mTextBox->reshape(mTextBox->getRect().getWidth(), llmax(mTextBox->getRect().getHeight(), tooltip_rect.getHeight() - 2 * mPadding)); setShape(tooltip_rect); + + mIsTooltipPastable = p.allow_paste_tooltip; } void LLToolTip::setVisible(BOOL visible) @@ -469,9 +473,9 @@ void LLToolTipMgr::createToolTip(const LLToolTip::Params& params) } -void LLToolTipMgr::show(const std::string& msg) +void LLToolTipMgr::show(const std::string& msg, bool allow_paste_tooltip) { - show(LLToolTip::Params().message(msg)); + show(LLToolTip::Params().message(msg).allow_paste_tooltip(allow_paste_tooltip)); } void LLToolTipMgr::show(const LLToolTip::Params& params) @@ -612,5 +616,13 @@ void LLToolTipMgr::getToolTipMessage(std::string & message) } } +bool LLToolTipMgr::isTooltipPastable() +{ + if (toolTipVisible()) + { + return mToolTip->isTooltipPastable(); + } + return false; + } // EOF -- cgit v1.2.3 From afc08372b10d9c07c90d176dc45f8db8244215c9 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Tue, 31 Oct 2023 23:01:16 +0200 Subject: SL-20537 Add hover-preview for My Outfit list --- indra/llui/lltooltip.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'indra/llui/lltooltip.cpp') diff --git a/indra/llui/lltooltip.cpp b/indra/llui/lltooltip.cpp index a6552d4ff1..328d36c6e1 100644 --- a/indra/llui/lltooltip.cpp +++ b/indra/llui/lltooltip.cpp @@ -440,7 +440,13 @@ void LLToolTipMgr::createToolTip(const LLToolTip::Params& params) tooltip_params.rect = LLRect (0, 1, 1, 0); if (tooltip_params.create_callback.isProvided()) - mToolTip = tooltip_params.create_callback()(tooltip_params); + { + mToolTip = tooltip_params.create_callback()(tooltip_params); + if (mToolTip == NULL) + { + return; + } + } else mToolTip = LLUICtrlFactory::create (tooltip_params); @@ -492,7 +498,7 @@ void LLToolTipMgr::show(const LLToolTip::Params& params) { if (!params.styled_message.isProvided() && (!params.message.isProvided() || params.message().empty()) - && !params.image.isProvided()) return; + && !params.image.isProvided() && !params.create_callback.isProvided()) return; // fill in default tooltip params from tool_tip.xml LLToolTip::Params params_with_defaults(params); -- cgit v1.2.3