diff --git a/src/loader.cpp b/src/loader.cpp index 85fbefe..2e6f60c 100644 --- a/src/loader.cpp +++ b/src/loader.cpp @@ -237,7 +237,7 @@ namespace anm2ed logger.info("Initialized Dear ImGui"); - imgui::theme_set((theme::Type)settings.theme); + imgui::theme_set((imgui::theme::Type)settings.theme); ImGui_ImplSDL3_InitForOpenGL(window, glContext); ImGui_ImplOpenGL3_Init("#version 330"); diff --git a/src/settings.hpp b/src/settings.hpp index 0535fe8..b5a67f7 100644 --- a/src/settings.hpp +++ b/src/settings.hpp @@ -52,7 +52,7 @@ namespace anm2ed X(WINDOW_POSITION, windowPosition, STRING_UNDEFINED, IVEC2, glm::ivec2()) \ X(IS_VSYNC, isVsync, STRING_UNDEFINED, BOOL, true) \ X(UI_SCALE, uiScale, STRING_UNDEFINED, FLOAT, 1.0f) \ - X(THEME, theme, STRING_UNDEFINED, INT, types::theme::DARK) \ + X(THEME, theme, STRING_UNDEFINED, INT, imgui::theme::DARK) \ X(LANGUAGE, language, STRING_UNDEFINED, INT, ENGLISH) \ \ X(FILE_IS_AUTOSAVE, fileIsAutosave, STRING_UNDEFINED, BOOL, true) \ diff --git a/src/util/imgui/layout.hpp b/src/util/imgui/layout.hpp index 2eabc3a..6eecf2d 100644 --- a/src/util/imgui/layout.hpp +++ b/src/util/imgui/layout.hpp @@ -5,7 +5,7 @@ #include #include -namespace anm2ed::types +namespace anm2ed::imgui { constexpr ImVec2 to_imvec2(const glm::vec2& v) noexcept { return {v.x, v.y}; } constexpr glm::vec2 to_vec2(const ImVec2& v) noexcept { return {v.x, v.y}; } @@ -24,10 +24,7 @@ namespace anm2ed::types static T value{-1}; return value; } -} -namespace anm2ed::imgui -{ float row_widget_width_get(int, float = ImGui::GetContentRegionAvail().x); ImVec2 widget_size_with_row_get(int, float = ImGui::GetContentRegionAvail().x); float footer_height_get(int = 1); diff --git a/src/util/imgui/popup.cpp b/src/util/imgui/popup.cpp index 2817089..6ff132b 100644 --- a/src/util/imgui/popup.cpp +++ b/src/util/imgui/popup.cpp @@ -66,9 +66,9 @@ namespace anm2ed::imgui switch (position) { case POPUP_CENTER: - ImGui::SetNextWindowPos(viewport->GetCenter(), ImGuiCond_None, types::to_imvec2(glm::vec2(0.5f))); + ImGui::SetNextWindowPos(viewport->GetCenter(), ImGuiCond_None, to_imvec2(glm::vec2(0.5f))); if (POPUP_IS_HEIGHT_SET[type]) - ImGui::SetNextWindowSize(types::to_imvec2(types::to_vec2(viewport->Size) * POPUP_MULTIPLIERS[type])); + ImGui::SetNextWindowSize(to_imvec2(to_vec2(viewport->Size) * POPUP_MULTIPLIERS[type])); else ImGui::SetNextWindowSize(ImVec2(viewport->Size.x * POPUP_MULTIPLIERS[type], 0)); break; diff --git a/src/util/imgui/theme.cpp b/src/util/imgui/theme.cpp index a2055e3..860fa2f 100644 --- a/src/util/imgui/theme.cpp +++ b/src/util/imgui/theme.cpp @@ -19,25 +19,25 @@ namespace anm2ed::imgui constexpr ImVec4 COLOR_LIGHT_CHECK_MARK{0.0f, 0.0f, 0.0f, 1.0f}; constexpr auto FRAME_BORDER_SIZE = 1.0f; - void theme_set(types::theme::Type theme) + void theme_set(theme::Type theme) { switch (theme) { - case types::theme::LIGHT: + case theme::LIGHT: ImGui::StyleColorsLight(); break; - case types::theme::DARK: + case theme::DARK: default: ImGui::StyleColorsDark(); break; - case types::theme::CLASSIC: + case theme::CLASSIC: ImGui::StyleColorsClassic(); break; } auto& style = ImGui::GetStyle(); style.FrameBorderSize = FRAME_BORDER_SIZE; - if (theme == types::theme::LIGHT) + if (theme == theme::LIGHT) { auto& colors = style.Colors; colors[ImGuiCol_Button] = COLOR_LIGHT_BUTTON; diff --git a/src/util/imgui/theme.hpp b/src/util/imgui/theme.hpp index a8f1318..3c505a4 100644 --- a/src/util/imgui/theme.hpp +++ b/src/util/imgui/theme.hpp @@ -2,7 +2,7 @@ #include "strings.hpp" -namespace anm2ed::types::theme +namespace anm2ed::imgui::theme { #define THEMES \ X(LIGHT, LABEL_THEME_LIGHT) \ @@ -28,5 +28,5 @@ namespace anm2ed::types::theme namespace anm2ed::imgui { - void theme_set(types::theme::Type); + void theme_set(theme::Type); }