chore: structured src/gui, run clang-format

This commit is contained in:
2025-12-18 13:23:50 +03:00
parent 613c2c80f5
commit 7641846600
55 changed files with 1647 additions and 1399 deletions

View File

@@ -0,0 +1,67 @@
#ifndef CLRSYNC_GUI_TEMPLATE_EDITOR_HPP
#define CLRSYNC_GUI_TEMPLATE_EDITOR_HPP
#include "color_text_edit/TextEditor.h"
#include "gui/controllers/template_controller.hpp"
#include "imgui.h"
#include <core/palette/palette.hpp>
#include <string>
#include <vector>
class template_editor
{
public:
template_editor();
void render();
void apply_current_palette(const clrsync::core::palette &pal);
private:
void render_controls();
void render_editor();
void render_template_list();
void render_autocomplete(const ImVec2 &editor_pos);
void update_autocomplete_suggestions();
void save_template();
void load_template(const std::string &name);
void new_template();
void delete_template();
void refresh_templates();
bool is_valid_path(const std::string &path);
template_controller m_template_controller;
TextEditor m_editor;
std::string m_template_name;
std::string m_input_path;
std::string m_output_path;
std::string m_reload_command;
std::string m_validation_error;
std::string m_saved_content;
bool m_has_unsaved_changes = false;
bool m_enabled{true};
bool m_is_editing_existing{false};
bool m_show_delete_confirmation{false};
bool m_show_autocomplete{false};
bool m_autocomplete_dismissed{false};
TextEditor::Coordinates m_dismiss_position;
int m_dismiss_brace_pos{-1};
std::vector<std::string> m_autocomplete_suggestions;
int m_autocomplete_selected{0};
std::string m_autocomplete_prefix;
TextEditor::Coordinates m_autocomplete_start_pos;
ImVec4 m_autocomplete_bg_color;
ImVec4 m_autocomplete_border_color;
ImVec4 m_autocomplete_selected_color;
ImVec4 m_autocomplete_text_color;
ImVec4 m_autocomplete_selected_text_color;
ImVec4 m_autocomplete_dim_text_color;
clrsync::core::palette m_current_palette;
};
#endif // CLRSYNC_GUI_TEMPLATE_EDITOR_HPP