diff --git a/src/core/common/version.hpp b/src/core/common/version.hpp index 65f69ed..d8ee13c 100644 --- a/src/core/common/version.hpp +++ b/src/core/common/version.hpp @@ -6,7 +6,7 @@ namespace clrsync::core { -const std::string GIT_SEMVER = "0.1.7+git.g4ada2c4"; +const std::string GIT_SEMVER = "0.1.7+git.g8112096"; const std::string version_string(); } // namespace clrsync::core diff --git a/src/core/config/config.cpp b/src/core/config/config.cpp index 8be5015..77a8fde 100644 --- a/src/core/config/config.cpp +++ b/src/core/config/config.cpp @@ -198,7 +198,7 @@ Result config::save_config_value(const std::string §ion, const std::st if (!m_temp_file) { m_temp_file = std::make_unique(m_temp_config_path); - m_temp_file->parse(); + (void)m_temp_file->parse(); } m_temp_file->set_value(section, key, value); @@ -347,7 +347,7 @@ Result config::remove_template(const std::string &key) if (!m_temp_file) { m_temp_file = std::make_unique(m_temp_config_path); - m_temp_file->parse(); + (void)m_temp_file->parse(); } m_temp_file->remove_section("templates." + key); return m_temp_file->save_file(); diff --git a/src/gui/layout/main_layout.cpp b/src/gui/layout/main_layout.cpp index b0536e1..a8cdd6a 100644 --- a/src/gui/layout/main_layout.cpp +++ b/src/gui/layout/main_layout.cpp @@ -27,6 +27,7 @@ void main_layout::render_menu_bar() ImGui::Begin("##TopBar", nullptr, flags); ImGuiStyle &style = ImGui::GetStyle(); + style.FrameBorderSize = 1.0f; const char *settings_label = "Settings"; const char *about_label = "About"; diff --git a/src/gui/views/about_window.cpp b/src/gui/views/about_window.cpp index 5fbcd4b..feb5c3d 100644 --- a/src/gui/views/about_window.cpp +++ b/src/gui/views/about_window.cpp @@ -35,8 +35,6 @@ void about_window::render(const clrsync::core::palette &pal) ImGui::Separator(); ImGui::Spacing(); - ImGui::Text("Links:"); - constexpr float button_width = 200.0f; float spacing = ImGui::GetStyle().ItemSpacing.x; float total_width = 2.0f * button_width + spacing; diff --git a/src/gui/views/color_table_renderer.cpp b/src/gui/views/color_table_renderer.cpp index c8a29b5..3713c86 100644 --- a/src/gui/views/color_table_renderer.cpp +++ b/src/gui/views/color_table_renderer.cpp @@ -114,11 +114,15 @@ void color_table_renderer::render(const clrsync::core::palette ¤t, ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(8, 6)); + ImGui::AlignTextToFramePadding(); ImGui::Text("Filter:"); ImGui::SameLine(); ImGui::SetNextItemWidth(200); - bool filter_changed = ImGui::InputTextWithHint("##color_filter", "Search colors...", - m_filter_text, sizeof(m_filter_text)); + bool filter_changed = + ImGui::InputTextWithHint("##color_filter", + "Search colors...", + m_filter_text, + sizeof(m_filter_text)); if (m_filter_text[0] != '\0') { diff --git a/src/gui/views/settings_window.cpp b/src/gui/views/settings_window.cpp index 3d6ebf1..adf7dbe 100644 --- a/src/gui/views/settings_window.cpp +++ b/src/gui/views/settings_window.cpp @@ -1,12 +1,11 @@ #include "gui/views/settings_window.hpp" #include "core/common/error.hpp" #include "core/config/config.hpp" -#include "gui/widgets/section_header.hpp" #include "gui/ui_manager.hpp" +#include "gui/widgets/section_header.hpp" #include "imgui.h" -settings_window::settings_window(clrsync::gui::ui_manager* ui_mgr) - : m_ui_manager(ui_mgr) +settings_window::settings_window(clrsync::gui::ui_manager *ui_mgr) : m_ui_manager(ui_mgr) { if (m_ui_manager) m_available_fonts = m_ui_manager->get_system_fonts(); @@ -17,7 +16,7 @@ settings_window::settings_window(clrsync::gui::ui_manager* ui_mgr) void settings_window::setup_widgets() { - m_form.set_path_browse_callback([this](const std::string& current_path) -> std::string { + m_form.set_path_browse_callback([this](const std::string ¤t_path) -> std::string { if (m_ui_manager) return m_ui_manager->select_folder_dialog("Select Directory", current_path); return ""; @@ -57,25 +56,27 @@ void settings_window::render() ImGui::Separator(); clrsync::gui::widgets::settings_buttons_callbacks callbacks{ - .on_ok = [this]() { - apply_settings(); - if (!m_error.has_error()) - { - m_visible = false; - m_settings_changed = false; - } - }, - .on_apply = [this]() { - apply_settings(); - if (!m_error.has_error()) - m_settings_changed = false; - }, + .on_ok = + [this]() { + apply_settings(); + if (!m_error.has_error()) + { + m_visible = false; + m_settings_changed = false; + } + }, + .on_apply = + [this]() { + apply_settings(); + if (!m_error.has_error()) + m_settings_changed = false; + }, .on_reset = [this]() { reset_to_defaults(); }, - .on_cancel = [this]() { - load_settings(); - m_visible = false; - } - }; + .on_cancel = + [this]() { + load_settings(); + m_visible = false; + }}; m_buttons.render(callbacks, m_settings_changed); } ImGui::End(); @@ -83,7 +84,7 @@ void settings_window::render() void settings_window::load_settings() { - auto& cfg = clrsync::core::config::instance(); + auto &cfg = clrsync::core::config::instance(); m_default_theme = cfg.default_theme(); m_palettes_path = cfg.palettes_path(); @@ -106,7 +107,7 @@ void settings_window::load_settings() void settings_window::apply_settings() { - auto& cfg = clrsync::core::config::instance(); + auto &cfg = clrsync::core::config::instance(); if (m_default_theme.empty()) { @@ -176,22 +177,22 @@ void settings_window::render_general_tab() section_header("Theme Settings", m_current_palette); - form_field_config theme_cfg{ - .label = "Default Theme", - .tooltip = "The default color scheme to load on startup", - .field_width = -100.0f - }; + form_field_config theme_cfg; + theme_cfg.label = "Default Theme"; + theme_cfg.label_width = 150.0f; + theme_cfg.tooltip = "The default color scheme to load on startup"; + theme_cfg.field_width = -100.0f; if (m_form.render_text(theme_cfg, m_default_theme)) m_settings_changed = true; section_header("Path Settings", m_current_palette); - form_field_config path_cfg{ - .label = "Palettes Directory", - .tooltip = "Directory where color palettes are stored\nSupports ~ for home directory", - .field_width = -1.0f, - .type = field_type::path - }; + form_field_config path_cfg; + path_cfg.label = "Palettes Directory"; + path_cfg.label_width = 150.0f; + path_cfg.tooltip = "Directory where color palettes are stored\nSupports ~ for home directory"; + path_cfg.field_width = -1.0f; + path_cfg.type = field_type::path; if (m_form.render_path(path_cfg, m_palettes_path)) m_settings_changed = true; } @@ -202,28 +203,28 @@ void settings_window::render_appearance_tab() section_header("Font Settings", m_current_palette); - form_field_config font_cfg{ - .label = "Font Family", - .tooltip = "Select font family for the application interface", - .field_width = -1.0f, - .type = field_type::combo - }; + form_field_config font_cfg; + font_cfg.label = "Font Family"; + font_cfg.label_width = 150.0f; + font_cfg.tooltip = "Select font family for the application interface"; + font_cfg.field_width = -1.0f; + font_cfg.type = field_type::combo; if (m_form.render_combo(font_cfg, m_available_fonts, m_selected_font_idx, m_font)) m_settings_changed = true; ImGui::Spacing(); - form_field_config size_cfg{ - .label = "Font Size", - .tooltip = "Font size for the application interface (8-48)", - .field_width = 120.0f, - .type = field_type::slider, - .min_value = 8.0f, - .max_value = 48.0f, - .format = "%d px", - .show_reset = true, - .default_value = 14 - }; + form_field_config size_cfg; + size_cfg.label = "Font Size", + size_cfg.label_width = 150.0f; + size_cfg.tooltip = "Font size for the application interface (8-48)"; + size_cfg.field_width = 120.0f; + size_cfg.type = field_type::slider; + size_cfg.min_value = 8.0f; + size_cfg.max_value = 48.0f; + size_cfg.format = "%d px"; + size_cfg.show_reset = true; + size_cfg.default_value = 14; if (m_form.render_slider(size_cfg, m_font_size)) m_settings_changed = true; }