Skip to content

Commit

Permalink
For compatibility with imgui 1.90.6
Browse files Browse the repository at this point in the history
  • Loading branch information
jiapei100 committed May 9, 2024
1 parent 95d431c commit 6983f52
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cpp/open3d/visualization/gui/ListView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ Widget::DrawResult ListView::Draw(const DrawContext &context) {
auto new_selected_idx = impl_->selected_index_;
bool is_double_click = false;
DrawImGuiPushEnabledState();
if (ImGui::ListBoxHeader(impl_->imgui_id_.c_str(),
int(impl_->items_.size()), height_in_items)) {
if (ImGui::BeginListBox(impl_->imgui_id_.c_str(),
ImVec2(impl_->items_.size(), height_in_items))) {
for (size_t i = 0; i < impl_->items_.size(); ++i) {
bool is_selected = (int(i) == impl_->selected_index_);
// ImGUI's list wants to hover over items, which is not done by
Expand Down Expand Up @@ -155,7 +155,7 @@ Widget::DrawResult ListView::Draw(const DrawContext &context) {
}
ImGui::PopStyleColor();
}
ImGui::ListBoxFooter();
ImGui::EndListBox();

if (new_selected_idx != impl_->selected_index_ || is_double_click) {
impl_->selected_index_ = new_selected_idx;
Expand Down

0 comments on commit 6983f52

Please sign in to comment.