Closed schmurger closed 2 months ago
Thank you
Thanks for merging this PR. I see you've added even more improvements, including text height calculation :) Also, thanks for fixing the bug for the incorrect placement of PopStyleVar.
@schmurger Wanted to let you know I found a hacky way to dynamically set the notification height
https://github.com/otavepto/gbe_fork/blob/21cce304e8eb77d5970d3197b0208cc50f6ff55b/overlay_experimental/steam_overlay.cpp#L837-L870
The trick to get the proper height is using ImGui::CalcTextSize()
and passing the max allowed width as: total notification width - icon size - items spacing (because we draw an icon next to the the text) - window padding * 2 (padding left & right)
This function conveniently works with multi-line strings, and it will now return back the required height.
Another thing related to ImGui in general, all ImGui::Pushxxx
and ImGui::Popxxx
must be balanced, I changed your code to pop the style outside the loop just like its equivalent push 👍
That's a great way to size the notification correctly, including for chats as well. I didn't test that, I only worked with achievements. I'm quite new at graphics programming, it's interesting, lots of calculations so far :)
Add rounded corners to the notification Calculate achievement notification height based on the icon size Change default background notification color to match steam color scheme