Skip to content

Commit

Permalink
Configure import modal size and pos
Browse files Browse the repository at this point in the history
  • Loading branch information
dvsku committed Feb 11, 2024
1 parent ef1b3a4 commit 34fc22d
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/devue_app/src/gui/modals/dv_modal_import.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,17 @@ bool dv_modal_import::render() {

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

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

if (ImGui::BeginPopupModal("Import##Popup", NULL, ImGuiWindowFlags_AlwaysAutoResize)) {
ImVec2 size = {
0.0f,
ImMin(185.0f, ImGui::GetMainViewport()->Size.y * 0.85f)
};

ImGui::SetNextWindowPos(pos, ImGuiCond_Always, ImVec2(0.5f, 0.5f));
ImGui::SetNextWindowSize(size, ImGuiCond_Always);

if (ImGui::BeginPopupModal("Import##Popup", NULL, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_HorizontalScrollbar)) {
ImGui::PushID("ImportModal");

ImGui::Text("File");
Expand Down

0 comments on commit 34fc22d

Please sign in to comment.