make main window injectable + start settings window

This commit is contained in:
2023-10-19 17:21:45 +02:00
parent 2a5937652e
commit bc090bdaa8
5 changed files with 74 additions and 1 deletions

35
src/settings_window.cpp Normal file
View File

@ -0,0 +1,35 @@
#include "./settings_window.hpp"
#include <imgui/imgui.h>
#include <imgui/misc/cpp/imgui_stdlib.h>
SettingsWindow::SettingsWindow(ConfigModelI& conf) : _conf(conf) {
}
void SettingsWindow::render(void) {
{ // main window menubar injection
// assumes the window "tomato" was rendered already by cg
if (ImGui::Begin("tomato")) {
if (ImGui::BeginMenuBar()) {
ImGui::Separator();
if (ImGui::BeginMenu("Settings")) {
if (ImGui::MenuItem("show settings window")) {
_show_window = true;
}
ImGui::EndMenu();
}
ImGui::EndMenuBar();
}
}
ImGui::End();
}
if (_show_window) {
if (ImGui::Begin("Settings", &_show_window)) {
ImGui::Text("Settings here sldjflsadfs");
}
ImGui::End();
}
}