Skip to content

Commit 34fc22d

Browse files
committed
Configure import modal size and pos
1 parent ef1b3a4 commit 34fc22d

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/devue_app/src/gui/modals/dv_modal_import.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,17 @@ bool dv_modal_import::render() {
2828

2929
ImGui::OpenPopup("Import##Popup");
3030

31-
// Always center this window when appearing
32-
ImVec2 center = ImGui::GetMainViewport()->GetCenter();
33-
ImGui::SetNextWindowPos(center, ImGuiCond_Appearing, ImVec2(0.5f, 0.5f));
31+
ImVec2 pos = ImGui::GetMainViewport()->GetCenter();
3432

35-
if (ImGui::BeginPopupModal("Import##Popup", NULL, ImGuiWindowFlags_AlwaysAutoResize)) {
33+
ImVec2 size = {
34+
0.0f,
35+
ImMin(185.0f, ImGui::GetMainViewport()->Size.y * 0.85f)
36+
};
37+
38+
ImGui::SetNextWindowPos(pos, ImGuiCond_Always, ImVec2(0.5f, 0.5f));
39+
ImGui::SetNextWindowSize(size, ImGuiCond_Always);
40+
41+
if (ImGui::BeginPopupModal("Import##Popup", NULL, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_HorizontalScrollbar)) {
3642
ImGui::PushID("ImportModal");
3743

3844
ImGui::Text("File");

0 commit comments

Comments
 (0)