From 3c433e5fd524f8973b9f062855a8c166828dea2d Mon Sep 17 00:00:00 2001 From: scawful Date: Tue, 13 Aug 2024 01:09:18 -0400 Subject: [PATCH] gui housekeeping --- src/app/gui/color.cc | 6 +++--- src/app/gui/color.h | 2 +- src/app/gui/style.cc | 10 ++-------- src/app/gui/style.h | 3 --- 4 files changed, 6 insertions(+), 15 deletions(-) diff --git a/src/app/gui/color.cc b/src/app/gui/color.cc index 55541bed..28260b16 100644 --- a/src/app/gui/color.cc +++ b/src/app/gui/color.cc @@ -13,7 +13,7 @@ namespace yaze { namespace app { namespace gui { -ImVec4 ConvertSNESColorToImVec4(const SnesColor& color) { +ImVec4 ConvertSnesColorToImVec4(const SnesColor& color) { return ImVec4(static_cast(color.rgb().x) / 255.0f, static_cast(color.rgb().y) / 255.0f, static_cast(color.rgb().z) / 255.0f, @@ -26,7 +26,7 @@ IMGUI_API bool SnesColorButton(absl::string_view id, SnesColor& color, ImGuiColorEditFlags flags, const ImVec2& size_arg) { // Convert the SNES color values to ImGui color values - ImVec4 displayColor = ConvertSNESColorToImVec4(color); + ImVec4 displayColor = ConvertSnesColorToImVec4(color); // Call the original ImGui::ColorButton with the converted color bool pressed = ImGui::ColorButton(id.data(), displayColor, flags, size_arg); @@ -41,7 +41,7 @@ IMGUI_API bool SnesColorButton(absl::string_view id, SnesColor& color, IMGUI_API bool SnesColorEdit4(absl::string_view label, SnesColor* color, ImGuiColorEditFlags flags) { - ImVec4 displayColor = ConvertSNESColorToImVec4(*color); + ImVec4 displayColor = ConvertSnesColorToImVec4(*color); // Call the original ImGui::ColorEdit4 with the converted color bool pressed = diff --git a/src/app/gui/color.h b/src/app/gui/color.h index 6e05a008..8d5134de 100644 --- a/src/app/gui/color.h +++ b/src/app/gui/color.h @@ -18,7 +18,7 @@ using gfx::SnesColor; // A utility function to convert an SnesColor object to an ImVec4 with // normalized color values -ImVec4 ConvertSNESColorToImVec4(const SnesColor& color); +ImVec4 ConvertSnesColorToImVec4(const SnesColor& color); // The wrapper function for ImGui::ColorButton that takes a SnesColor reference IMGUI_API bool SnesColorButton(absl::string_view id, SnesColor& color, diff --git a/src/app/gui/style.cc b/src/app/gui/style.cc index c9639717..f663fdfe 100644 --- a/src/app/gui/style.cc +++ b/src/app/gui/style.cc @@ -7,6 +7,7 @@ namespace yaze { namespace app { namespace gui { +// TODO: Add more display settings to popup windows. void BeginWindowWithDisplaySettings(const char* id, bool* active, const ImVec2& size, ImGuiWindowFlags flags) { @@ -418,6 +419,7 @@ void TextWithSeparators(const absl::string_view& text) { ImGui::Separator(); } +// TODO: Make the ColorsYaze style into a configuration file. void ColorsYaze() { ImGuiStyle* style = &ImGui::GetStyle(); ImVec4* colors = style->Colors; @@ -517,14 +519,6 @@ void ColorsYaze() { colors[ImGuiCol_ModalWindowDimBg] = ImVec4(0.20f, 0.20f, 0.20f, 0.35f); } -void RenderTabItem(const std::string& title, - const std::function& render_func) { - if (ImGui::BeginTabItem(title.c_str())) { - render_func(); - ImGui::EndTabItem(); - } -} - // ============================================================================ // 65816 LanguageDefinition // ============================================================================ diff --git a/src/app/gui/style.h b/src/app/gui/style.h index 0fed9c1a..336594b9 100644 --- a/src/app/gui/style.h +++ b/src/app/gui/style.h @@ -41,9 +41,6 @@ void ColorsYaze(); TextEditor::LanguageDefinition GetAssemblyLanguageDef(); -void RenderTabItem(const std::string& title, - const std::function& render_func); - class BitmapViewer { public: BitmapViewer() : current_bitmap_index_(0) {}