From 3a9856660dcf04d7ef0589df288b5d47c78c937e Mon Sep 17 00:00:00 2001 From: Stenzek Date: Fri, 12 Jun 2026 17:43:56 +1000 Subject: [PATCH] FullscreenUI: Fix input text text colour in light theme --- src/core/fullscreenui_game_list.cpp | 3 +++ src/core/fullscreenui_widgets.cpp | 19 +++++++++---------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/core/fullscreenui_game_list.cpp b/src/core/fullscreenui_game_list.cpp index 8f1d60a14..91db1aa3e 100644 --- a/src/core/fullscreenui_game_list.cpp +++ b/src/core/fullscreenui_game_list.cpp @@ -323,6 +323,8 @@ void FullscreenUI::DrawGameListWindow() ImGui::SetCursorPos( ImFloor(ImVec2((ImGui::GetWindowWidth() - search_width) * 0.5f, (ImGui::GetWindowHeight() - search_font_size - (style.FramePadding.y * 2.0f)) * 0.5f))); + ImGui::PushStyleColor(ImGuiCol_Button, DarkerColor(UIStyle.PrimaryColor, 1.2f)); + ImGui::PushStyleColor(ImGuiCol_ButtonHovered, DarkerColor(UIStyle.PrimaryColor, 1.4f)); const ImGuiInputTextFlags extra_flags = (ImGui::IsKeyPressed(ImGuiKey_NavGamepadMenu, false) || ImGui::IsKeyPressed(ImGuiKey_F3, false)) ? @@ -338,6 +340,7 @@ void FullscreenUI::DrawGameListWindow() ForceKeyNavEnabled(); } + ImGui::PopStyleColor(2); ImGui::SetCursorPos(prev_cursor_pos); RightAlignNavButtons(count); diff --git a/src/core/fullscreenui_widgets.cpp b/src/core/fullscreenui_widgets.cpp index 6c6c6e9bf..7a9a83ca1 100644 --- a/src/core/fullscreenui_widgets.cpp +++ b/src/core/fullscreenui_widgets.cpp @@ -1951,6 +1951,7 @@ void FullscreenUI::CancelPendingMenuClose() void FullscreenUI::PushPrimaryColor() { ImGui::PushStyleColor(ImGuiCol_Text, UIStyle.PrimaryTextColor); + ImGui::PushStyleColor(ImGuiCol_TextDisabled, DarkerColor(UIStyle.PrimaryTextColor, 0.6f)); ImGui::PushStyleColor(ImGuiCol_Button, UIStyle.PrimaryDarkColor); ImGui::PushStyleColor(ImGuiCol_ButtonActive, DarkerColor(UIStyle.PrimaryLightColor, 1.2f)); ImGui::PushStyleColor(ImGuiCol_ButtonHovered, UIStyle.PrimaryLightColor); @@ -1959,7 +1960,7 @@ void FullscreenUI::PushPrimaryColor() void FullscreenUI::PopPrimaryColor() { - ImGui::PopStyleColor(5); + ImGui::PopStyleColor(6); } void FullscreenUI::DrawRoundedGradientRect(ImDrawList* const dl, const ImVec2& pos_min, const ImVec2& pos_max, @@ -4569,11 +4570,12 @@ bool FullscreenUI::InputTextWithIcon(const char* str_id, std::string_view icon, const ImVec2 box_min = ImGui::GetCursorScreenPos(); const ImVec2 box_max = box_min + ImVec2(width, font_size + style.FramePadding.y * 2.0f); - const float box_rounding = ImCeil(font_size * 0.75f); ImGuiWindow* const win = ImGui::GetCurrentWindow(); ImDrawList* const dl = win->DrawList; - dl->AddRectFilled(box_min, box_max, ImGui::GetColorU32(DarkerColor(UIStyle.PrimaryColor, 1.2f)), box_rounding); + const bool is_active = (GImGui->NavId == win->GetID(str_id)); + const u32 color = ImGui::GetColorU32(style.Colors[is_active ? ImGuiCol_ButtonHovered : ImGuiCol_Button]); + DrawMenuButtonFrameAtOnCurrentLayer(box_min, box_max, color, is_active); dl->AddText(UIStyle.Font, font_size, font_weight, box_min + style.FramePadding, ImGui::GetColorU32(ImGuiCol_Text), IMSTR_START_END(icon)); @@ -4586,16 +4588,12 @@ bool FullscreenUI::InputTextWithIcon(const char* str_id, std::string_view icon, ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0.0f, style.FramePadding.y)); ImGui::PushStyleColor(ImGuiCol_FrameBg, ImVec4(0.0f, 0.0f, 0.0f, 0.0f)); ImGui::PushStyleColor(ImGuiCol_NavCursor, ImVec4(0.0f, 0.0f, 0.0f, 0.0f)); - ImGui::PushStyleColor(ImGuiCol_Text, UIStyle.PrimaryTextColor); ImGui::PushFont(UIStyle.Font, font_size, font_weight); const bool result = ImGui::InputTextWithHint(str_id, hint, buf, buf_size, flags, callback, user_data); - if (ImGui::IsItemFocused()) - dl->AddRect(box_min, box_max, ImGui::GetColorU32(ImGuiCol_Border), box_rounding, 0, LayoutScale(1.0f)); - ImGui::PopFont(); - ImGui::PopStyleColor(3); + ImGui::PopStyleColor(2); ImGui::PopStyleVar(3); return result; @@ -4733,6 +4731,7 @@ bool FullscreenUI::PopupDialog::BeginRender(float scaled_window_padding /* = Lay LayoutScale(LAYOUT_MENU_BUTTON_X_PADDING, LAYOUT_MENU_BUTTON_Y_PADDING)); ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 0.0f); ImGui::PushStyleColor(ImGuiCol_PopupBg, ModAlpha(UIStyle.PopupBackgroundColor, 1.0f)); + ImGui::PushStyleColor(ImGuiCol_Button, DarkerColor(UIStyle.PopupBackgroundColor, 1.2f)); ImGui::PushStyleColor(ImGuiCol_ButtonActive, DarkerColor(UIStyle.PopupHighlight, 1.2f)); ImGui::PushStyleColor(ImGuiCol_ButtonHovered, UIStyle.PopupHighlight); ImGui::PushStyleColor(ImGuiCol_FrameBg, UIStyle.PopupFrameBackgroundColor); @@ -4771,7 +4770,7 @@ bool FullscreenUI::PopupDialog::BeginRender(float scaled_window_padding /* = Lay ImGui::EndPopup(); } - ImGui::PopStyleColor(7); + ImGui::PopStyleColor(8); ImGui::PopStyleVar(6); ImGui::PopFont(); QueueResetFocus(FocusResetType::PopupClosed); @@ -4793,7 +4792,7 @@ bool FullscreenUI::PopupDialog::BeginRender(float scaled_window_padding /* = Lay void FullscreenUI::PopupDialog::EndRender() { ImGui::EndPopup(); - ImGui::PopStyleColor(7); + ImGui::PopStyleColor(8); ImGui::PopStyleVar(6); ImGui::PopFont(); }