Update text in shown tooltip#1603
Conversation
8c54a99 to
95d05ec
Compare
Flamefire
left a comment
There was a problem hiding this comment.
Triggered by the "mutable" I feel this is the wrong approach: WindowManager already knows the currently shown tooltip (used for hiding it)
So how about adding a "UpdateTooltip" method to WindowManager that works similarly to WindowManager::SetToolTip in checking if the currently shown tooltip is "THIS"? Or even better: Add an extra param to WindowManager::SetToolTip: bool updateCurrent = false to combine that into a single function. Maybe even use updateCurrent = updateCurrent || tooltip.empty() and do the check at
s25client/libs/s25main/WindowManager.cpp
Line 839 in bdf4110
updateCurrent (now) is set.)
Great. I was unaware of this.
I think
|
Add a parameter (bool updateCurrent) to the WindowManager::SetToolTip() function, to update the text of the currently displayed tooltip.
When a tooltip's text is changed, ask the WindowManager to update the currently shown tooltip. The call is only effective if the tooltip is actually being shown.
95d05ec to
25b3e78
Compare
Can you elaborate? Anyway your solution works too 👍 |
Oh, right, because you would have just taken the branch re-creating the tooltip. Of course, the |
|
FYI, I have just confirmed that this does in fact work by testing these commits against #1604. |
When a tooltip is currently being shown and its text is changed, update the displayed text.