Skip to content

Commit a42efd5

Browse files
committed
add X button for cvolton
1 parent 26718d9 commit a42efd5

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/pages/Tree.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,15 @@ void DevTools::drawTree() {
9191
ImGui::Dummy({0.f, 60.f});
9292
#endif
9393
m_prevQuery = m_searchQuery;
94-
ImGui::SetNextItemWidth(-1.f);
94+
95+
auto space = ImGui::GetContentRegionAvail();
96+
auto height = ImGui::GetFrameHeight();
97+
ImGui::SetNextItemWidth(space.x - height);
9598
ImGui::InputTextWithHint("##search", U8STR(FEATHER_SEARCH " Search for a node..."), &m_searchQuery, ImGuiInputTextFlags_EnterReturnsTrue);
99+
ImGui::SameLine(0, 0);
100+
if (ImGui::Button(U8STR(FEATHER_X), ImVec2(height, height))) {
101+
m_searchQuery.clear();
102+
}
96103

97104
this->drawTreeBranch(CCDirector::get()->getRunningScene(), 0);
98105
}

0 commit comments

Comments
 (0)