From f3640e7ef751e299c4850f69d7464bce0adbea1c Mon Sep 17 00:00:00 2001 From: Beq Date: Mon, 11 May 2026 13:38:51 +0100 Subject: [PATCH] Restore lltabcontainer and llbutton to state before FIRE-36603 Feature needs more work before beta. --- indra/llui/llbutton.cpp | 40 ----------------------------------- indra/llui/llbutton.h | 4 ---- indra/llui/lltabcontainer.cpp | 35 ------------------------------ 3 files changed, 79 deletions(-) diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index f16c92438c..d9af5939bb 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -1209,46 +1209,6 @@ bool LLButton::labelIsTruncated() const return getCurrentLabel().getString().size() > mLastDrawCharsCount; } -// [FIRE-36603] - LLTabContainer - Add button label to the tool tip when too long -// Check if the place holder text exists, and if it too is visually clipped. -// Note: LLTextBase::truncate() tests UTF-8 byte length vs mMaxTextByteLength (storage limit), not visual ellipsing -bool LLButton::isLabelTruncated() const -{ - // let overlay image and text play well together - S32 usable_text_width = getRect().getWidth() - mLeftHPad - mRightHPad; - - // Handle an image overlay taking up the text space. - if (mImageOverlay.notNull() && (mImageOverlayAlignment < LLFontGL::HCENTER)) - { - // get max width and height (discard level 0) - S32 overlay_width = mImageOverlay->getWidth(); - - F32 scale_factor = - llmin((F32)getRect().getWidth() / (F32)overlay_width, (F32)getRect().getHeight() / (F32)mImageOverlay->getHeight(), 1.f); - overlay_width = ll_round((F32)overlay_width * scale_factor); - - usable_text_width -= (overlay_width + mImgOverlayLabelSpace); - } - - // Handle the text starting position on the button - if (!getCurrentLabel().empty()) // Unselected label assignments - { - LL_DEBUGS() << "Tab Button: " << getCurrentLabel().getString() << " SL" - << mGLFont->maxDrawableChars(getCurrentLabel().getWString().c_str(), static_cast(usable_text_width)) << " UTW " - << getCurrentLabel().length() << LL_ENDL; - // Find the max number of drawable characters for the string, with the usable text width, compared to the - // total number of characters in the label text. - if (mGLFont->maxDrawableChars(getCurrentLabel().getWString().c_str(), static_cast(usable_text_width)) < - getCurrentLabel().length()) - { - return true; - } - } - - return false; -} -// [FIRE-36603] - const LLUIString& LLButton::getCurrentLabel() const { return getToggleState() ? mSelectedLabel : mUnselectedLabel; diff --git a/indra/llui/llbutton.h b/indra/llui/llbutton.h index 398bed1a3a..c2b8d4e078 100644 --- a/indra/llui/llbutton.h +++ b/indra/llui/llbutton.h @@ -272,10 +272,6 @@ public: S32 getLastDrawCharsCount() const { return mLastDrawCharsCount; } bool labelIsTruncated() const; - // [FIRE-36603] - LLTabContainer - Add button label to the tool tip when too long - // The above function only works after rendering, and does not work when not first loading the button. - bool isLabelTruncated() const; - // [FIRE-36603] const LLUIString& getCurrentLabel() const; void setScaleImage(bool scale) { mScaleImage = scale; } diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index 8fc8f46238..1810915e2f 100644 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -842,7 +842,6 @@ bool LLTabContainer::handleToolTip( S32 x, S32 y, MASK mask) if (!tab_button->getVisible()) continue; S32 local_x = x - tab_button->getRect().mLeft; S32 local_y = y - tab_button->getRect().mBottom; - if (tab_button->getRect().pointInRect(x, y)) // [FIRE-36603] - The handleToolTip will display a tool tip always if not empty and does not do a bounds check. handled = tab_button->handleToolTip(local_x, local_y, mask); if( handled ) { @@ -1352,23 +1351,6 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel) mScrollPos = mMaxScrollPos; } - // [FIRE-36603] - LLTabContainer - Add button label to the tool tip when too long - // If the text of the button is truncated, we want to set the tool tip of the UI element - // to the label of the button/textbox. - if (tuple && !getTabsHidden() && - tuple->mButton->getToolTip().empty() && - tuple->mButton->getName() != "placeholder" && - tuple->mPlaceholderText == nullptr && - tuple->mButton->getVisible() && - tuple->mButton->getEnabled()) // Only if it is a valid button to apply the tool tip to. - { - // If the button label is truncated, then we want to try to use the tool tip. - if (tuple->mButton->isLabelTruncated()) - { - tuple->mButton->setToolTip(tuple->mButton->getLabelSelected()); - } - } - // [FIRE-36603] } void LLTabContainer::addPlaceholder(LLPanel* child, const std::string& label) @@ -1931,23 +1913,6 @@ void LLTabContainer::reshapeTuple(LLTabTuple* tuple) // tabs have changed size, might need to scroll to see current tab updateMaxScrollPos(); } - // [FIRE-36603] - LLTabContainer - Add button label to the tool tip when too long - // If the text of the button is truncated, we want to set the tool tip of the UI element - // to the label of the button/textbox. - if (tuple && !getTabsHidden() && - tuple->mButton->getToolTip().empty() && - tuple->mButton->getName() != "placeholder" && - tuple->mPlaceholderText == nullptr && - tuple->mButton->getVisible() && - tuple->mButton->getEnabled()) // Only if it is a valid button to apply the tool tip to. - { - // If the button label is truncated, then we want to try to use the tool tip. - if (tuple->mButton->isLabelTruncated()) - { - tuple->mButton->setToolTip(tuple->mButton->getLabelSelected()); - } - } - // [FIRE-36603] } void LLTabContainer::setTitle(const std::string& title)