mirror of
https://github.com/obsqrbtz/clrsync.git
synced 2026-04-08 20:19:04 +03:00
chore: cleanup the ui
This commit is contained in:
@@ -64,7 +64,7 @@ std::map<std::string, value_type> toml_file::get_table(const std::string §io
|
||||
else if (auto d = val.value<double>())
|
||||
result[std::string(p.first.str())] = static_cast<uint32_t>(*d);
|
||||
else
|
||||
result[std::string(p.first.str())] = {}; // fallback for unsupported types
|
||||
result[std::string(p.first.str())] = {};
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
@@ -50,7 +50,6 @@ std::filesystem::path normalize_path(const std::string &path)
|
||||
{
|
||||
std::string expanded = expand_user(path);
|
||||
std::filesystem::path fs_path(expanded);
|
||||
// lexically_normal() resolves . and .. and normalizes separators
|
||||
return fs_path.lexically_normal();
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
namespace clrsync::core
|
||||
{
|
||||
|
||||
const std::string GIT_SEMVER = "0.1.4+git.g899a5d5";
|
||||
const std::string GIT_SEMVER = "0.1.4+git.gb4ca5e1";
|
||||
|
||||
const std::string version_string();
|
||||
} // namespace clrsync::core
|
||||
|
||||
@@ -12,6 +12,7 @@ set(GUI_SOURCES
|
||||
about_window.cpp
|
||||
settings_window.cpp
|
||||
font_loader.cpp
|
||||
file_browser.cpp
|
||||
${CMAKE_SOURCE_DIR}/lib/color_text_edit/TextEditor.cpp
|
||||
)
|
||||
|
||||
@@ -28,6 +29,11 @@ if(WIN32)
|
||||
glfw
|
||||
imgui
|
||||
OpenGL::GL
|
||||
shell32
|
||||
ole32
|
||||
uuid
|
||||
comdlg32
|
||||
shlwapi
|
||||
)
|
||||
elseif(APPLE)
|
||||
target_link_libraries(clrsync_gui PRIVATE
|
||||
@@ -35,8 +41,12 @@ elseif(APPLE)
|
||||
glfw
|
||||
imgui
|
||||
OpenGL::GL
|
||||
"-framework Cocoa"
|
||||
)
|
||||
else()
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(GTK3 REQUIRED gtk+-3.0)
|
||||
|
||||
target_link_libraries(clrsync_gui PRIVATE
|
||||
clrsync_core
|
||||
imgui
|
||||
@@ -47,5 +57,9 @@ else()
|
||||
Xi
|
||||
Fontconfig::Fontconfig
|
||||
OpenGL::GL
|
||||
${GTK3_LIBRARIES}
|
||||
)
|
||||
|
||||
target_include_directories(clrsync_gui PRIVATE ${GTK3_INCLUDE_DIRS})
|
||||
target_compile_options(clrsync_gui PRIVATE ${GTK3_CFLAGS_OTHER})
|
||||
endif()
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
#include "about_window.hpp"
|
||||
#include "core/version.hpp"
|
||||
#include "imgui_helpers.hpp"
|
||||
#include "imgui.h"
|
||||
|
||||
about_window::about_window()
|
||||
{
|
||||
}
|
||||
|
||||
void about_window::render()
|
||||
void about_window::render(const clrsync::core::palette& pal)
|
||||
{
|
||||
if (!m_visible)
|
||||
return;
|
||||
@@ -21,13 +22,15 @@ void about_window::render()
|
||||
const char *title = "clrsync";
|
||||
const float title_size = ImGui::CalcTextSize(title).x;
|
||||
ImGui::SetCursorPosX((window_width - title_size) * 0.5f);
|
||||
ImGui::TextColored(ImVec4(0.4f, 0.8f, 1.0f, 1.0f), "%s", title);
|
||||
ImVec4 title_color = palette_utils::get_color(pal, "info", "accent");
|
||||
ImGui::TextColored(title_color, "%s", title);
|
||||
ImGui::PopFont();
|
||||
|
||||
std::string version = "Version " + clrsync::core::version_string();
|
||||
const float version_size = ImGui::CalcTextSize(version.c_str()).x;
|
||||
ImGui::SetCursorPosX((window_width - version_size) * 0.5f);
|
||||
ImGui::TextColored(ImVec4(0.7f, 0.7f, 0.7f, 1.0f), "%s", version.c_str());
|
||||
ImVec4 subtitle_color = palette_utils::get_color(pal, "editor_inactive", "foreground");
|
||||
ImGui::TextColored(subtitle_color, "%s", version.c_str());
|
||||
|
||||
ImGui::Spacing();
|
||||
ImGui::Separator();
|
||||
@@ -43,7 +46,12 @@ void about_window::render()
|
||||
|
||||
ImGui::Text("Links:");
|
||||
|
||||
if (ImGui::Button("GitHub Repository", ImVec2(200, 0)))
|
||||
const float button_width = 200.0f;
|
||||
const float spacing = ImGui::GetStyle().ItemSpacing.x;
|
||||
const float total_width = 2.0f * button_width + spacing;
|
||||
ImGui::SetCursorPosX((window_width - total_width) * 0.5f);
|
||||
|
||||
if (ImGui::Button("GitHub Repository", ImVec2(button_width, 0)))
|
||||
{
|
||||
#ifdef _WIN32
|
||||
system("start https://github.com/obsqrbtz/clrsync");
|
||||
@@ -55,7 +63,7 @@ void about_window::render()
|
||||
}
|
||||
ImGui::SameLine();
|
||||
|
||||
if (ImGui::Button("Documentation", ImVec2(200, 0)))
|
||||
if (ImGui::Button("Documentation", ImVec2(button_width, 0)))
|
||||
{
|
||||
#ifdef _WIN32
|
||||
system("start https://binarygoose.dev/projects/clrsync/overview/");
|
||||
@@ -71,7 +79,8 @@ void about_window::render()
|
||||
ImGui::Separator();
|
||||
ImGui::Spacing();
|
||||
|
||||
ImGui::TextColored(ImVec4(0.6f, 0.6f, 0.6f, 1.0f), "MIT License");
|
||||
ImVec4 license_color = palette_utils::get_color(pal, "editor_inactive", "foreground");
|
||||
ImGui::TextColored(license_color, "MIT License");
|
||||
ImGui::TextWrapped(
|
||||
"Copyright (c) 2025 Daniel Dada\n\n"
|
||||
"Permission is hereby granted, free of charge, to any person obtaining a copy "
|
||||
@@ -82,16 +91,6 @@ void about_window::render()
|
||||
"furnished to do so, subject to the following conditions:\n\n"
|
||||
"The above copyright notice and this permission notice shall be included in all "
|
||||
"copies or substantial portions of the Software.");
|
||||
|
||||
ImGui::Spacing();
|
||||
ImGui::Spacing();
|
||||
|
||||
const float button_width = 120.0f;
|
||||
ImGui::SetCursorPosX((window_width - button_width) * 0.5f);
|
||||
if (ImGui::Button("Close", ImVec2(button_width, 0)))
|
||||
{
|
||||
m_visible = false;
|
||||
}
|
||||
}
|
||||
ImGui::End();
|
||||
}
|
||||
@@ -1,17 +1,21 @@
|
||||
#ifndef CLRSYNC_GUI_ABOUT_WINDOW_HPP
|
||||
#define CLRSYNC_GUI_ABOUT_WINDOW_HPP
|
||||
|
||||
#include "core/palette/palette.hpp"
|
||||
|
||||
class about_window
|
||||
{
|
||||
public:
|
||||
about_window();
|
||||
void render();
|
||||
void render(const clrsync::core::palette& pal);
|
||||
void render() { render(m_default_palette); }
|
||||
void show() { m_visible = true; }
|
||||
void hide() { m_visible = false; }
|
||||
bool is_visible() const { return m_visible; }
|
||||
|
||||
private:
|
||||
bool m_visible{false};
|
||||
clrsync::core::palette m_default_palette;
|
||||
};
|
||||
|
||||
#endif // CLRSYNC_GUI_ABOUT_WINDOW_HPP
|
||||
@@ -1,14 +1,17 @@
|
||||
#include "color_scheme_editor.hpp"
|
||||
#include "template_editor.hpp"
|
||||
#include "theme_applier.hpp"
|
||||
#include "imgui.h"
|
||||
#include "imgui_helpers.hpp"
|
||||
#include "template_editor.hpp"
|
||||
#include "settings_window.hpp"
|
||||
#include "theme_applier.hpp"
|
||||
#include <iostream>
|
||||
#include <ranges>
|
||||
|
||||
|
||||
color_scheme_editor::color_scheme_editor()
|
||||
{
|
||||
const auto ¤t = m_controller.current_palette();
|
||||
|
||||
|
||||
if (!current.colors().empty())
|
||||
{
|
||||
theme_applier::apply_to_imgui(current);
|
||||
@@ -26,6 +29,10 @@ void color_scheme_editor::notify_palette_changed()
|
||||
{
|
||||
m_template_editor->apply_current_palette(m_controller.current_palette());
|
||||
}
|
||||
if (m_settings_window)
|
||||
{
|
||||
m_settings_window->set_palette(m_controller.current_palette());
|
||||
}
|
||||
}
|
||||
|
||||
void color_scheme_editor::apply_themes()
|
||||
@@ -44,8 +51,8 @@ void color_scheme_editor::render_controls_and_colors()
|
||||
ImGui::Separator();
|
||||
|
||||
ImGui::BeginChild("ColorTableContent", ImVec2(0, 0), false);
|
||||
m_color_table.render(m_controller.current_palette(), m_controller,
|
||||
[this]() { apply_themes(); });
|
||||
m_color_table.render(m_controller.current_palette(), m_controller,
|
||||
[this]() { apply_themes(); });
|
||||
ImGui::EndChild();
|
||||
|
||||
ImGui::End();
|
||||
@@ -54,9 +61,9 @@ void color_scheme_editor::render_controls_and_colors()
|
||||
void color_scheme_editor::render_preview()
|
||||
{
|
||||
ImGui::Begin("Color Preview");
|
||||
|
||||
|
||||
m_preview.render(m_controller.current_palette());
|
||||
|
||||
|
||||
ImGui::End();
|
||||
}
|
||||
|
||||
@@ -68,11 +75,10 @@ void color_scheme_editor::render_controls()
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(6, 8));
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(8, 5));
|
||||
|
||||
// Palette selector
|
||||
ImGui::AlignTextToFramePadding();
|
||||
ImGui::Text("Palette:");
|
||||
ImGui::SameLine();
|
||||
|
||||
|
||||
ImGui::SetNextItemWidth(200.0f);
|
||||
if (ImGui::BeginCombo("##scheme", current.name().c_str()))
|
||||
{
|
||||
@@ -95,7 +101,6 @@ void color_scheme_editor::render_controls()
|
||||
ImGui::SameLine();
|
||||
ImGui::SetCursorPosX(ImGui::GetCursorPosX() + 8);
|
||||
|
||||
// Action buttons
|
||||
static char new_palette_name_buf[128] = "";
|
||||
if (ImGui::Button(" + New "))
|
||||
{
|
||||
@@ -109,20 +114,20 @@ void color_scheme_editor::render_controls()
|
||||
{
|
||||
ImGui::Text("Enter a name for the new palette:");
|
||||
ImGui::Spacing();
|
||||
|
||||
|
||||
ImGui::SetNextItemWidth(250);
|
||||
ImGui::InputTextWithHint("##new_palette_input", "Palette name...",
|
||||
new_palette_name_buf, IM_ARRAYSIZE(new_palette_name_buf));
|
||||
ImGui::InputTextWithHint("##new_palette_input", "Palette name...", new_palette_name_buf,
|
||||
IM_ARRAYSIZE(new_palette_name_buf));
|
||||
|
||||
ImGui::Spacing();
|
||||
ImGui::Separator();
|
||||
ImGui::Spacing();
|
||||
|
||||
bool can_create = strlen(new_palette_name_buf) > 0;
|
||||
|
||||
|
||||
if (!can_create)
|
||||
ImGui::BeginDisabled();
|
||||
|
||||
|
||||
if (ImGui::Button("Create", ImVec2(120, 0)))
|
||||
{
|
||||
m_controller.create_palette(new_palette_name_buf);
|
||||
@@ -131,7 +136,7 @@ void color_scheme_editor::render_controls()
|
||||
new_palette_name_buf[0] = 0;
|
||||
ImGui::CloseCurrentPopup();
|
||||
}
|
||||
|
||||
|
||||
if (!can_create)
|
||||
ImGui::EndDisabled();
|
||||
|
||||
@@ -155,16 +160,23 @@ void color_scheme_editor::render_controls()
|
||||
ImGui::SetTooltip("Save current palette to file");
|
||||
|
||||
ImGui::SameLine();
|
||||
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0.7f, 0.2f, 0.2f, 1.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4(0.9f, 0.3f, 0.3f, 1.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImVec4(0.5f, 0.1f, 0.1f, 1.0f));
|
||||
auto error = palette_utils::get_color(current, "error");
|
||||
auto error_hover = ImVec4(error.x * 1.1f, error.y * 1.1f, error.z * 1.1f,
|
||||
error.w);
|
||||
auto error_active = ImVec4(error.x * 0.8f, error.y * 0.8f, error.z * 0.8f,
|
||||
error.w);
|
||||
auto on_error = palette_utils::get_color(current, "on_error");
|
||||
ImGui::PushStyleColor(ImGuiCol_Button, error);
|
||||
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, error_hover);
|
||||
ImGui::PushStyleColor(ImGuiCol_ButtonActive, error_active);
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, on_error);
|
||||
if (ImGui::Button(" Delete "))
|
||||
{
|
||||
m_show_delete_confirmation = true;
|
||||
}
|
||||
ImGui::PopStyleColor(4);
|
||||
if (ImGui::IsItemHovered())
|
||||
ImGui::SetTooltip("Delete current palette");
|
||||
ImGui::PopStyleColor(3);
|
||||
|
||||
if (m_show_delete_confirmation)
|
||||
{
|
||||
@@ -172,47 +184,21 @@ void color_scheme_editor::render_controls()
|
||||
m_show_delete_confirmation = false;
|
||||
}
|
||||
|
||||
if (ImGui::BeginPopupModal("Delete Palette?", nullptr, ImGuiWindowFlags_AlwaysAutoResize))
|
||||
{
|
||||
ImGui::TextColored(ImVec4(1.0f, 0.6f, 0.4f, 1.0f),
|
||||
"Are you sure you want to delete '%s'?", current.name().c_str());
|
||||
ImGui::Text("This action cannot be undone.");
|
||||
|
||||
ImGui::Spacing();
|
||||
ImGui::Separator();
|
||||
ImGui::Spacing();
|
||||
|
||||
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0.7f, 0.2f, 0.2f, 1.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4(0.9f, 0.3f, 0.3f, 1.0f));
|
||||
if (ImGui::Button("Delete", ImVec2(120, 0)))
|
||||
{
|
||||
m_controller.delete_current_palette();
|
||||
apply_themes();
|
||||
ImGui::CloseCurrentPopup();
|
||||
}
|
||||
ImGui::PopStyleColor(2);
|
||||
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button("Cancel", ImVec2(120, 0)))
|
||||
{
|
||||
ImGui::CloseCurrentPopup();
|
||||
}
|
||||
ImGui::EndPopup();
|
||||
}
|
||||
palette_utils::render_delete_confirmation_popup("Delete Palette?", current.name(), "palette",
|
||||
current, [this]() {
|
||||
m_controller.delete_current_palette();
|
||||
apply_themes();
|
||||
});
|
||||
|
||||
ImGui::SameLine();
|
||||
ImGui::SetCursorPosX(ImGui::GetCursorPosX() + 16);
|
||||
|
||||
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0.2f, 0.5f, 0.7f, 1.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4(0.3f, 0.6f, 0.8f, 1.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImVec4(0.15f, 0.4f, 0.6f, 1.0f));
|
||||
|
||||
if (ImGui::Button(" Apply Theme "))
|
||||
{
|
||||
m_controller.apply_current_theme();
|
||||
}
|
||||
if (ImGui::IsItemHovered())
|
||||
ImGui::SetTooltip("Apply current palette to all enabled templates");
|
||||
ImGui::PopStyleColor(3);
|
||||
|
||||
|
||||
ImGui::PopStyleVar(2);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "preview_renderer.hpp"
|
||||
|
||||
class template_editor;
|
||||
class settings_window;
|
||||
|
||||
class color_scheme_editor
|
||||
{
|
||||
@@ -15,6 +16,7 @@ public:
|
||||
void render_controls_and_colors();
|
||||
void render_preview();
|
||||
void set_template_editor(template_editor* editor) { m_template_editor = editor; }
|
||||
void set_settings_window(settings_window* window) { m_settings_window = window; }
|
||||
const palette_controller& controller() const { return m_controller; }
|
||||
|
||||
private:
|
||||
@@ -26,6 +28,7 @@ private:
|
||||
color_table_renderer m_color_table;
|
||||
preview_renderer m_preview;
|
||||
template_editor* m_template_editor{nullptr};
|
||||
settings_window* m_settings_window{nullptr};
|
||||
bool m_show_delete_confirmation{false};
|
||||
};
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "color_table_renderer.hpp"
|
||||
#include "imgui_helpers.hpp"
|
||||
#include "imgui.h"
|
||||
#include <algorithm>
|
||||
#include <cctype>
|
||||
@@ -35,7 +36,8 @@ void color_table_renderer::render_color_row(const std::string &name,
|
||||
ImGui::TableSetColumnIndex(0);
|
||||
const float key_col_width = ImGui::GetContentRegionAvail().x;
|
||||
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(0.7f, 0.85f, 1.0f, 1.0f));
|
||||
ImVec4 text_color = palette_utils::get_color(current, "info", "accent");
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, text_color);
|
||||
const bool copied = ImGui::Selectable(name.c_str(), false, 0, ImVec2(key_col_width, 0.0f));
|
||||
ImGui::PopStyleColor();
|
||||
|
||||
@@ -159,7 +161,7 @@ void color_table_renderer::render(const clrsync::core::palette& current,
|
||||
if (!has_matches)
|
||||
return;
|
||||
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(0.9f, 0.9f, 0.5f, 1.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, palette_utils::get_color(current, "accent"));
|
||||
bool header_open = ImGui::TreeNodeEx(title, ImGuiTreeNodeFlags_DefaultOpen | ImGuiTreeNodeFlags_SpanAvailWidth);
|
||||
ImGui::PopStyleColor();
|
||||
|
||||
|
||||
338
src/gui/file_browser.cpp
Normal file
338
src/gui/file_browser.cpp
Normal file
@@ -0,0 +1,338 @@
|
||||
#include "file_browser.hpp"
|
||||
#include <filesystem>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#include <commdlg.h>
|
||||
#include <shlobj.h>
|
||||
#include <shlwapi.h>
|
||||
#include <cstring>
|
||||
|
||||
namespace file_dialogs {
|
||||
|
||||
std::string open_file_dialog(const std::string& title,
|
||||
const std::string& initial_path,
|
||||
const std::vector<std::string>& filters) {
|
||||
OPENFILENAMEA ofn;
|
||||
char file[MAX_PATH] = "";
|
||||
|
||||
std::string filter_str = "All Files (*.*)\0*.*\0";
|
||||
|
||||
ZeroMemory(&ofn, sizeof(ofn));
|
||||
ofn.lStructSize = sizeof(ofn);
|
||||
ofn.hwndOwner = GetActiveWindow();
|
||||
ofn.lpstrFile = file;
|
||||
ofn.nMaxFile = sizeof(file);
|
||||
ofn.lpstrFilter = filter_str.c_str();
|
||||
ofn.nFilterIndex = 1;
|
||||
ofn.lpstrTitle = title.c_str();
|
||||
ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST | OFN_NOCHANGEDIR;
|
||||
|
||||
if (!initial_path.empty() && std::filesystem::exists(initial_path)) {
|
||||
std::filesystem::path p(initial_path);
|
||||
if (std::filesystem::is_directory(p)) {
|
||||
ofn.lpstrInitialDir = initial_path.c_str();
|
||||
} else {
|
||||
std::string dir = p.parent_path().string();
|
||||
std::string name = p.filename().string();
|
||||
ofn.lpstrInitialDir = dir.c_str();
|
||||
strncpy(file, name.c_str(), sizeof(file) - 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (GetOpenFileNameA(&ofn)) {
|
||||
return std::string(file);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
std::string save_file_dialog(const std::string& title,
|
||||
const std::string& initial_path,
|
||||
const std::vector<std::string>& filters) {
|
||||
OPENFILENAMEA ofn;
|
||||
char file[MAX_PATH] = "";
|
||||
|
||||
std::string filter_str = "All Files\0*.*\0\0";
|
||||
|
||||
ZeroMemory(&ofn, sizeof(ofn));
|
||||
ofn.lStructSize = sizeof(ofn);
|
||||
ofn.hwndOwner = GetActiveWindow();
|
||||
ofn.lpstrFile = file;
|
||||
ofn.nMaxFile = sizeof(file);
|
||||
ofn.lpstrFilter = filter_str.c_str();
|
||||
ofn.nFilterIndex = 1;
|
||||
ofn.lpstrTitle = title.c_str();
|
||||
ofn.Flags = OFN_PATHMUSTEXIST | OFN_OVERWRITEPROMPT | OFN_NOCHANGEDIR;
|
||||
|
||||
if (!initial_path.empty()) {
|
||||
std::filesystem::path p(initial_path);
|
||||
if (std::filesystem::exists(p) && std::filesystem::is_directory(p)) {
|
||||
ofn.lpstrInitialDir = initial_path.c_str();
|
||||
} else {
|
||||
std::string dir = p.parent_path().string();
|
||||
std::string name = p.filename().string();
|
||||
if (std::filesystem::exists(dir)) {
|
||||
ofn.lpstrInitialDir = dir.c_str();
|
||||
strncpy(file, name.c_str(), sizeof(file) - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (GetSaveFileNameA(&ofn)) {
|
||||
return std::string(file);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
std::string select_folder_dialog(const std::string& title,
|
||||
const std::string& initial_path) {
|
||||
IFileOpenDialog *pFileOpen;
|
||||
|
||||
HRESULT hr = CoCreateInstance(CLSID_FileOpenDialog, NULL, CLSCTX_ALL,
|
||||
IID_IFileOpenDialog, reinterpret_cast<void**>(&pFileOpen));
|
||||
|
||||
if (SUCCEEDED(hr)) {
|
||||
DWORD dwFlags;
|
||||
if (SUCCEEDED(pFileOpen->GetOptions(&dwFlags))) {
|
||||
pFileOpen->SetOptions(dwFlags | FOS_PICKFOLDERS);
|
||||
}
|
||||
|
||||
std::wstring wtitle(title.begin(), title.end());
|
||||
pFileOpen->SetTitle(wtitle.c_str());
|
||||
|
||||
if (!initial_path.empty() && std::filesystem::exists(initial_path)) {
|
||||
IShellItem *psi = NULL;
|
||||
std::wstring winitial(initial_path.begin(), initial_path.end());
|
||||
hr = SHCreateItemFromParsingName(winitial.c_str(), NULL, IID_IShellItem, (void**)&psi);
|
||||
if (SUCCEEDED(hr)) {
|
||||
pFileOpen->SetFolder(psi);
|
||||
psi->Release();
|
||||
}
|
||||
}
|
||||
|
||||
hr = pFileOpen->Show(GetActiveWindow());
|
||||
|
||||
if (SUCCEEDED(hr)) {
|
||||
IShellItem *pItem;
|
||||
hr = pFileOpen->GetResult(&pItem);
|
||||
if (SUCCEEDED(hr)) {
|
||||
PWSTR pszFilePath;
|
||||
hr = pItem->GetDisplayName(SIGDN_FILESYSPATH, &pszFilePath);
|
||||
|
||||
if (SUCCEEDED(hr)) {
|
||||
std::wstring wpath(pszFilePath);
|
||||
std::string result(wpath.begin(), wpath.end());
|
||||
CoTaskMemFree(pszFilePath);
|
||||
pItem->Release();
|
||||
pFileOpen->Release();
|
||||
return result;
|
||||
}
|
||||
pItem->Release();
|
||||
}
|
||||
}
|
||||
pFileOpen->Release();
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include <Cocoa/Cocoa.h>
|
||||
|
||||
namespace file_dialogs {
|
||||
|
||||
std::string open_file_dialog(const std::string& title,
|
||||
const std::string& initial_path,
|
||||
const std::vector<std::string>& filters) {
|
||||
@autoreleasepool {
|
||||
NSOpenPanel* panel = [NSOpenPanel openPanel];
|
||||
[panel setTitle:[NSString stringWithUTF8String:title.c_str()]];
|
||||
[panel setCanChooseFiles:YES];
|
||||
[panel setCanChooseDirectories:NO];
|
||||
[panel setAllowsMultipleSelection:NO];
|
||||
|
||||
if (!initial_path.empty()) {
|
||||
NSURL* url = [NSURL fileURLWithPath:[NSString stringWithUTF8String:initial_path.c_str()]];
|
||||
[panel setDirectoryURL:url];
|
||||
}
|
||||
|
||||
if ([panel runModal] == NSModalResponseOK) {
|
||||
NSURL* url = [[panel URLs] objectAtIndex:0];
|
||||
return std::string([[url path] UTF8String]);
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
std::string save_file_dialog(const std::string& title,
|
||||
const std::string& initial_path,
|
||||
const std::vector<std::string>& filters) {
|
||||
@autoreleasepool {
|
||||
NSSavePanel* panel = [NSSavePanel savePanel];
|
||||
[panel setTitle:[NSString stringWithUTF8String:title.c_str()]];
|
||||
|
||||
if (!initial_path.empty()) {
|
||||
std::filesystem::path p(initial_path);
|
||||
if (std::filesystem::exists(p.parent_path())) {
|
||||
NSURL* url = [NSURL fileURLWithPath:[NSString stringWithUTF8String:p.parent_path().c_str()]];
|
||||
[panel setDirectoryURL:url];
|
||||
[panel setNameFieldStringValue:[NSString stringWithUTF8String:p.filename().c_str()]];
|
||||
}
|
||||
}
|
||||
|
||||
if ([panel runModal] == NSModalResponseOK) {
|
||||
NSURL* url = [panel URL];
|
||||
return std::string([[url path] UTF8String]);
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
std::string select_folder_dialog(const std::string& title,
|
||||
const std::string& initial_path) {
|
||||
@autoreleasepool {
|
||||
NSOpenPanel* panel = [NSOpenPanel openPanel];
|
||||
[panel setTitle:[NSString stringWithUTF8String:title.c_str()]];
|
||||
[panel setCanChooseFiles:NO];
|
||||
[panel setCanChooseDirectories:YES];
|
||||
[panel setAllowsMultipleSelection:NO];
|
||||
|
||||
if (!initial_path.empty()) {
|
||||
NSURL* url = [NSURL fileURLWithPath:[NSString stringWithUTF8String:initial_path.c_str()]];
|
||||
[panel setDirectoryURL:url];
|
||||
}
|
||||
|
||||
if ([panel runModal] == NSModalResponseOK) {
|
||||
NSURL* url = [[panel URLs] objectAtIndex:0];
|
||||
return std::string([[url path] UTF8String]);
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
namespace file_dialogs {
|
||||
|
||||
std::string open_file_dialog(const std::string& title,
|
||||
const std::string& initial_path,
|
||||
const std::vector<std::string>& filters) {
|
||||
if (!gtk_init_check(nullptr, nullptr)) {
|
||||
return "";
|
||||
}
|
||||
|
||||
GtkWidget* dialog = gtk_file_chooser_dialog_new(
|
||||
title.c_str(),
|
||||
nullptr,
|
||||
GTK_FILE_CHOOSER_ACTION_OPEN,
|
||||
"Cancel", GTK_RESPONSE_CANCEL,
|
||||
"Open", GTK_RESPONSE_ACCEPT,
|
||||
nullptr);
|
||||
|
||||
if (!initial_path.empty()) {
|
||||
std::filesystem::path p(initial_path);
|
||||
if (std::filesystem::exists(p)) {
|
||||
if (std::filesystem::is_directory(p)) {
|
||||
gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(dialog), initial_path.c_str());
|
||||
} else {
|
||||
gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(dialog), p.parent_path().c_str());
|
||||
gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(dialog), p.filename().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::string result;
|
||||
if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) {
|
||||
char* filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));
|
||||
if (filename) {
|
||||
result = filename;
|
||||
g_free(filename);
|
||||
}
|
||||
}
|
||||
|
||||
gtk_widget_destroy(dialog);
|
||||
return result;
|
||||
}
|
||||
|
||||
std::string save_file_dialog(const std::string& title,
|
||||
const std::string& initial_path,
|
||||
const std::vector<std::string>& filters) {
|
||||
if (!gtk_init_check(nullptr, nullptr)) {
|
||||
return "";
|
||||
}
|
||||
|
||||
GtkWidget* dialog = gtk_file_chooser_dialog_new(
|
||||
title.c_str(),
|
||||
nullptr,
|
||||
GTK_FILE_CHOOSER_ACTION_SAVE,
|
||||
"Cancel", GTK_RESPONSE_CANCEL,
|
||||
"Save", GTK_RESPONSE_ACCEPT,
|
||||
nullptr);
|
||||
|
||||
gtk_file_chooser_set_do_overwrite_confirmation(GTK_FILE_CHOOSER(dialog), TRUE);
|
||||
|
||||
if (!initial_path.empty()) {
|
||||
std::filesystem::path p(initial_path);
|
||||
if (std::filesystem::exists(p.parent_path())) {
|
||||
gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(dialog), p.parent_path().c_str());
|
||||
gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(dialog), p.filename().c_str());
|
||||
}
|
||||
}
|
||||
|
||||
std::string result;
|
||||
if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) {
|
||||
char* filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));
|
||||
if (filename) {
|
||||
result = filename;
|
||||
g_free(filename);
|
||||
}
|
||||
}
|
||||
|
||||
gtk_widget_destroy(dialog);
|
||||
return result;
|
||||
}
|
||||
|
||||
std::string select_folder_dialog(const std::string& title,
|
||||
const std::string& initial_path) {
|
||||
if (!gtk_init_check(nullptr, nullptr)) {
|
||||
return "";
|
||||
}
|
||||
|
||||
GtkWidget* dialog = gtk_file_chooser_dialog_new(
|
||||
title.c_str(),
|
||||
nullptr,
|
||||
GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,
|
||||
"Cancel", GTK_RESPONSE_CANCEL,
|
||||
"Select", GTK_RESPONSE_ACCEPT,
|
||||
nullptr);
|
||||
|
||||
if (!initial_path.empty() && std::filesystem::exists(initial_path)) {
|
||||
gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(dialog), initial_path.c_str());
|
||||
}
|
||||
|
||||
std::string result;
|
||||
if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) {
|
||||
char* filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));
|
||||
if (filename) {
|
||||
result = filename;
|
||||
g_free(filename);
|
||||
}
|
||||
}
|
||||
|
||||
gtk_widget_destroy(dialog);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
20
src/gui/file_browser.hpp
Normal file
20
src/gui/file_browser.hpp
Normal file
@@ -0,0 +1,20 @@
|
||||
#ifndef CLRSYNC_GUI_FILE_BROWSER_HPP
|
||||
#define CLRSYNC_GUI_FILE_BROWSER_HPP
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace file_dialogs {
|
||||
std::string open_file_dialog(const std::string& title = "Open File",
|
||||
const std::string& initial_path = "",
|
||||
const std::vector<std::string>& filters = {});
|
||||
|
||||
std::string save_file_dialog(const std::string& title = "Save File",
|
||||
const std::string& initial_path = "",
|
||||
const std::vector<std::string>& filters = {});
|
||||
|
||||
std::string select_folder_dialog(const std::string& title = "Select Folder",
|
||||
const std::string& initial_path = "");
|
||||
}
|
||||
|
||||
#endif // CLRSYNC_GUI_FILE_BROWSER_HPP
|
||||
@@ -73,7 +73,6 @@ void render_menu_bar(about_window* about, settings_window* settings)
|
||||
ImGui::Separator();
|
||||
if (ImGui::MenuItem("Exit"))
|
||||
{
|
||||
// Will be handled by checking window should close
|
||||
glfwSetWindowShouldClose(glfwGetCurrentContext(), GLFW_TRUE);
|
||||
}
|
||||
ImGui::EndMenu();
|
||||
@@ -164,4 +163,96 @@ void shutdown(GLFWwindow* window)
|
||||
ImGui::DestroyContext();
|
||||
glfwDestroyWindow(window);
|
||||
glfwTerminate();
|
||||
}
|
||||
|
||||
namespace palette_utils
|
||||
{
|
||||
|
||||
ImVec4 get_color(const clrsync::core::palette& pal, const std::string& key, const std::string& fallback)
|
||||
{
|
||||
auto colors = pal.colors();
|
||||
if (colors.empty())
|
||||
return ImVec4(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
|
||||
auto it = colors.find(key);
|
||||
if (it == colors.end() && !fallback.empty())
|
||||
{
|
||||
it = colors.find(fallback);
|
||||
}
|
||||
|
||||
if (it != colors.end())
|
||||
{
|
||||
const auto& col = it->second;
|
||||
const uint32_t hex = col.hex();
|
||||
const float r = ((hex >> 24) & 0xFF) / 255.0f;
|
||||
const float g = ((hex >> 16) & 0xFF) / 255.0f;
|
||||
const float b = ((hex >> 8) & 0xFF) / 255.0f;
|
||||
const float a = (hex & 0xFF) / 255.0f;
|
||||
return ImVec4(r, g, b, a);
|
||||
}
|
||||
return ImVec4(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
}
|
||||
|
||||
uint32_t get_color_u32(const clrsync::core::palette& pal, const std::string& key, const std::string& fallback)
|
||||
{
|
||||
auto colors = pal.colors();
|
||||
if (colors.empty())
|
||||
return 0xFFFFFFFF;
|
||||
|
||||
auto it = colors.find(key);
|
||||
if (it == colors.end() && !fallback.empty())
|
||||
{
|
||||
it = colors.find(fallback);
|
||||
}
|
||||
|
||||
if (it != colors.end())
|
||||
{
|
||||
const auto& col = it->second;
|
||||
const uint32_t hex = col.hex();
|
||||
const uint32_t r = (hex >> 24) & 0xFF;
|
||||
const uint32_t g = (hex >> 16) & 0xFF;
|
||||
const uint32_t b = (hex >> 8) & 0xFF;
|
||||
const uint32_t a = hex & 0xFF;
|
||||
return (a << 24) | (b << 16) | (g << 8) | r;
|
||||
}
|
||||
return 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
bool render_delete_confirmation_popup(const std::string& popup_title, const std::string& item_name,
|
||||
const std::string& item_type, const clrsync::core::palette& pal,
|
||||
const std::function<void()>& on_delete)
|
||||
{
|
||||
bool result = false;
|
||||
if (ImGui::BeginPopupModal(popup_title.c_str(), nullptr, ImGuiWindowFlags_AlwaysAutoResize))
|
||||
{
|
||||
ImVec4 warning_color = get_color(pal, "warning", "accent");
|
||||
ImGui::TextColored(warning_color, "Are you sure you want to delete '%s'?", item_name.c_str());
|
||||
ImGui::Text("This action cannot be undone.");
|
||||
|
||||
ImGui::Spacing();
|
||||
ImGui::Separator();
|
||||
ImGui::Spacing();
|
||||
|
||||
float button_width = 120.0f;
|
||||
float total_width = 2.0f * button_width + ImGui::GetStyle().ItemSpacing.x;
|
||||
float window_width = ImGui::GetContentRegionAvail().x;
|
||||
ImGui::SetCursorPosX((window_width - total_width) * 0.5f);
|
||||
|
||||
if (ImGui::Button("Delete", ImVec2(button_width, 0)))
|
||||
{
|
||||
on_delete();
|
||||
result = true;
|
||||
ImGui::CloseCurrentPopup();
|
||||
}
|
||||
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button("Cancel", ImVec2(button_width, 0)))
|
||||
{
|
||||
ImGui::CloseCurrentPopup();
|
||||
}
|
||||
ImGui::EndPopup();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,6 +2,9 @@
|
||||
#define CLRSYNC_IMGUI_HELPERS_HPP
|
||||
|
||||
#include "gui/about_window.hpp"
|
||||
#include "core/palette/palette.hpp"
|
||||
#include "imgui.h"
|
||||
#include <functional>
|
||||
#include <string>
|
||||
|
||||
struct GLFWwindow;
|
||||
@@ -15,4 +18,20 @@ void end_frame(GLFWwindow* window);
|
||||
void shutdown(GLFWwindow* window);
|
||||
void render_menu_bar(about_window* about, settings_window* settings);
|
||||
|
||||
namespace palette_utils
|
||||
{
|
||||
ImVec4 get_color(const clrsync::core::palette& pal, const std::string& key, const std::string& fallback = "");
|
||||
uint32_t get_color_u32(const clrsync::core::palette& pal, const std::string& key, const std::string& fallback = "");
|
||||
bool render_delete_confirmation_popup(const std::string& popup_title, const std::string& item_name,
|
||||
const std::string& item_type, const clrsync::core::palette& pal,
|
||||
const std::function<void()>& on_delete);
|
||||
}
|
||||
|
||||
namespace imgui_helpers
|
||||
{
|
||||
inline ImVec4 get_palette_color(const clrsync::core::palette& pal, const std::string& key, const std::string& fallback = "") {
|
||||
return palette_utils::get_color(pal, key, fallback);
|
||||
}
|
||||
}
|
||||
|
||||
#endif // CLRSYNC_IMGUI_HELPERS_HPP
|
||||
|
||||
@@ -65,7 +65,9 @@ int main(int, char**)
|
||||
settings_window settingsWindow;
|
||||
|
||||
colorEditor.set_template_editor(&templateEditor);
|
||||
colorEditor.set_settings_window(&settingsWindow);
|
||||
templateEditor.apply_current_palette(colorEditor.controller().current_palette());
|
||||
settingsWindow.set_palette(colorEditor.controller().current_palette());
|
||||
|
||||
while (!glfwWindowShouldClose(window))
|
||||
{
|
||||
@@ -78,7 +80,7 @@ int main(int, char**)
|
||||
colorEditor.render_controls_and_colors();
|
||||
colorEditor.render_preview();
|
||||
templateEditor.render();
|
||||
aboutWindow.render();
|
||||
aboutWindow.render(colorEditor.controller().current_palette());
|
||||
settingsWindow.render();
|
||||
|
||||
loader.pop_font();
|
||||
|
||||
@@ -14,7 +14,6 @@ preview_renderer::preview_renderer()
|
||||
|
||||
namespace fs = std::filesystem;
|
||||
|
||||
// Expands ~ to the user's home directory
|
||||
std::string expand_user(const std::string &path)
|
||||
{
|
||||
if (path.empty()) return "";
|
||||
@@ -38,7 +37,6 @@ std::string expand_user(const std::string &path)
|
||||
return result;
|
||||
}
|
||||
|
||||
// Lists all files in a directory
|
||||
std::vector<std::string> list_files(const std::string &dir_path)
|
||||
{
|
||||
std::vector<std::string> files;
|
||||
|
||||
@@ -2,11 +2,13 @@
|
||||
#include "core/config/config.hpp"
|
||||
#include "core/error.hpp"
|
||||
#include "gui/font_loader.hpp"
|
||||
#include "gui/imgui_helpers.hpp"
|
||||
#include "gui/file_browser.hpp"
|
||||
#include "imgui.h"
|
||||
#include <cstring>
|
||||
|
||||
settings_window::settings_window()
|
||||
: m_font_size(14), m_selected_font_idx(0)
|
||||
: m_font_size(14), m_selected_font_idx(0), m_settings_changed(false), m_current_tab(0)
|
||||
{
|
||||
m_default_theme[0] = '\0';
|
||||
m_palettes_path[0] = '\0';
|
||||
@@ -23,116 +25,33 @@ void settings_window::render()
|
||||
if (!m_visible)
|
||||
return;
|
||||
|
||||
ImGui::SetNextWindowSize(ImVec2(600, 400), ImGuiCond_FirstUseEver);
|
||||
ImGui::SetNextWindowSize(ImVec2(700, 500), ImGuiCond_FirstUseEver);
|
||||
ImGui::SetNextWindowPos(ImGui::GetMainViewport()->GetCenter(), ImGuiCond_FirstUseEver, ImVec2(0.5f, 0.5f));
|
||||
|
||||
if (ImGui::Begin("Settings", &m_visible))
|
||||
ImGuiWindowFlags window_flags = ImGuiWindowFlags_NoCollapse;
|
||||
if (ImGui::Begin("Settings", &m_visible, window_flags))
|
||||
{
|
||||
ImGui::Text("General Settings");
|
||||
ImGui::Separator();
|
||||
ImGui::Spacing();
|
||||
|
||||
ImGui::Text("Default Theme:");
|
||||
ImGui::SameLine();
|
||||
ImGui::SetNextItemWidth(300.0f);
|
||||
ImGui::InputText("##default_theme", m_default_theme, sizeof(m_default_theme));
|
||||
if (ImGui::IsItemHovered())
|
||||
if (ImGui::BeginTabBar("SettingsTabs", ImGuiTabBarFlags_None))
|
||||
{
|
||||
ImGui::SetTooltip("The default color scheme to load on startup");
|
||||
}
|
||||
|
||||
ImGui::Spacing();
|
||||
|
||||
ImGui::Text("Palettes Path:");
|
||||
ImGui::SetNextItemWidth(-FLT_MIN);
|
||||
ImGui::InputText("##palettes_path", m_palettes_path, sizeof(m_palettes_path));
|
||||
if (ImGui::IsItemHovered())
|
||||
{
|
||||
ImGui::SetTooltip("Directory where color palettes are stored\nSupports ~ for home directory");
|
||||
}
|
||||
|
||||
ImGui::Spacing();
|
||||
|
||||
ImGui::Text("Font:");
|
||||
ImGui::SameLine();
|
||||
ImGui::SetNextItemWidth(300.0f);
|
||||
if (ImGui::BeginCombo("##font", m_font))
|
||||
{
|
||||
for (int i = 0; i < static_cast<int>(m_available_fonts.size()); i++)
|
||||
if (ImGui::BeginTabItem("General"))
|
||||
{
|
||||
bool is_selected = (i == m_selected_font_idx);
|
||||
if (ImGui::Selectable(m_available_fonts[i].c_str(), is_selected))
|
||||
{
|
||||
m_selected_font_idx = i;
|
||||
strncpy(m_font, m_available_fonts[i].c_str(), sizeof(m_font) - 1);
|
||||
m_font[sizeof(m_font) - 1] = '\0';
|
||||
}
|
||||
if (is_selected)
|
||||
ImGui::SetItemDefaultFocus();
|
||||
render_general_tab();
|
||||
ImGui::EndTabItem();
|
||||
}
|
||||
ImGui::EndCombo();
|
||||
}
|
||||
if (ImGui::IsItemHovered())
|
||||
{
|
||||
ImGui::SetTooltip("Select font for the application");
|
||||
|
||||
if (ImGui::BeginTabItem("Appearance"))
|
||||
{
|
||||
render_appearance_tab();
|
||||
ImGui::EndTabItem();
|
||||
}
|
||||
|
||||
ImGui::EndTabBar();
|
||||
}
|
||||
|
||||
ImGui::Spacing();
|
||||
|
||||
ImGui::Text("Font Size:");
|
||||
ImGui::SameLine();
|
||||
ImGui::SetNextItemWidth(100.0f);
|
||||
ImGui::InputInt("##font_size", &m_font_size, 1, 1);
|
||||
if (m_font_size < 8) m_font_size = 8;
|
||||
if (m_font_size > 48) m_font_size = 48;
|
||||
if (ImGui::IsItemHovered())
|
||||
{
|
||||
ImGui::SetTooltip("Font size");
|
||||
}
|
||||
|
||||
ImGui::Spacing();
|
||||
ImGui::Spacing();
|
||||
|
||||
if (!m_error_message.empty())
|
||||
{
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1.0f, 0.3f, 0.3f, 1.0f));
|
||||
ImGui::TextWrapped("%s", m_error_message.c_str());
|
||||
ImGui::PopStyleColor();
|
||||
ImGui::Spacing();
|
||||
}
|
||||
render_status_messages();
|
||||
|
||||
ImGui::Separator();
|
||||
ImGui::Spacing();
|
||||
|
||||
if (ImGui::Button("OK", ImVec2(120, 0)))
|
||||
{
|
||||
apply_settings();
|
||||
m_visible = false;
|
||||
m_error_message = "";
|
||||
}
|
||||
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button("Apply", ImVec2(120, 0)))
|
||||
{
|
||||
apply_settings();
|
||||
}
|
||||
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button("Reset to Defaults", ImVec2(150, 0)))
|
||||
{
|
||||
strncpy(m_default_theme, "dark", sizeof(m_default_theme));
|
||||
strncpy(m_palettes_path, "~/.config/clrsync/palettes", sizeof(m_palettes_path));
|
||||
strncpy(m_font, "JetBrains Mono Nerd Font", sizeof(m_font));
|
||||
m_font_size = 14;
|
||||
m_error_message = "";
|
||||
}
|
||||
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button("Cancel", ImVec2(120, 0)))
|
||||
{
|
||||
load_settings();
|
||||
m_visible = false;
|
||||
m_error_message = "";
|
||||
}
|
||||
render_action_buttons();
|
||||
}
|
||||
ImGui::End();
|
||||
}
|
||||
@@ -165,7 +84,8 @@ void settings_window::load_settings()
|
||||
|
||||
m_font_size = cfg.font_size();
|
||||
|
||||
m_error_message = "";
|
||||
m_error_message.clear();
|
||||
m_settings_changed = false;
|
||||
}
|
||||
|
||||
void settings_window::apply_settings()
|
||||
@@ -229,5 +149,198 @@ void settings_window::apply_settings()
|
||||
if (font)
|
||||
ImGui::GetIO().FontDefault = font;
|
||||
|
||||
m_error_message = "";
|
||||
m_error_message.clear();
|
||||
m_settings_changed = false;
|
||||
}
|
||||
|
||||
void settings_window::render_general_tab()
|
||||
{
|
||||
ImGui::Spacing();
|
||||
|
||||
auto accent_color = palette_utils::get_color(m_current_palette, "accent");
|
||||
ImGui::TextColored(accent_color, "Theme Settings");
|
||||
ImGui::Separator();
|
||||
ImGui::Spacing();
|
||||
|
||||
ImGui::Text("Default Theme:");
|
||||
ImGui::SameLine();
|
||||
show_help_marker("The default color scheme to load on startup");
|
||||
ImGui::SetNextItemWidth(-100.0f);
|
||||
if (ImGui::InputText("##default_theme", m_default_theme, sizeof(m_default_theme)))
|
||||
m_settings_changed = true;
|
||||
|
||||
ImGui::Spacing();
|
||||
|
||||
ImGui::TextColored(accent_color, "Path Settings");
|
||||
ImGui::Separator();
|
||||
ImGui::Spacing();
|
||||
|
||||
ImGui::Text("Palettes Directory:");
|
||||
ImGui::SameLine();
|
||||
show_help_marker("Directory where color palettes are stored\nSupports ~ for home directory");
|
||||
ImGui::SetNextItemWidth(-120.0f);
|
||||
if (ImGui::InputText("##palettes_path", m_palettes_path, sizeof(m_palettes_path)))
|
||||
m_settings_changed = true;
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button("Browse"))
|
||||
{
|
||||
std::string selected_path = file_dialogs::select_folder_dialog("Select Palettes Directory", m_palettes_path);
|
||||
if (!selected_path.empty()) {
|
||||
strncpy(m_palettes_path, selected_path.c_str(), sizeof(m_palettes_path) - 1);
|
||||
m_palettes_path[sizeof(m_palettes_path) - 1] = '\0';
|
||||
m_settings_changed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void settings_window::render_appearance_tab()
|
||||
{
|
||||
ImGui::Spacing();
|
||||
|
||||
auto accent_color = palette_utils::get_color(m_current_palette, "accent");
|
||||
ImGui::TextColored(accent_color, "Font Settings");
|
||||
ImGui::Separator();
|
||||
ImGui::Spacing();
|
||||
|
||||
ImGui::Text("Font Family:");
|
||||
ImGui::SameLine();
|
||||
show_help_marker("Select font family for the application interface");
|
||||
ImGui::SetNextItemWidth(-1.0f);
|
||||
if (ImGui::BeginCombo("##font", m_font))
|
||||
{
|
||||
for (int i = 0; i < static_cast<int>(m_available_fonts.size()); i++)
|
||||
{
|
||||
bool is_selected = (i == m_selected_font_idx);
|
||||
if (ImGui::Selectable(m_available_fonts[i].c_str(), is_selected))
|
||||
{
|
||||
m_selected_font_idx = i;
|
||||
strncpy(m_font, m_available_fonts[i].c_str(), sizeof(m_font) - 1);
|
||||
m_font[sizeof(m_font) - 1] = '\0';
|
||||
m_settings_changed = true;
|
||||
}
|
||||
if (is_selected)
|
||||
ImGui::SetItemDefaultFocus();
|
||||
}
|
||||
ImGui::EndCombo();
|
||||
}
|
||||
|
||||
ImGui::Spacing();
|
||||
|
||||
ImGui::Text("Font Size:");
|
||||
ImGui::SameLine();
|
||||
show_help_marker("Font size for the application interface (8-48)");
|
||||
ImGui::SetNextItemWidth(120.0f);
|
||||
int old_size = m_font_size;
|
||||
if (ImGui::SliderInt("##font_size", &m_font_size, 8, 48, "%d px"))
|
||||
{
|
||||
if (old_size != m_font_size)
|
||||
m_settings_changed = true;
|
||||
}
|
||||
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button("Reset"))
|
||||
{
|
||||
m_font_size = 14;
|
||||
m_settings_changed = true;
|
||||
}
|
||||
}
|
||||
|
||||
void settings_window::render_status_messages()
|
||||
{
|
||||
if (!m_error_message.empty())
|
||||
{
|
||||
ImGui::Spacing();
|
||||
auto error_color = palette_utils::get_color(m_current_palette, "error");
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, error_color);
|
||||
ImGui::TextWrapped("Error: %s", m_error_message.c_str());
|
||||
ImGui::PopStyleColor();
|
||||
if (ImGui::Button("Dismiss##error"))
|
||||
m_error_message.clear();
|
||||
}
|
||||
}
|
||||
|
||||
void settings_window::render_action_buttons()
|
||||
{
|
||||
ImGui::Spacing();
|
||||
|
||||
float button_width = 100.0f;
|
||||
float spacing = ImGui::GetStyle().ItemSpacing.x;
|
||||
float window_width = ImGui::GetContentRegionAvail().x;
|
||||
|
||||
float total_buttons_width = 4 * button_width + 3 * spacing;
|
||||
float start_pos = (window_width - total_buttons_width) * 0.5f;
|
||||
|
||||
if (start_pos > 0)
|
||||
ImGui::SetCursorPosX(ImGui::GetCursorPosX() + start_pos);
|
||||
|
||||
if (ImGui::Button("OK", ImVec2(button_width, 0)))
|
||||
{
|
||||
apply_settings();
|
||||
if (m_error_message.empty())
|
||||
{
|
||||
m_visible = false;
|
||||
m_settings_changed = false;
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::SameLine();
|
||||
|
||||
bool apply_disabled = !m_settings_changed;
|
||||
if (apply_disabled)
|
||||
{
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_Alpha, 0.5f);
|
||||
}
|
||||
|
||||
if (ImGui::Button("Apply", ImVec2(button_width, 0)) && !apply_disabled)
|
||||
{
|
||||
apply_settings();
|
||||
if (m_error_message.empty())
|
||||
{
|
||||
m_settings_changed = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (apply_disabled)
|
||||
{
|
||||
ImGui::PopStyleVar();
|
||||
}
|
||||
|
||||
ImGui::SameLine();
|
||||
|
||||
if (ImGui::Button("Reset", ImVec2(button_width, 0)))
|
||||
{
|
||||
reset_to_defaults();
|
||||
}
|
||||
|
||||
ImGui::SameLine();
|
||||
|
||||
if (ImGui::Button("Cancel", ImVec2(button_width, 0)))
|
||||
{
|
||||
load_settings();
|
||||
m_visible = false;
|
||||
m_error_message.clear();
|
||||
m_settings_changed = false;
|
||||
}
|
||||
}
|
||||
|
||||
void settings_window::show_help_marker(const char* desc)
|
||||
{
|
||||
ImGui::TextDisabled("(?)");
|
||||
if (ImGui::BeginItemTooltip())
|
||||
{
|
||||
ImGui::PushTextWrapPos(ImGui::GetFontSize() * 35.0f);
|
||||
ImGui::TextUnformatted(desc);
|
||||
ImGui::PopTextWrapPos();
|
||||
ImGui::EndTooltip();
|
||||
}
|
||||
}
|
||||
|
||||
void settings_window::reset_to_defaults()
|
||||
{
|
||||
strncpy(m_default_theme, "dark", sizeof(m_default_theme));
|
||||
strncpy(m_palettes_path, "~/.config/clrsync/palettes", sizeof(m_palettes_path));
|
||||
strncpy(m_font, "JetBrains Mono Nerd Font", sizeof(m_font));
|
||||
m_font_size = 14;
|
||||
m_error_message.clear();
|
||||
m_settings_changed = true;
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifndef CLRSYNC_GUI_SETTINGS_WINDOW_HPP
|
||||
#define CLRSYNC_GUI_SETTINGS_WINDOW_HPP
|
||||
|
||||
#include "core/palette/palette.hpp"
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
@@ -17,6 +18,17 @@ 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;
|
||||
}
|
||||
|
||||
bool m_visible{false};
|
||||
|
||||
@@ -29,6 +41,10 @@ private:
|
||||
int m_selected_font_idx;
|
||||
|
||||
std::string m_error_message;
|
||||
bool m_settings_changed;
|
||||
int m_current_tab;
|
||||
|
||||
clrsync::core::palette m_current_palette;
|
||||
};
|
||||
|
||||
#endif // CLRSYNC_GUI_SETTINGS_WINDOW_HPP
|
||||
@@ -3,6 +3,8 @@
|
||||
#include "core/theme/theme_template.hpp"
|
||||
#include "core/palette/color_keys.hpp"
|
||||
#include "core/utils.hpp"
|
||||
#include "imgui_helpers.hpp"
|
||||
#include "file_browser.hpp"
|
||||
#include "imgui.h"
|
||||
#include <algorithm>
|
||||
#include <filesystem>
|
||||
@@ -52,28 +54,12 @@ template_editor::template_editor() : m_template_name("new_template")
|
||||
|
||||
void template_editor::apply_current_palette(const clrsync::core::palette &pal)
|
||||
{
|
||||
m_current_palette = pal;
|
||||
auto colors = pal.colors();
|
||||
if (colors.empty())
|
||||
return;
|
||||
auto get_color_u32 = [&](const std::string &key, const std::string &fallback = "") -> uint32_t {
|
||||
auto it = colors.find(key);
|
||||
if (it == colors.end() && !fallback.empty())
|
||||
{
|
||||
it = colors.find(fallback);
|
||||
}
|
||||
|
||||
if (it != colors.end())
|
||||
{
|
||||
const auto &col = it->second;
|
||||
const uint32_t hex = col.hex();
|
||||
// Convert from RRGGBBAA to AABBGGRR (ImGui format)
|
||||
const uint32_t r = (hex >> 24) & 0xFF;
|
||||
const uint32_t g = (hex >> 16) & 0xFF;
|
||||
const uint32_t b = (hex >> 8) & 0xFF;
|
||||
const uint32_t a = hex & 0xFF;
|
||||
return (a << 24) | (b << 16) | (g << 8) | r;
|
||||
}
|
||||
return 0xFFFFFFFF;
|
||||
return palette_utils::get_color_u32(pal, key, fallback);
|
||||
};
|
||||
|
||||
auto palette = m_editor.GetPalette();
|
||||
@@ -116,34 +102,13 @@ void template_editor::apply_current_palette(const clrsync::core::palette &pal)
|
||||
|
||||
m_editor.SetPalette(palette);
|
||||
|
||||
// Update autocomplete colors from palette
|
||||
auto convert_to_imvec4 = [&](const std::string &key, const std::string &fallback = "") -> ImVec4 {
|
||||
auto it = colors.find(key);
|
||||
if (it == colors.end() && !fallback.empty())
|
||||
{
|
||||
it = colors.find(fallback);
|
||||
}
|
||||
|
||||
if (it != colors.end())
|
||||
{
|
||||
const auto &col = it->second;
|
||||
const uint32_t hex = col.hex();
|
||||
const float r = ((hex >> 24) & 0xFF) / 255.0f;
|
||||
const float g = ((hex >> 16) & 0xFF) / 255.0f;
|
||||
const float b = ((hex >> 8) & 0xFF) / 255.0f;
|
||||
const float a = (hex & 0xFF) / 255.0f;
|
||||
return ImVec4(r, g, b, a);
|
||||
}
|
||||
return ImVec4(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
};
|
||||
|
||||
m_autocomplete_bg_color = convert_to_imvec4("editor_background", "background");
|
||||
m_autocomplete_bg_color = palette_utils::get_color(pal, "editor_background", "background");
|
||||
m_autocomplete_bg_color.w = 0.98f;
|
||||
m_autocomplete_border_color = convert_to_imvec4("border", "editor_inactive");
|
||||
m_autocomplete_selected_color = convert_to_imvec4("editor_selected", "surface_variant");
|
||||
m_autocomplete_text_color = convert_to_imvec4("editor_main", "foreground");
|
||||
m_autocomplete_selected_text_color = convert_to_imvec4("foreground", "editor_main");
|
||||
m_autocomplete_dim_text_color = convert_to_imvec4("editor_comment", "editor_inactive");
|
||||
m_autocomplete_border_color = palette_utils::get_color(pal, "border", "editor_inactive");
|
||||
m_autocomplete_selected_color = palette_utils::get_color(pal, "editor_selected", "surface_variant");
|
||||
m_autocomplete_text_color = palette_utils::get_color(pal, "editor_main", "foreground");
|
||||
m_autocomplete_selected_text_color = palette_utils::get_color(pal, "foreground", "editor_main");
|
||||
m_autocomplete_dim_text_color = palette_utils::get_color(pal, "editor_comment", "editor_inactive");
|
||||
}
|
||||
|
||||
void template_editor::update_autocomplete_suggestions()
|
||||
@@ -396,14 +361,9 @@ void template_editor::render()
|
||||
m_show_delete_confirmation = false;
|
||||
}
|
||||
|
||||
if (ImGui::BeginPopupModal("Delete Template?", nullptr, ImGuiWindowFlags_AlwaysAutoResize))
|
||||
{
|
||||
ImGui::Text("Are you sure you want to delete '%s'?", m_template_name.c_str());
|
||||
ImGui::Text("This action cannot be undone.");
|
||||
ImGui::Separator();
|
||||
|
||||
if (ImGui::Button("Delete", ImVec2(120, 0)))
|
||||
{
|
||||
palette_utils::render_delete_confirmation_popup(
|
||||
"Delete Template?", m_template_name, "template", m_current_palette,
|
||||
[this]() {
|
||||
bool success = m_template_controller.remove_template(m_template_name);
|
||||
if (success)
|
||||
{
|
||||
@@ -414,15 +374,7 @@ void template_editor::render()
|
||||
{
|
||||
m_validation_error = "Failed to delete template";
|
||||
}
|
||||
ImGui::CloseCurrentPopup();
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button("Cancel", ImVec2(120, 0)))
|
||||
{
|
||||
ImGui::CloseCurrentPopup();
|
||||
}
|
||||
ImGui::EndPopup();
|
||||
}
|
||||
});
|
||||
|
||||
ImGui::End();
|
||||
}
|
||||
@@ -455,16 +407,23 @@ void template_editor::render_controls()
|
||||
if (m_is_editing_existing)
|
||||
{
|
||||
ImGui::SameLine();
|
||||
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0.7f, 0.2f, 0.2f, 1.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4(0.9f, 0.3f, 0.3f, 1.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImVec4(0.5f, 0.1f, 0.1f, 1.0f));
|
||||
auto error = palette_utils::get_color(m_current_palette, "error");
|
||||
auto error_hover = ImVec4(error.x * 1.1f, error.y * 1.1f, error.z * 1.1f,
|
||||
error.w);
|
||||
auto error_active = ImVec4(error.x * 0.8f, error.y * 0.8f, error.z * 0.8f,
|
||||
error.w);
|
||||
auto on_error = palette_utils::get_color(m_current_palette, "on_error");
|
||||
ImGui::PushStyleColor(ImGuiCol_Button, error);
|
||||
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, error_hover);
|
||||
ImGui::PushStyleColor(ImGuiCol_ButtonActive, error_active);
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, on_error);
|
||||
if (ImGui::Button(" Delete "))
|
||||
{
|
||||
delete_template();
|
||||
}
|
||||
if (ImGui::IsItemHovered())
|
||||
ImGui::SetTooltip("Delete this template");
|
||||
ImGui::PopStyleColor(3);
|
||||
ImGui::PopStyleColor(4);
|
||||
}
|
||||
|
||||
ImGui::SameLine();
|
||||
@@ -473,15 +432,21 @@ void template_editor::render_controls()
|
||||
bool enabled_changed = false;
|
||||
if (m_enabled)
|
||||
{
|
||||
ImGui::PushStyleColor(ImGuiCol_FrameBg, ImVec4(0.2f, 0.5f, 0.2f, 0.5f));
|
||||
ImGui::PushStyleColor(ImGuiCol_FrameBgHovered, ImVec4(0.3f, 0.6f, 0.3f, 0.6f));
|
||||
ImGui::PushStyleColor(ImGuiCol_CheckMark, ImVec4(0.4f, 0.9f, 0.4f, 1.0f));
|
||||
ImVec4 success_color = palette_utils::get_color(m_current_palette, "success", "accent");
|
||||
ImVec4 success_hover = ImVec4(success_color.x * 1.2f, success_color.y * 1.2f, success_color.z * 1.2f, 0.6f);
|
||||
ImVec4 success_check = ImVec4(success_color.x * 1.5f, success_color.y * 1.5f, success_color.z * 1.5f, 1.0f);
|
||||
ImGui::PushStyleColor(ImGuiCol_FrameBg, ImVec4(success_color.x, success_color.y, success_color.z, 0.5f));
|
||||
ImGui::PushStyleColor(ImGuiCol_FrameBgHovered, success_hover);
|
||||
ImGui::PushStyleColor(ImGuiCol_CheckMark, success_check);
|
||||
}
|
||||
else
|
||||
{
|
||||
ImGui::PushStyleColor(ImGuiCol_FrameBg, ImVec4(0.4f, 0.2f, 0.2f, 0.5f));
|
||||
ImGui::PushStyleColor(ImGuiCol_FrameBgHovered, ImVec4(0.5f, 0.3f, 0.3f, 0.6f));
|
||||
ImGui::PushStyleColor(ImGuiCol_CheckMark, ImVec4(0.9f, 0.4f, 0.4f, 1.0f));
|
||||
ImVec4 error_color = palette_utils::get_color(m_current_palette, "error", "accent");
|
||||
ImVec4 error_hover = ImVec4(error_color.x * 1.2f, error_color.y * 1.2f, error_color.z * 1.2f, 0.6f);
|
||||
ImVec4 error_check = ImVec4(error_color.x * 1.5f, error_color.y * 1.5f, error_color.z * 1.5f, 1.0f);
|
||||
ImGui::PushStyleColor(ImGuiCol_FrameBg, ImVec4(error_color.x, error_color.y, error_color.z, 0.5f));
|
||||
ImGui::PushStyleColor(ImGuiCol_FrameBgHovered, error_hover);
|
||||
ImGui::PushStyleColor(ImGuiCol_CheckMark, error_check);
|
||||
}
|
||||
|
||||
enabled_changed = ImGui::Checkbox("Enabled", &m_enabled);
|
||||
@@ -518,7 +483,7 @@ void template_editor::render_controls()
|
||||
ImGui::AlignTextToFramePadding();
|
||||
ImGui::Text("Input:");
|
||||
ImGui::SameLine(80);
|
||||
ImGui::SetNextItemWidth(-FLT_MIN);
|
||||
ImGui::SetNextItemWidth(-120.0f);
|
||||
char input_path_buf[512] = {0};
|
||||
snprintf(input_path_buf, sizeof(input_path_buf), "%s", m_input_path.c_str());
|
||||
if (ImGui::InputTextWithHint("##input_path", "Path to template file...",
|
||||
@@ -534,13 +499,25 @@ void template_editor::render_controls()
|
||||
m_template_controller.set_template_input_path(m_template_name, m_input_path);
|
||||
}
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button("Browse##input"))
|
||||
{
|
||||
std::string selected_path = file_dialogs::open_file_dialog("Select Template File", m_input_path);
|
||||
if (!selected_path.empty()) {
|
||||
m_input_path = selected_path;
|
||||
if (m_is_editing_existing) {
|
||||
m_template_controller.set_template_input_path(m_template_name, m_input_path);
|
||||
}
|
||||
m_validation_error = "";
|
||||
}
|
||||
}
|
||||
if (ImGui::IsItemHovered())
|
||||
ImGui::SetTooltip("Path where the template source file is stored");
|
||||
|
||||
ImGui::AlignTextToFramePadding();
|
||||
ImGui::Text("Output:");
|
||||
ImGui::SameLine(80);
|
||||
ImGui::SetNextItemWidth(-FLT_MIN);
|
||||
ImGui::SetNextItemWidth(-120.0f);
|
||||
char path_buf[512] = {0};
|
||||
snprintf(path_buf, sizeof(path_buf), "%s", m_output_path.c_str());
|
||||
if (ImGui::InputTextWithHint("##output_path", "Path for generated config...",
|
||||
@@ -556,6 +533,18 @@ void template_editor::render_controls()
|
||||
m_template_controller.set_template_output_path(m_template_name, m_output_path);
|
||||
}
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button("Browse##output"))
|
||||
{
|
||||
std::string selected_path = file_dialogs::save_file_dialog("Select Output File", m_output_path);
|
||||
if (!selected_path.empty()) {
|
||||
m_output_path = selected_path;
|
||||
if (m_is_editing_existing) {
|
||||
m_template_controller.set_template_output_path(m_template_name, m_output_path);
|
||||
}
|
||||
m_validation_error = "";
|
||||
}
|
||||
}
|
||||
if (ImGui::IsItemHovered())
|
||||
ImGui::SetTooltip("Path where the processed config will be written");
|
||||
|
||||
@@ -722,8 +711,10 @@ void template_editor::render_template_list()
|
||||
|
||||
if (!m_is_editing_existing)
|
||||
{
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(0.4f, 0.9f, 0.4f, 1.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_Header, ImVec4(0.2f, 0.5f, 0.2f, 0.5f));
|
||||
ImVec4 success_color = palette_utils::get_color(m_current_palette, "success", "accent");
|
||||
ImVec4 success_bg = ImVec4(success_color.x, success_color.y, success_color.z, 0.5f);
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, success_color);
|
||||
ImGui::PushStyleColor(ImGuiCol_Header, success_bg);
|
||||
ImGui::Selectable("+ New Template", true);
|
||||
ImGui::PopStyleColor(2);
|
||||
ImGui::Separator();
|
||||
|
||||
@@ -60,6 +60,8 @@ private:
|
||||
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
|
||||
Reference in New Issue
Block a user