From 8fe90c4c505bb9facd9886d044a1bf38281eb3f9 Mon Sep 17 00:00:00 2001 From: scawful Date: Sat, 27 Sep 2025 10:55:57 -0400 Subject: [PATCH] Refactor color structure and remove theme management from style files - Rearranged the Color struct to place the blue component after green for consistency. - Removed the Theme struct and its associated functions from style.h and style.cc, streamlining the codebase and focusing on color management. --- src/app/gui/color.h | 2 +- src/app/gui/style.cc | 25 ------------------------- src/app/gui/style.h | 29 ----------------------------- 3 files changed, 1 insertion(+), 55 deletions(-) diff --git a/src/app/gui/color.h b/src/app/gui/color.h index 388e5898..c9d608a2 100644 --- a/src/app/gui/color.h +++ b/src/app/gui/color.h @@ -13,8 +13,8 @@ namespace gui { struct Color { float red; - float blue; float green; + float blue; float alpha; }; diff --git a/src/app/gui/style.cc b/src/app/gui/style.cc index 50a17cb1..c724fe19 100644 --- a/src/app/gui/style.cc +++ b/src/app/gui/style.cc @@ -29,31 +29,6 @@ Color ParseColor(const std::string &color) { } } // namespace -void ApplyTheme(const Theme &theme) { - ImGuiStyle *style = &ImGui::GetStyle(); - ImVec4 *colors = style->Colors; - - colors[ImGuiCol_MenuBarBg] = gui::ConvertColorToImVec4(theme.menu_bar_bg); - colors[ImGuiCol_TitleBg] = gui::ConvertColorToImVec4(theme.title_bar_bg); - colors[ImGuiCol_Header] = gui::ConvertColorToImVec4(theme.header); - colors[ImGuiCol_HeaderHovered] = - gui::ConvertColorToImVec4(theme.header_hovered); - colors[ImGuiCol_HeaderActive] = - gui::ConvertColorToImVec4(theme.header_active); - colors[ImGuiCol_TitleBgActive] = - gui::ConvertColorToImVec4(theme.title_bg_active); - colors[ImGuiCol_TitleBgCollapsed] = - gui::ConvertColorToImVec4(theme.title_bg_collapsed); - colors[ImGuiCol_Tab] = gui::ConvertColorToImVec4(theme.tab); - colors[ImGuiCol_TabHovered] = gui::ConvertColorToImVec4(theme.tab_hovered); - colors[ImGuiCol_TabActive] = gui::ConvertColorToImVec4(theme.tab_active); - colors[ImGuiCol_Button] = gui::ConvertColorToImVec4(theme.button); - colors[ImGuiCol_ButtonHovered] = - gui::ConvertColorToImVec4(theme.button_hovered); - colors[ImGuiCol_ButtonActive] = - gui::ConvertColorToImVec4(theme.button_active); -} - void ColorsYaze() { ImGuiStyle *style = &ImGui::GetStyle(); ImVec4 *colors = style->Colors; diff --git a/src/app/gui/style.h b/src/app/gui/style.h index b8a4b62f..f50caf91 100644 --- a/src/app/gui/style.h +++ b/src/app/gui/style.h @@ -14,35 +14,6 @@ namespace yaze { namespace gui { -struct Theme { - std::string name; - - Color menu_bar_bg; - Color title_bar_bg; - - Color header; - Color header_hovered; - Color header_active; - - Color title_bg_active; - Color title_bg_collapsed; - - Color tab; - Color tab_hovered; - Color tab_active; - - Color button; - Color button_hovered; - Color button_active; - - Color clickable_text; - Color clickable_text_hovered; -}; - -absl::StatusOr LoadTheme(const std::string &filename); -absl::Status SaveTheme(const Theme &theme); -void ApplyTheme(const Theme &theme); - void ColorsYaze(); TextEditor::LanguageDefinition GetAssemblyLanguageDef();