From 70e50a7531a2541e6d992bd183d36e61879276d6 Mon Sep 17 00:00:00 2001 From: Zachary Hall Date: Sun, 16 Jul 2023 13:00:04 -0700 Subject: [PATCH] Disable viewports and change min size. --- main.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/main.cpp b/main.cpp index 307eaf2..d6deb2e 100644 --- a/main.cpp +++ b/main.cpp @@ -126,7 +126,7 @@ int main(int, char**) SDL_SetWindowIcon(window, icon); SDL_GLContext gl_context = SDL_GL_CreateContext(window); SDL_GL_MakeCurrent(window, gl_context); - + // Setup Dear ImGui context IMGUI_CHECKVERSION(); ImGui::CreateContext(); @@ -134,7 +134,7 @@ int main(int, char**) io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; // Enable Keyboard Controls io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad; // Enable Gamepad Controls io.ConfigFlags |= ImGuiConfigFlags_DockingEnable; - io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable; + //io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable; io.IniFilename = strdup((std::string(prefPath) + "imgui.ini").c_str()); if (enable_kms) { io.MouseDrawCursor = true; @@ -185,6 +185,11 @@ int main(int, char**) #endif ); fileDialog.SetPwd(path(userdir) / path("Music")); + int window_width = 475; + int window_height = 354; + SDL_SetWindowMinimumSize(window, window_width, window_height); + fileDialog.SetWindowSize(window_width, window_height); + //fileDialog.SetWindowPos(0, 0); Playback *playback = new Playback(); float position = 0.0; // Main loop @@ -241,7 +246,7 @@ int main(int, char**) #else while (!done) #endif - { + {/* { int min_x; int min_y; @@ -251,7 +256,7 @@ int main(int, char**) min_y = height; SDL_SetWindowMinimumSize(window, 475, min_y); } - } + }*/ position = playback->GetPosition(); // Poll and handle events (inputs, window resize, etc.) // You can read the io.WantCaptureMouse, io.WantCaptureKeyboard flags to tell if dear imgui wants to use your inputs.