Skip to content

Commit b955b38

Browse files
committed
fixing CI
1 parent 64bc530 commit b955b38

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

CMakeLists.txt

+3-2
Original file line numberDiff line numberDiff line change
@@ -340,15 +340,16 @@ hello_imgui_add_app(
340340
)
341341

342342
set_target_properties(SamplinSafari PROPERTIES OUTPUT_NAME ${output_name} CXX_STANDARD 17)
343+
target_link_libraries(SamplinSafari PRIVATE samplerlib linalg fmt::fmt)
343344
if(EMSCRIPTEN)
344-
target_link_libraries(SamplinSafari PRIVATE samplerlib linalg fmt::fmt emscripten-browser-file)
345+
target_link_libraries(SamplinSafari PRIVATE emscripten-browser-file)
345346
target_link_options(
346347
SamplinSafari PRIVATE -sEXPORTED_RUNTIME_METHODS=[ccall] -sEXPORTED_FUNCTIONS=[_main,_malloc,_free]
347348
-sNO_DISABLE_EXCEPTION_CATCHING
348349
)
349350
hello_imgui_set_emscripten_target_initial_memory_megabytes(SamplinSafari 120)
350351
else()
351-
target_link_libraries(SamplinSafari PRIVATE samplerlib linalg fmt::fmt-header-only portable-file-dialogs)
352+
target_link_libraries(SamplinSafari PRIVATE portable-file-dialogs)
352353
endif()
353354

354355
if(UNIX AND NOT ${U_CMAKE_BUILD_TYPE} MATCHES DEBUG)

src/app.cpp

+10-9
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ using std::to_string;
5757

5858
static int g_dismissed_version = 0;
5959

60-
static bool g_show_modal = false;
60+
static bool g_open_help = false;
6161

6262
static const vector<pair<string, string>> g_help_strings = {
63-
{"h", "Show this help window"},
63+
{"h", "Toggle this help window"},
6464
{"Left click+drag", "Rotate the camera"},
6565
{"Scroll mouse/pinch", "Zoom the camera"},
6666
{"1", "Switch to XY orthographic view"},
@@ -268,7 +268,7 @@ SampleViewer::SampleViewer()
268268
if (posX > ImGui::GetCursorPosX())
269269
ImGui::SetCursorPosX(posX);
270270
if (ImGui::MenuItem(text))
271-
g_show_modal = true;
271+
g_open_help = true;
272272
};
273273

274274
m_params.callbacks.ShowAppMenuItems = [this]()
@@ -405,7 +405,7 @@ SampleViewer::SampleViewer()
405405
auto s = HelloImGui::LoadUserPref("AboutDismissedVersion");
406406
g_dismissed_version = strtol(s.c_str(), nullptr, 10);
407407
if (g_dismissed_version < version_combined())
408-
g_show_modal = true;
408+
g_open_help = true;
409409
};
410410

411411
m_params.callbacks.BeforeExit = []
@@ -514,7 +514,7 @@ void SampleViewer::draw_gui()
514514

515515
void SampleViewer::draw_about_dialog()
516516
{
517-
if (g_show_modal)
517+
if (g_open_help)
518518
ImGui::OpenPopup("About");
519519

520520
// Always center this window when appearing
@@ -524,7 +524,8 @@ void SampleViewer::draw_about_dialog()
524524
const float2 col_width = {11 * HelloImGui::EmSize(), 32 * HelloImGui::EmSize()};
525525
ImGui::SetNextWindowContentSize(float2{col_width[0] + col_width[1], 0});
526526

527-
if (ImGui::BeginPopupModal("About", nullptr,
527+
bool about_open = true;
528+
if (ImGui::BeginPopupModal("About", &about_open,
528529
ImGuiWindowFlags_HorizontalScrollbar | ImGuiWindowFlags_NoSavedSettings |
529530
ImGuiWindowFlags_AlwaysAutoResize))
530531
{
@@ -697,15 +698,15 @@ void SampleViewer::draw_about_dialog()
697698
// ImGui::SetKeyboardFocusHere();
698699
if (ImGui::Button("Dismiss", ImVec2(120, 0)) || ImGui::IsKeyPressed(ImGuiKey_Escape) ||
699700
ImGui::IsKeyPressed(ImGuiKey_Enter) || ImGui::IsKeyPressed(ImGuiKey_Space) ||
700-
(!g_show_modal && ImGui::IsKeyPressed(ImGuiKey_H)))
701+
(!g_open_help && ImGui::IsKeyPressed(ImGuiKey_H)))
701702
{
702703
ImGui::CloseCurrentPopup();
703704
g_dismissed_version = version_combined();
704705
}
705706
ImGui::SetItemDefaultFocus();
706707

707708
ImGui::EndPopup();
708-
g_show_modal = false;
709+
g_open_help = false;
709710
}
710711
}
711712

@@ -1174,7 +1175,7 @@ void SampleViewer::process_hotkeys()
11741175
else if (ImGui::IsKeyPressed(ImGuiKey_B))
11751176
m_show_bbox = !m_show_bbox;
11761177
else if (ImGui::IsKeyPressed(ImGuiKey_H))
1177-
g_show_modal = !g_show_modal;
1178+
g_open_help = !g_open_help;
11781179
}
11791180

11801181
void SampleViewer::update_points(bool regenerate)

0 commit comments

Comments
 (0)