Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nix build #6854

Merged
merged 10 commits into from
Dec 19, 2024
4 changes: 2 additions & 2 deletions cpp/apps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
9 changes: 3 additions & 6 deletions cpp/open3d/visualization/gui/ListView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down
Loading