Skip to content

Commit 76c895b

Browse files
committed
Suppress tooltip generation in filter browser when dragging as workaround for ocornut/imgui#7922
1 parent addaa1c commit 76c895b

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

src/ngscopeclient/CreateFilterBrowser.cpp

+11-7
Original file line numberDiff line numberDiff line change
@@ -157,16 +157,20 @@ bool CreateFilterBrowser::DoRender()
157157
ImGui::InvisibleButton(it.first.c_str(), buttonsize);
158158

159159
//Tooltip for the button
160-
if(ImGui::BeginItemTooltip())
160+
//Don't do a tooltip if the mouse is down (workaround for https://github.com/ocornut/imgui/issues/7922)
161+
if(!ImGui::IsMouseDown(ImGuiMouseButton_Left))
161162
{
162-
string tip = it.first + "\n";
163-
tip += "\n";
164-
//TODO: filter-specific help text
163+
if(ImGui::BeginItemTooltip())
164+
{
165+
string tip = it.first + "\n";
166+
tip += "\n";
167+
//TODO: filter-specific help text
165168

166-
tip += "Drag to filter graph to instantiate this block";
169+
tip += "Drag to filter graph to instantiate this block";
167170

168-
ImGui::TextUnformatted(tip.c_str());
169-
ImGui::EndTooltip();
171+
ImGui::TextUnformatted(tip.c_str());
172+
ImGui::EndTooltip();
173+
}
170174
}
171175

172176
//Make it draggable

0 commit comments

Comments
 (0)