Skip to content

Commit

Permalink
ImGuiFullscreen: Use popup background for all popups
Browse files Browse the repository at this point in the history
  • Loading branch information
stenzek committed Apr 13, 2024
1 parent 2157a7e commit 5219f52
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
3 changes: 2 additions & 1 deletion pcsx2/ImGui/FullscreenUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ using ImGuiFullscreen::UIBackgroundColor;
using ImGuiFullscreen::UIBackgroundHighlightColor;
using ImGuiFullscreen::UIBackgroundLineColor;
using ImGuiFullscreen::UIBackgroundTextColor;
using ImGuiFullscreen::UIPopupBackgroundColor;
using ImGuiFullscreen::UIDisabledColor;
using ImGuiFullscreen::UIPrimaryColor;
using ImGuiFullscreen::UIPrimaryDarkColor;
Expand Down Expand Up @@ -5329,7 +5330,7 @@ void FullscreenUI::DrawSaveStateSelector(bool is_loading)
ImGui::PushStyleColor(ImGuiCol_Text, UIPrimaryTextColor);
ImGui::PushStyleColor(ImGuiCol_TitleBg, UIPrimaryDarkColor);
ImGui::PushStyleColor(ImGuiCol_TitleBgActive, UIPrimaryColor);
ImGui::PushStyleColor(ImGuiCol_PopupBg, MulAlpha(UIBackgroundColor, 0.95f));
ImGui::PushStyleColor(ImGuiCol_PopupBg, UIPopupBackgroundColor);

const float width = LayoutScale(600.0f);
const float title_height =
Expand Down
17 changes: 8 additions & 9 deletions pcsx2/ImGui/ImGuiFullscreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ namespace ImGuiFullscreen
ImVec4 UIBackgroundTextColor;
ImVec4 UIBackgroundLineColor;
ImVec4 UIBackgroundHighlightColor;
ImVec4 UIPopupBackgroundColor;
ImVec4 UIDisabledColor;
ImVec4 UIPrimaryColor;
ImVec4 UIPrimaryLightColor;
Expand Down Expand Up @@ -541,7 +542,7 @@ void ImGuiFullscreen::PushResetLayout()
ImGui::PushStyleColor(ImGuiCol_ScrollbarGrab, UIPrimaryColor);
ImGui::PushStyleColor(ImGuiCol_ScrollbarGrabHovered, UIPrimaryLightColor);
ImGui::PushStyleColor(ImGuiCol_ScrollbarGrabActive, UIPrimaryDarkColor);
ImGui::PushStyleColor(ImGuiCol_PopupBg, ModAlpha(UIBackgroundColor, 0.95f));
ImGui::PushStyleColor(ImGuiCol_PopupBg, UIPopupBackgroundColor);
}

void ImGuiFullscreen::PopResetLayout()
Expand Down Expand Up @@ -2089,7 +2090,6 @@ void ImGuiFullscreen::DrawFileSelector()
ImGui::PushStyleColor(ImGuiCol_Text, UIPrimaryTextColor);
ImGui::PushStyleColor(ImGuiCol_TitleBg, UIPrimaryDarkColor);
ImGui::PushStyleColor(ImGuiCol_TitleBgActive, UIPrimaryColor);
ImGui::PushStyleColor(ImGuiCol_PopupBg, MulAlpha(UIBackgroundColor, 0.95f));

bool is_open = !WantsToCloseMenu();
bool directory_selected = false;
Expand Down Expand Up @@ -2130,7 +2130,7 @@ void ImGuiFullscreen::DrawFileSelector()
is_open = false;
}

ImGui::PopStyleColor(4);
ImGui::PopStyleColor(3);
ImGui::PopStyleVar(3);
ImGui::PopFont();

Expand Down Expand Up @@ -2216,7 +2216,6 @@ void ImGuiFullscreen::DrawChoiceDialog()
ImGui::PushStyleColor(ImGuiCol_Text, UIPrimaryTextColor);
ImGui::PushStyleColor(ImGuiCol_TitleBg, UIPrimaryDarkColor);
ImGui::PushStyleColor(ImGuiCol_TitleBgActive, UIPrimaryColor);
ImGui::PushStyleColor(ImGuiCol_PopupBg, MulAlpha(UIBackgroundColor, 0.95f));

const float width = LayoutScale(600.0f);
const float title_height = g_large_font->FontSize + ImGui::GetStyle().FramePadding.y * 2.0f + ImGui::GetStyle().WindowPadding.y * 2.0f;
Expand Down Expand Up @@ -2283,7 +2282,7 @@ void ImGuiFullscreen::DrawChoiceDialog()
is_open = false;
}

