Compare commits
1 Commits
3bba095cdd
...
9d12e53259
Author | SHA1 | Date | |
---|---|---|---|
9d12e53259 |
@ -52,9 +52,6 @@ add_executable(tomato
|
||||
./send_image_popup.hpp
|
||||
./send_image_popup.cpp
|
||||
|
||||
./settings_window.hpp
|
||||
./settings_window.cpp
|
||||
|
||||
./chat_gui4.hpp
|
||||
./chat_gui4.cpp
|
||||
)
|
||||
|
@ -18,8 +18,7 @@ MainScreen::MainScreen(SDL_Renderer* renderer_, std::string save_path, std::stri
|
||||
mmil(rmm),
|
||||
tam(rmm, cr, conf),
|
||||
sdlrtu(renderer_),
|
||||
cg(conf, rmm, cr, sdlrtu),
|
||||
sw(conf)
|
||||
cg(conf, rmm, cr, sdlrtu)
|
||||
{
|
||||
tel.subscribeAll(tc);
|
||||
|
||||
@ -88,29 +87,11 @@ Screen* MainScreen::poll(bool& quit) {
|
||||
|
||||
tam.iterate();
|
||||
|
||||
// HACK: render the tomato main window first, with proper flags set.
|
||||
// flags need to be set the first time begin() is called.
|
||||
// and plugins are run before the main cg is run.
|
||||
{
|
||||
// TODO: maybe render cg earlier? or move the main window out of cg?
|
||||
constexpr auto bg_window_flags =
|
||||
ImGuiWindowFlags_NoDecoration |
|
||||
ImGuiWindowFlags_NoMove |
|
||||
ImGuiWindowFlags_NoResize |
|
||||
ImGuiWindowFlags_NoSavedSettings |
|
||||
ImGuiWindowFlags_MenuBar |
|
||||
ImGuiWindowFlags_NoBringToFrontOnFocus;
|
||||
|
||||
ImGui::Begin("tomato", nullptr, bg_window_flags);
|
||||
ImGui::End();
|
||||
}
|
||||
|
||||
pm.tick(time_delta);
|
||||
|
||||
mts.iterate();
|
||||
|
||||
cg.render();
|
||||
sw.render();
|
||||
|
||||
if constexpr (false) {
|
||||
ImGui::ShowDemoWindow();
|
||||
|
@ -21,7 +21,6 @@
|
||||
|
||||
#include "./sdlrenderer_texture_uploader.hpp"
|
||||
#include "./chat_gui4.hpp"
|
||||
#include "./settings_window.hpp"
|
||||
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
@ -58,7 +57,6 @@ struct MainScreen final : public Screen {
|
||||
//OpenGLTextureUploader ogltu;
|
||||
|
||||
ChatGui4 cg;
|
||||
SettingsWindow sw;
|
||||
|
||||
MainScreen(SDL_Renderer* renderer_, std::string save_path, std::string save_password, std::vector<std::string> plugins);
|
||||
~MainScreen(void);
|
||||
|
@ -1,35 +0,0 @@
|
||||
#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();
|
||||
}
|
||||
}
|
||||
|
@ -1,14 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
struct ConfigModelI;
|
||||
|
||||
class SettingsWindow {
|
||||
bool _show_window {false};
|
||||
ConfigModelI& _conf;
|
||||
|
||||
public:
|
||||
SettingsWindow(ConfigModelI& conf);
|
||||
|
||||
void render(void);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user