Changed the code to use a single helper method addLabelToolTip that takes a tuple and uses more strict validating that the tool tip should be applied. This cleans up the code.
Also added two more checks, one in setPanelTitle and another in setCurrentTabName to try to apply the tool tip if the message on the tab has changed.
Seems to fix the final issues noticed when testing the feature.
Updated 2 checks to use more modern C++ standard.
Changed the tuple->mButton->getName() to just use a != instead of compare method.
Changed the tuple->mPlaceholderText to use nullptr instead of NULL.
The original method receives the mouse x/y coordinate and if it fits within the tab container's rect, it then loops over all the buttons and calculates some local x/y coordinates and calls:
tab_button->handleToolTip
The problem is this method does do any bounds checks on itself and if the tool tip is set to anything but an empty string, it displays it.
So added bounds check before calling it using the x/y coordiantes before the transformation to local and to use the tab_button->rects's pointInRect method.
If wanted to put the check into the LLView::handleToolTip instead, would need to add 2 more parent x/y coordinates to check against the LLView's rect.
Added more checks to make sure the button is not a place holder, is visible, is empty, does not have a place holder text box, and is enabled.
Only then does it check to see if the label is truncated as it's a more math orientated method.
This fixes a bug where the user logs in with good cache, server issues use-cached response, and then the viewer would send another mutelist request on region change.
Signed-off-by: Darl <me@darl.cat>
getLoadFailed -> updateLoadState
- No longer labeled as a plain getter, but instead as a state machine advancement point
- This name reflects its role in advancing the state according to design parameters when called from the idle loop
- Call site in LLIMProcessing::requestOfflineMessages simplified by internalizing our readiness checks
isFailed
- Reintroduced const to match isLoaded for determining state
Signed-off-by: Darl <me@darl.cat>
This yields to the simulator's responsibility as source-of-truth.
e.g. Bob has Alice blocked for a while across all his devices
1. Bob unblocked Alice on his laptop
2. Bob logs in on his desktop with a cached mutelist
3. LLDispatchEmptyMuteList fires
4. LLMuteList becomes eventually-correct, reflecting most recent signaled user intent
Signed-off-by: Darl <me@darl.cat>
Turned out that placeholder text did not need the tool_tip added, so removed as it caused odd looking behaviors.
Also, changed the text check for the pixel size of the label and the total length of the label to use the number of rendered characters to the number of characters in the label. This does not use the render path to work, but works out the math by use of LLGLFont::
in the LLButton::isLabelTruncated, used a incomplete switch statement on an enum which caused an compiling error on GCC 15. Thanks to @EricaNebula for pointing it out and submitting an original patch to complete the case statement.
Changed the switch statement to a if/else if statement instead to be cleaner. I only used the switch statement before as it was what was taken from the LLButton::draw method, but had dropped the missing case due to not needing it for the calculation.
Changed the compre("") == 0 over to empty() method for the tool tip checks.
Was able to make the LLButton::isLabelTruncated method const by including code from the getOverlayImageSize method as the method call was causing the isLabelTruncated method from being declared const.
Currently, when a tab is added to a tab container, if the label on the button is too long to fit, the text is cut off. This change will apply the label to the tool tip if it is not already set.
This change to the LLTabContainer class's addTabPanel and reshapeTuple adds checks for both the button and textbox for place holder text if the they are either truncated, they have a tool tip set to the label as long the tool tip is empty.
reshapeTuple is called when an image is added/removed from the button, which can take up space.
Currently, when a tab is added to a tab container, if the label on the button is too long to fit, the text is cut off. This change will apply the label to the tool tip if it is not already set.
Part of the change needed to know if the button label was truncated. The supplied version with the standard LLButton does not work if the button has not been rendered yet. So added a method to use the same calculations as the draw method for rendering the label.