Commit 05570bb8 authored by Nada Bouknana's avatar Nada Bouknana

move global scope settings to a menu item

parent 530812ff
...@@ -733,6 +733,7 @@ void *imscope_thread(void *data_void_ptr) ...@@ -733,6 +733,7 @@ void *imscope_thread(void *data_void_ptr)
static float t = 0; static float t = 0;
static bool show_imgui_demo_window = false; static bool show_imgui_demo_window = false;
static bool show_implot_demo_window = false; static bool show_implot_demo_window = false;
static bool show_scope_settings_window = false;
ImGui::DockSpaceOverViewport(); ImGui::DockSpaceOverViewport();
if (ImGui::BeginMainMenuBar()) { if (ImGui::BeginMainMenuBar()) {
if (ImGui::BeginMenu("File")) { if (ImGui::BeginMenu("File")) {
...@@ -752,6 +753,12 @@ void *imscope_thread(void *data_void_ptr) ...@@ -752,6 +753,12 @@ void *imscope_thread(void *data_void_ptr)
} }
ImGui::EndMenu(); ImGui::EndMenu();
} }
if (ImGui::BeginMenu("Settings")) {
if (ImGui::MenuItem("Global scope settings")) {
show_scope_settings_window = !show_scope_settings_window;
}
ImGui::EndMenu();
}
ImGui::EndMainMenuBar(); ImGui::EndMainMenuBar();
} }
...@@ -762,16 +769,6 @@ void *imscope_thread(void *data_void_ptr) ...@@ -762,16 +769,6 @@ void *imscope_thread(void *data_void_ptr)
} }
ImGui::End(); ImGui::End();
ImGui::Begin("Global scope settings");
ImGui::ShowStyleSelector("ImGui Style");
ImPlot::ShowStyleSelector("ImPlot Style");
ImPlot::ShowColormapSelector("ImPlot Colormap");
ImGui::SliderInt("FPS target", &target_fps, 12, 60);
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Reduces scope flickering in unfrozen mode. Can reduce impact on perfromance of the modem");
}
ImGui::End();
t += ImGui::GetIO().DeltaTime; t += ImGui::GetIO().DeltaTime;
iq_procedure_timer.UpdateAverage(t); iq_procedure_timer.UpdateAverage(t);
...@@ -788,7 +785,19 @@ void *imscope_thread(void *data_void_ptr) ...@@ -788,7 +785,19 @@ void *imscope_thread(void *data_void_ptr)
ImPlot::ShowDemoWindow(); ImPlot::ShowDemoWindow();
if (show_imgui_demo_window) if (show_imgui_demo_window)
ImGui::ShowDemoWindow(); ImGui::ShowDemoWindow();
// Settings
if (show_scope_settings_window) {
ImGui::SetNextWindowPos(ImGui::GetMainViewport()->GetCenter(), ImGuiCond_FirstUseEver, ImVec2(0.5f, 0.5f));
ImGui::Begin("Global scope settings", &show_scope_settings_window);
ImGui::ShowStyleSelector("ImGui Style");
ImPlot::ShowStyleSelector("ImPlot Style");
ImPlot::ShowColormapSelector("ImPlot Colormap");
ImGui::SliderInt("FPS target", &target_fps, 12, 60);
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Reduces scope flickering in unfrozen mode. Can reduce impact on perfromance of the modem");
}
ImGui::End();
}
// Rendering // Rendering
ImGui::Render(); ImGui::Render();
glViewport(0, 0, display_w, display_h); glViewport(0, 0, display_w, display_h);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment