mirror of
https://github.com/obsqrbtz/clrsync.git
synced 2026-04-09 12:37:41 +03:00
chore :refactored remaining views
This commit is contained in:
@@ -2,6 +2,9 @@
|
||||
#define CLRSYNC_GUI_SETTINGS_WINDOW_HPP
|
||||
|
||||
#include "core/palette/palette.hpp"
|
||||
#include "gui/widgets/error_message.hpp"
|
||||
#include "gui/widgets/form_field.hpp"
|
||||
#include "gui/widgets/settings_buttons.hpp"
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
@@ -15,52 +18,37 @@ class settings_window
|
||||
public:
|
||||
settings_window(clrsync::gui::ui_manager* ui_mgr);
|
||||
void render();
|
||||
void show()
|
||||
{
|
||||
m_visible = true;
|
||||
}
|
||||
void hide()
|
||||
{
|
||||
m_visible = false;
|
||||
}
|
||||
bool is_visible() const
|
||||
{
|
||||
return m_visible;
|
||||
}
|
||||
void show() { m_visible = true; }
|
||||
void hide() { m_visible = false; }
|
||||
bool is_visible() const { return m_visible; }
|
||||
|
||||
void set_palette(const clrsync::core::palette& palette) { m_current_palette = palette; }
|
||||
|
||||
private:
|
||||
void load_settings();
|
||||
void save_settings();
|
||||
void apply_settings();
|
||||
void render_general_tab();
|
||||
void render_appearance_tab();
|
||||
void render_status_messages();
|
||||
void render_action_buttons();
|
||||
void show_help_marker(const char *desc);
|
||||
void reset_to_defaults();
|
||||
|
||||
public:
|
||||
void set_palette(const clrsync::core::palette &palette)
|
||||
{
|
||||
m_current_palette = palette;
|
||||
}
|
||||
void setup_widgets();
|
||||
|
||||
bool m_visible{false};
|
||||
bool m_settings_changed{false};
|
||||
|
||||
char m_default_theme[128];
|
||||
char m_palettes_path[512];
|
||||
char m_font[128];
|
||||
int m_font_size;
|
||||
std::string m_default_theme;
|
||||
std::string m_palettes_path;
|
||||
std::string m_font;
|
||||
int m_font_size{14};
|
||||
int m_selected_font_idx{0};
|
||||
|
||||
std::vector<std::string> m_available_fonts;
|
||||
int m_selected_font_idx;
|
||||
|
||||
std::string m_error_message;
|
||||
bool m_settings_changed;
|
||||
int m_current_tab;
|
||||
|
||||
clrsync::core::palette m_current_palette;
|
||||
clrsync::gui::ui_manager* m_ui_manager;
|
||||
|
||||
clrsync::gui::widgets::form_field m_form;
|
||||
clrsync::gui::widgets::error_message m_error;
|
||||
clrsync::gui::widgets::settings_buttons m_buttons;
|
||||
};
|
||||
|
||||
#endif // CLRSYNC_GUI_SETTINGS_WINDOW_HPP
|
||||
Reference in New Issue
Block a user