summaryrefslogtreecommitdiff
path: root/src/ui/imgui_extensions.cpp
diff options
context:
space:
mode:
authorAldrik Ramaekers <aldrik@mailbox.org>2026-01-11 12:28:43 +0100
committerAldrik Ramaekers <aldrik@mailbox.org>2026-01-11 12:28:43 +0100
commitccbc6a8f0836583fabd59919bd7930d7cfe1473e (patch)
tree9b40413d853ff9cce52b6d697314b6bc4ea015e4 /src/ui/imgui_extensions.cpp
parent6166eeda08fd1d4106afe47416a73de60700d17e (diff)
ui improvements
Diffstat (limited to 'src/ui/imgui_extensions.cpp')
-rw-r--r--src/ui/imgui_extensions.cpp31
1 files changed, 19 insertions, 12 deletions
diff --git a/src/ui/imgui_extensions.cpp b/src/ui/imgui_extensions.cpp
index 03d4a44..2c13546 100644
--- a/src/ui/imgui_extensions.cpp
+++ b/src/ui/imgui_extensions.cpp
@@ -36,6 +36,14 @@ namespace ui {
namespace ImGui
{
+ void LoadingIndicatorCircleSmall()
+ {
+ float radius = 10.0f;
+ const ImVec4 col = ImGui::GetStyleColorVec4(ImGuiCol_LoadingIndicatorFg);
+ const ImVec4 bg = ImGui::GetStyleColorVec4(ImGuiCol_LoadingIndicatorBg);
+ ImGui::LoadingIndicatorCircle(radius, bg, col, 6, 4.0f);
+ }
+
bool CheckboxX(const char* label, bool* v, bool disabled, bool show_loading_indicator_while_disabled)
{
bool result = false;
@@ -56,10 +64,7 @@ namespace ImGui
ImVec2 center = ImVec2((p_min.x + p_max.x) * 0.5f - radius, (p_min.y + p_max.y) * 0.5f - radius);
ImGui::SetCursorScreenPos(ImVec2(center.x, center.y));
-
- const ImVec4 col = ImGui::GetStyleColorVec4(ImGuiCol_ButtonHovered);
- const ImVec4 bg = ImGui::GetStyleColorVec4(ImGuiCol_Button);
- ImGui::LoadingIndicatorCircle(radius, bg, col, 6, 4.0f);
+ ImGui::LoadingIndicatorCircleSmall();
}
if (disabled) ImGui::EndDisabled();
@@ -117,10 +122,7 @@ namespace ImGui
ImVec2 center = ImVec2((p_min.x + p_max.x) * 0.5f - radius, (p_min.y + p_max.y) * 0.5f - radius);
ImGui::SetCursorScreenPos(ImVec2(center.x, center.y));
-
- const ImVec4 col = ImGui::GetStyleColorVec4(ImGuiCol_ButtonHovered);
- const ImVec4 bg = ImGui::GetStyleColorVec4(ImGuiCol_Button);
- ImGui::LoadingIndicatorCircle(radius, bg, col, 6, 4.0f);
+ ImGui::LoadingIndicatorCircleSmall();
ImGui::EndDisabled();
ImGui::SetCursorScreenPos(oldPos);
@@ -897,7 +899,6 @@ namespace ImGui
ImVec4* colors = style->Colors;
- //colors[ImGuiCol_Border] = ColorConvertU32ToFloat4(IM_COL32(210, 210, 210, 255));
colors[ImGuiCol_Text] = ColorConvertU32ToFloat4(ImGui::Spectrum::GRAY800); // text on hovered controls is gray900
colors[ImGuiCol_TextDisabled] = ColorConvertU32ToFloat4(ImGui::Spectrum::GRAY500);
colors[ImGuiCol_WindowBg] = ColorConvertU32ToFloat4(IM_COL32(239, 240, 241, 255));
@@ -922,21 +923,27 @@ namespace ImGui
colors[ImGuiCol_Button] = ColorConvertU32ToFloat4(ImGui::Spectrum::GRAY75); // match default button to Spectrum's 'Action Button'.
colors[ImGuiCol_ButtonHovered] = ColorConvertU32ToFloat4(ImGui::Spectrum::GRAY50);
colors[ImGuiCol_ButtonActive] = ColorConvertU32ToFloat4(ImGui::Spectrum::GRAY200);
+
+ // Loading indicators
+ colors[ImGuiCol_LoadingIndicatorBg] = ColorConvertU32ToFloat4(ImGui::Spectrum::BLUE700);
+ colors[ImGuiCol_LoadingIndicatorFg] = ColorConvertU32ToFloat4(ImGui::Spectrum::BLUE700);
+ // Tables
colors[ImGuiCol_TableHeaderBg] = ColorConvertU32ToFloat4(ImGui::Spectrum::GRAY300);
colors[ImGuiCol_Header] = ColorConvertU32ToFloat4(ImGui::Spectrum::GRAY300);
colors[ImGuiCol_HeaderHovered] = ImVec4(0.78f, 0.87f, 0.98f, 0.5f);
colors[ImGuiCol_HeaderActive] = colors[ImGuiCol_TableHeaderBg];
-
colors[ImGuiCol_TableRowBg] = ColorConvertU32ToFloat4(ImGui::Spectrum::GRAY100);
colors[ImGuiCol_TableRowBgAlt] = ImVec4(1.0f, 1.0f, 1.0f, 1.0f);
-
- colors[ImGuiCol_Separator] = colors[ImGuiCol_Border];
+ colors[ImGuiCol_OrderItemTableRowFinal] = ColorConvertU32ToFloat4(ImGui::Spectrum::GRAY200);
+ colors[ImGuiCol_OrderItemTableRowCurrency] = ColorConvertU32ToFloat4(ImGui::Spectrum::GRAY300);
colors[ImGuiCol_SeparatorHovered] = colors[ImGuiCol_Border];
colors[ImGuiCol_SeparatorActive] = colors[ImGuiCol_Border];
colors[ImGuiCol_TableBorderStrong] = colors[ImGuiCol_Border];
colors[ImGuiCol_TableBorderLight] = colors[ImGuiCol_Border];
+
+ colors[ImGuiCol_Separator] = colors[ImGuiCol_Border];
colors[ImGuiCol_ResizeGrip] = ColorConvertU32ToFloat4(ImGui::Spectrum::GRAY400);
colors[ImGuiCol_ResizeGripHovered] = ColorConvertU32ToFloat4(ImGui::Spectrum::GRAY600);