mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 23:20:05 +00:00
Wrap hover text, default to 80 characters
This commit is contained in:
parent
24c919afb6
commit
23732cef48
7 changed files with 21 additions and 2 deletions
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
#include <mutex>
|
||||
|
||||
#include <TextFlow.hpp>
|
||||
#include <imgui.h>
|
||||
|
||||
namespace scwx
|
||||
|
|
@ -85,11 +86,16 @@ void ImGui::Impl::UpdateMonospaceFont()
|
|||
|
||||
void ImGui::DrawTooltip(const std::string& hoverText)
|
||||
{
|
||||
static constexpr std::size_t kDefaultWidth = 80u;
|
||||
|
||||
p->Initialize();
|
||||
|
||||
auto wrappedText =
|
||||
TextFlow::Column(hoverText).width(kDefaultWidth).toString();
|
||||
|
||||
::ImGui::BeginTooltip();
|
||||
::ImGui::PushFont(p->monospaceFont_);
|
||||
::ImGui::TextUnformatted(hoverText.c_str());
|
||||
::ImGui::TextUnformatted(wrappedText.c_str());
|
||||
::ImGui::PopFont();
|
||||
::ImGui::EndTooltip();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue