Commit 7f03786d authored by Gauthier Quesnel's avatar Gauthier Quesnel
Browse files

gui: use tab to merge editor and source windows

parent 0af000cf
Pipeline #34738 passed with stage
in 1 minute and 25 seconds
...@@ -105,7 +105,7 @@ application::show() ...@@ -105,7 +105,7 @@ application::show()
editor* ed = nullptr; editor* ed = nullptr;
while (editors.next(ed)) { while (editors.next(ed)) {
if (ed->show) { if (ed->show) {
if (!ed->show_editor()) { if (!ed->show_window()) {
editor* next = ed; editor* next = ed;
editors.next(next); editors.next(next);
free_editor(*ed); free_editor(*ed);
......
...@@ -265,9 +265,6 @@ struct editor ...@@ -265,9 +265,6 @@ struct editor
file_discrete_outs; file_discrete_outs;
std::vector<observation_output> observation_outputs; std::vector<observation_output> observation_outputs;
void show_sources_window(bool* is_show);
void show_menu_sources(const char* title, source& src);
template<typename Function, typename... Args> template<typename Function, typename... Args>
constexpr void observation_dispatch(const u32 index, constexpr void observation_dispatch(const u32 index,
Function&& f, Function&& f,
...@@ -328,7 +325,6 @@ struct editor ...@@ -328,7 +325,6 @@ struct editor
bool show_save_file_dialog = false; bool show_save_file_dialog = false;
bool show_select_directory_dialog = false; bool show_select_directory_dialog = false;
bool show_settings = false; bool show_settings = false;
bool show_sources = false;
struct settings_manager struct settings_manager
{ {
...@@ -432,8 +428,11 @@ struct editor ...@@ -432,8 +428,11 @@ struct editor
void show_model_dynamics(model& mdl) noexcept; void show_model_dynamics(model& mdl) noexcept;
void show_model_cluster(cluster& mdl) noexcept; void show_model_cluster(cluster& mdl) noexcept;
void show_top() noexcept; void show_top() noexcept;
void show_sources() noexcept;
void show_editor() noexcept;
void show_menu_sources(const char* title, source& src);
bool show_editor() noexcept; bool show_window() noexcept;
}; };
struct window_logger struct window_logger
......
This diff is collapsed.
...@@ -267,16 +267,8 @@ show_random_distribution_input(random_source& src) noexcept ...@@ -267,16 +267,8 @@ show_random_distribution_input(random_source& src) noexcept
} }
void void
editor::show_sources_window(bool* is_show) editor::show_sources() noexcept
{ {
ImGui::SetNextWindowPos(ImVec2(70, 450), ImGuiCond_FirstUseEver);
ImGui::SetNextWindowSize(ImVec2(400, 300), ImGuiCond_FirstUseEver);
if (!ImGui::Begin("External sources", is_show)) {
ImGui::End();
return;
}
static bool show_file_dialog = false; static bool show_file_dialog = false;
static irt::constant_source* constant_ptr = nullptr; static irt::constant_source* constant_ptr = nullptr;
static irt::binary_file_source* binary_file_ptr = nullptr; static irt::binary_file_source* binary_file_ptr = nullptr;
...@@ -626,8 +618,6 @@ editor::show_sources_window(bool* is_show) ...@@ -626,8 +618,6 @@ editor::show_sources_window(bool* is_show)
} }
} }
} }
ImGui::End();
} }
void void
......
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