ImGui::PopStyleColor(4);
ImGui::PopStyleColor(3);
ImGui::PopStyleVar(3);
ImGui::PopFont();

Expand Down Expand Up @@ -2339,7 +2338,6 @@ void ImGuiFullscreen::DrawInputDialog()
ImGui::PushStyleColor(ImGuiCol_Text, UIPrimaryTextColor);
ImGui::PushStyleColor(ImGuiCol_TitleBg, UIPrimaryDarkColor);
ImGui::PushStyleColor(ImGuiCol_TitleBgActive, UIPrimaryColor);
ImGui::PushStyleColor(ImGuiCol_PopupBg, MulAlpha(UIBackgroundColor, 0.95f));

bool is_open = true;
if (ImGui::BeginPopupModal(s_input_dialog_title.c_str(), &is_open,
Expand Down Expand Up @@ -2394,7 +2392,7 @@ void ImGuiFullscreen::DrawInputDialog()
else
GetInputDialogHelpText(s_fullscreen_footer_text);

ImGui::PopStyleColor(4);
ImGui::PopStyleColor(3);
ImGui::PopStyleVar(3);
ImGui::PopFont();
}
Expand Down Expand Up @@ -2492,7 +2490,6 @@ void ImGuiFullscreen::DrawMessageDialog()
ImGui::PushStyleColor(ImGuiCol_Text, UIPrimaryTextColor);
ImGui::PushStyleColor(ImGuiCol_TitleBg, UIPrimaryDarkColor);
ImGui::PushStyleColor(ImGuiCol_TitleBgActive, UIPrimaryColor);
ImGui::PushStyleColor(ImGuiCol_PopupBg, MulAlpha(UIBackgroundColor, 0.95f));

bool is_open = true;
const u32 flags = ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove |
Expand Down Expand Up @@ -2521,7 +2518,7 @@ void ImGuiFullscreen::DrawMessageDialog()
ImGui::EndPopup();
}

ImGui::PopStyleColor(4);
ImGui::PopStyleColor(3);
ImGui::PopStyleVar(4);
ImGui::PopFont();

Expand Down Expand Up @@ -2950,6 +2947,7 @@ void ImGuiFullscreen::SetTheme(bool light)
UIBackgroundTextColor = HEX_TO_IMVEC4(0xffffff, 0xff);
UIBackgroundLineColor = HEX_TO_IMVEC4(0xf0f0f0, 0xff);
UIBackgroundHighlightColor = HEX_TO_IMVEC4(0x4b4b4b, 0xff);
UIPopupBackgroundColor = HEX_TO_IMVEC4(0x212121, 0xf2);
UIPrimaryColor = HEX_TO_IMVEC4(0x2e2e2e, 0xff);
UIPrimaryLightColor = HEX_TO_IMVEC4(0x484848, 0xff);
UIPrimaryDarkColor = HEX_TO_IMVEC4(0x000000, 0xff);
Expand All @@ -2969,6 +2967,7 @@ void ImGuiFullscreen::SetTheme(bool light)
UIBackgroundTextColor = HEX_TO_IMVEC4(0x000000, 0xff);
UIBackgroundLineColor = HEX_TO_IMVEC4(0xe1e2e1, 0xff);
UIBackgroundHighlightColor = HEX_TO_IMVEC4(0xe1e2e1, 0xff);
UIPopupBackgroundColor = HEX_TO_IMVEC4(0xd8d8d8, 0xf2);
UIPrimaryColor = HEX_TO_IMVEC4(0x2a3e78, 0xff);
UIPrimaryLightColor = HEX_TO_IMVEC4(0x235cd9, 0xff);
UIPrimaryDarkColor = HEX_TO_IMVEC4(0x1d2953, 0xff);
Expand Down
1 change: 1 addition & 0 deletions pcsx2/ImGui/ImGuiFullscreen.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ namespace ImGuiFullscreen
extern ImVec4 UIBackgroundTextColor;
extern ImVec4 UIBackgroundLineColor;
extern ImVec4 UIBackgroundHighlightColor;
extern ImVec4 UIPopupBackgroundColor;
extern ImVec4 UIDisabledColor;
extern ImVec4 UIPrimaryColor;
extern ImVec4 UIPrimaryLightColor;
Expand Down

0 comments on commit 5219f52

Please sign in to comment.