diff --git a/cpp/apps/CMakeLists.txt b/cpp/apps/CMakeLists.txt index 9a3cdea35bb..1d12f58cc24 100644 --- a/cpp/apps/CMakeLists.txt +++ b/cpp/apps/CMakeLists.txt @@ -55,9 +55,9 @@ macro(open3d_add_app_gui SRC_DIR APP_NAME TARGET_NAME) DESTINATION "${CMAKE_INSTALL_PREFIX}/bin" USE_SOURCE_PERMISSIONS) if (CMAKE_INSTALL_PREFIX MATCHES "^(/usr/local|/opt)") - set(DESKTOP_INSTALL_DIR "/usr/share") + set(DESKTOP_INSTALL_DIR "/usr/share" CACHE PATH "The install directory for the desktop apps") else() - set(DESKTOP_INSTALL_DIR "$ENV{HOME}/.local/share") + set(DESKTOP_INSTALL_DIR "$ENV{HOME}/.local/share" CACHE PATH "The install directory for the desktop apps") endif() configure_file("${SOURCE_DIR}/${TARGET_NAME}.desktop.in" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${APP_NAME}.desktop") diff --git a/cpp/open3d/visualization/gui/ListView.cpp b/cpp/open3d/visualization/gui/ListView.cpp index 184234dd974..3234f5187f6 100644 --- a/cpp/open3d/visualization/gui/ListView.cpp +++ b/cpp/open3d/visualization/gui/ListView.cpp @@ -116,15 +116,12 @@ Widget::DrawResult ListView::Draw(const DrawContext &context) { ImGui::PushStyleColor(ImGuiCol_HeaderActive, // click-hold color colorToImgui(context.theme.list_selected_color)); - int height_in_items = - int(std::floor(frame.height / ImGui::GetFrameHeight())); - auto result = Widget::DrawResult::NONE; 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)) { + ImVec2 initial_size(0, frame.height); + if (ImGui::BeginListBox(impl_->imgui_id_.c_str(), initial_size)) { 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 @@ -155,7 +152,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;