MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / drawToolTip

Method drawToolTip

source/ui/controls/baseView.cpp:142–164  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140}
141
142void BaseView::drawToolTip(BString help) {
143 ImGui::AlignTextToFramePadding();
144 if (GlobalSettings::hasIconsFont()) {
145 SAFE_IMGUI_TEXT_DISABLED(QUESTION_ICON);
146 } else {
147 SAFE_IMGUI_TEXT_DISABLED("(?)");
148 }
149 if (ImGui::IsItemHovered())
150 {
151 ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(GlobalSettings::scaleFloatUI(8.0f), GlobalSettings::scaleFloatUI(8.0f)));
152 ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, GlobalSettings::scaleFloatUI(7.0f));
153 ImGui::BeginTooltip();
154 float width = ImGui::GetFontSize() * 35.0f;
155 if (width > ImGui::GetIO().DisplaySize.x - GlobalSettings::scaleFloatUI(10.0f)) {
156 width = ImGui::GetIO().DisplaySize.x - GlobalSettings::scaleFloatUI(10.0f);
157 }
158 ImGui::PushTextWrapPos(width);
159 ImGui::TextUnformatted(help.c_str());
160 ImGui::PopTextWrapPos();
161 ImGui::EndTooltip();
162 ImGui::PopStyleVar(2);
163 }
164}

Callers 1

runAppsMethod · 0.45

Calls 2

ImVec2Class · 0.85
c_strMethod · 0.45

Tested by

no test coverage detected