mirror of
https://github.com/stenzek/duckstation.git
synced 2025-06-07 12:05:52 +00:00
FullscreenUI: Fix popup title colours
This commit is contained in:
parent
be970bcfe4
commit
89d9842c7e
@ -97,6 +97,7 @@ using ImGuiFullscreen::BeginFullscreenWindow;
|
|||||||
using ImGuiFullscreen::BeginHorizontalMenu;
|
using ImGuiFullscreen::BeginHorizontalMenu;
|
||||||
using ImGuiFullscreen::BeginMenuButtons;
|
using ImGuiFullscreen::BeginMenuButtons;
|
||||||
using ImGuiFullscreen::BeginNavBar;
|
using ImGuiFullscreen::BeginNavBar;
|
||||||
|
using ImGuiFullscreen::BeginFixedPopupModal;
|
||||||
using ImGuiFullscreen::CancelPendingMenuClose;
|
using ImGuiFullscreen::CancelPendingMenuClose;
|
||||||
using ImGuiFullscreen::CenterImage;
|
using ImGuiFullscreen::CenterImage;
|
||||||
using ImGuiFullscreen::DefaultActiveButton;
|
using ImGuiFullscreen::DefaultActiveButton;
|
||||||
@ -107,6 +108,7 @@ using ImGuiFullscreen::EndFullscreenWindow;
|
|||||||
using ImGuiFullscreen::EndHorizontalMenu;
|
using ImGuiFullscreen::EndHorizontalMenu;
|
||||||
using ImGuiFullscreen::EndMenuButtons;
|
using ImGuiFullscreen::EndMenuButtons;
|
||||||
using ImGuiFullscreen::EndNavBar;
|
using ImGuiFullscreen::EndNavBar;
|
||||||
|
using ImGuiFullscreen::EndFixedPopupModal;
|
||||||
using ImGuiFullscreen::EnumChoiceButton;
|
using ImGuiFullscreen::EnumChoiceButton;
|
||||||
using ImGuiFullscreen::FloatingButton;
|
using ImGuiFullscreen::FloatingButton;
|
||||||
using ImGuiFullscreen::ForceKeyNavEnabled;
|
using ImGuiFullscreen::ForceKeyNavEnabled;
|
||||||
@ -2379,19 +2381,9 @@ void FullscreenUI::DrawInputBindingWindow()
|
|||||||
|
|
||||||
const char* title = FSUI_ICONSTR(ICON_FA_GAMEPAD, "Set Input Binding");
|
const char* title = FSUI_ICONSTR(ICON_FA_GAMEPAD, "Set Input Binding");
|
||||||
ImGui::SetNextWindowSize(LayoutScale(500.0f, 0.0f));
|
ImGui::SetNextWindowSize(LayoutScale(500.0f, 0.0f));
|
||||||
ImGui::SetNextWindowPos(ImGui::GetIO().DisplaySize * 0.5f, ImGuiCond_Always, ImVec2(0.5f, 0.5f));
|
|
||||||
ImGui::OpenPopup(title);
|
ImGui::OpenPopup(title);
|
||||||
|
|
||||||
ImGui::PushFont(UIStyle.LargeFont);
|
if (BeginFixedPopupModal(title))
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, LayoutScale(10.0f));
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, LayoutScale(ImGuiFullscreen::LAYOUT_MENU_BUTTON_X_PADDING,
|
|
||||||
ImGuiFullscreen::LAYOUT_MENU_BUTTON_Y_PADDING));
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 0.0f);
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, LayoutScale(20.0f, 20.0f));
|
|
||||||
|
|
||||||
if (ImGui::BeginPopupModal(title, nullptr,
|
|
||||||
ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoScrollWithMouse |
|
|
||||||
ImGuiWindowFlags_NoCollapse))
|
|
||||||
{
|
{
|
||||||
ImGui::TextWrapped("%s", SmallString::from_format(FSUI_FSTR("Setting {} binding {}."),
|
ImGui::TextWrapped("%s", SmallString::from_format(FSUI_FSTR("Setting {} binding {}."),
|
||||||
s_state.input_binding_section, s_state.input_binding_display_name)
|
s_state.input_binding_section, s_state.input_binding_display_name)
|
||||||
@ -2399,11 +2391,8 @@ void FullscreenUI::DrawInputBindingWindow()
|
|||||||
ImGui::TextUnformatted(FSUI_CSTR("Push a controller button or axis now."));
|
ImGui::TextUnformatted(FSUI_CSTR("Push a controller button or axis now."));
|
||||||
ImGui::NewLine();
|
ImGui::NewLine();
|
||||||
ImGui::TextUnformatted(SmallString::from_format(FSUI_FSTR("Timing out in {:.0f} seconds..."), time_remaining));
|
ImGui::TextUnformatted(SmallString::from_format(FSUI_FSTR("Timing out in {:.0f} seconds..."), time_remaining));
|
||||||
ImGui::EndPopup();
|
EndFixedPopupModal();
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::PopStyleVar(4);
|
|
||||||
ImGui::PopFont();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FullscreenUI::DrawToggleSetting(SettingsInterface* bsi, const char* title, const char* summary,
|
bool FullscreenUI::DrawToggleSetting(SettingsInterface* bsi, const char* title, const char* summary,
|
||||||
@ -2575,16 +2564,8 @@ void FullscreenUI::DrawIntRangeSetting(SettingsInterface* bsi, const char* title
|
|||||||
ImGui::SetNextWindowSize(LayoutScale(500.0f, 194.0f));
|
ImGui::SetNextWindowSize(LayoutScale(500.0f, 194.0f));
|
||||||
ImGui::SetNextWindowPos(ImGui::GetIO().DisplaySize * 0.5f, ImGuiCond_Always, ImVec2(0.5f, 0.5f));
|
ImGui::SetNextWindowPos(ImGui::GetIO().DisplaySize * 0.5f, ImGuiCond_Always, ImVec2(0.5f, 0.5f));
|
||||||
|
|
||||||
ImGui::PushFont(UIStyle.LargeFont);
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, LayoutScale(10.0f));
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, LayoutScale(ImGuiFullscreen::LAYOUT_MENU_BUTTON_X_PADDING,
|
|
||||||
ImGuiFullscreen::LAYOUT_MENU_BUTTON_Y_PADDING));
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 0.0f);
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, LayoutScale(20.0f, 20.0f));
|
|
||||||
|
|
||||||
bool is_open = true;
|
bool is_open = true;
|
||||||
if (ImGui::BeginPopupModal(title, &is_open,
|
if (BeginFixedPopupModal(title, &is_open))
|
||||||
ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove))
|
|
||||||
{
|
{
|
||||||
BeginMenuButtons();
|
BeginMenuButtons();
|
||||||
|
|
||||||
@ -2609,11 +2590,8 @@ void FullscreenUI::DrawIntRangeSetting(SettingsInterface* bsi, const char* title
|
|||||||
}
|
}
|
||||||
EndMenuButtons();
|
EndMenuButtons();
|
||||||
|
|
||||||
ImGui::EndPopup();
|
EndFixedPopupModal();
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::PopStyleVar(4);
|
|
||||||
ImGui::PopFont();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FullscreenUI::DrawFloatRangeSetting(SettingsInterface* bsi, const char* title, const char* summary,
|
void FullscreenUI::DrawFloatRangeSetting(SettingsInterface* bsi, const char* title, const char* summary,
|
||||||
@ -2631,18 +2609,9 @@ void FullscreenUI::DrawFloatRangeSetting(SettingsInterface* bsi, const char* tit
|
|||||||
ImGui::OpenPopup(title);
|
ImGui::OpenPopup(title);
|
||||||
|
|
||||||
ImGui::SetNextWindowSize(LayoutScale(500.0f, 194.0f));
|
ImGui::SetNextWindowSize(LayoutScale(500.0f, 194.0f));
|
||||||
ImGui::SetNextWindowPos(ImGui::GetIO().DisplaySize * 0.5f, ImGuiCond_Always, ImVec2(0.5f, 0.5f));
|
|
||||||
|
|
||||||
ImGui::PushFont(UIStyle.LargeFont);
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, LayoutScale(10.0f));
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, LayoutScale(ImGuiFullscreen::LAYOUT_MENU_BUTTON_X_PADDING,
|
|
||||||
ImGuiFullscreen::LAYOUT_MENU_BUTTON_Y_PADDING));
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 0.0f);
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, LayoutScale(20.0f, 20.0f));
|
|
||||||
|
|
||||||
bool is_open = true;
|
bool is_open = true;
|
||||||
if (ImGui::BeginPopupModal(title, &is_open,
|
if (BeginFixedPopupModal(title, &is_open))
|
||||||
ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove))
|
|
||||||
{
|
{
|
||||||
BeginMenuButtons();
|
BeginMenuButtons();
|
||||||
|
|
||||||
@ -2670,11 +2639,8 @@ void FullscreenUI::DrawFloatRangeSetting(SettingsInterface* bsi, const char* tit
|
|||||||
}
|
}
|
||||||
EndMenuButtons();
|
EndMenuButtons();
|
||||||
|
|
||||||
ImGui::EndPopup();
|
EndFixedPopupModal();
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::PopStyleVar(4);
|
|
||||||
ImGui::PopFont();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FullscreenUI::DrawFloatSpinBoxSetting(SettingsInterface* bsi, const char* title, const char* summary,
|
void FullscreenUI::DrawFloatSpinBoxSetting(SettingsInterface* bsi, const char* title, const char* summary,
|
||||||
@ -2697,18 +2663,9 @@ void FullscreenUI::DrawFloatSpinBoxSetting(SettingsInterface* bsi, const char* t
|
|||||||
}
|
}
|
||||||
|
|
||||||
ImGui::SetNextWindowSize(LayoutScale(500.0f, 194.0f));
|
ImGui::SetNextWindowSize(LayoutScale(500.0f, 194.0f));
|
||||||
ImGui::SetNextWindowPos(ImGui::GetIO().DisplaySize * 0.5f, ImGuiCond_Always, ImVec2(0.5f, 0.5f));
|
|
||||||
|
|
||||||
ImGui::PushFont(UIStyle.LargeFont);
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, LayoutScale(10.0f));
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, LayoutScale(ImGuiFullscreen::LAYOUT_MENU_BUTTON_X_PADDING,
|
|
||||||
ImGuiFullscreen::LAYOUT_MENU_BUTTON_Y_PADDING));
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 0.0f);
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, LayoutScale(20.0f, 20.0f));
|
|
||||||
|
|
||||||
bool is_open = true;
|
bool is_open = true;
|
||||||
if (ImGui::BeginPopupModal(title, &is_open,
|
if (BeginFixedPopupModal(title, &is_open))
|
||||||
ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove))
|
|
||||||
{
|
{
|
||||||
BeginMenuButtons();
|
BeginMenuButtons();
|
||||||
|
|
||||||
@ -2800,11 +2757,8 @@ void FullscreenUI::DrawFloatSpinBoxSetting(SettingsInterface* bsi, const char* t
|
|||||||
}
|
}
|
||||||
EndMenuButtons();
|
EndMenuButtons();
|
||||||
|
|
||||||
ImGui::EndPopup();
|
EndFixedPopupModal();
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::PopStyleVar(4);
|
|
||||||
ImGui::PopFont();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FullscreenUI::DrawIntRectSetting(SettingsInterface* bsi, const char* title, const char* summary,
|
bool FullscreenUI::DrawIntRectSetting(SettingsInterface* bsi, const char* title, const char* summary,
|
||||||
@ -2834,19 +2788,10 @@ bool FullscreenUI::DrawIntRectSetting(SettingsInterface* bsi, const char* title,
|
|||||||
ImGui::OpenPopup(title);
|
ImGui::OpenPopup(title);
|
||||||
|
|
||||||
ImGui::SetNextWindowSize(LayoutScale(500.0f, 370.0f));
|
ImGui::SetNextWindowSize(LayoutScale(500.0f, 370.0f));
|
||||||
ImGui::SetNextWindowPos(ImGui::GetIO().DisplaySize * 0.5f, ImGuiCond_Always, ImVec2(0.5f, 0.5f));
|
|
||||||
|
|
||||||
ImGui::PushFont(font);
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, LayoutScale(10.0f));
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, LayoutScale(ImGuiFullscreen::LAYOUT_MENU_BUTTON_X_PADDING,
|
|
||||||
ImGuiFullscreen::LAYOUT_MENU_BUTTON_Y_PADDING));
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 0.0f);
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, LayoutScale(20.0f, 20.0f));
|
|
||||||
|
|
||||||
bool is_open = true;
|
bool is_open = true;
|
||||||
bool changed = false;
|
bool changed = false;
|
||||||
if (ImGui::BeginPopupModal(title, &is_open,
|
if (BeginFixedPopupModal(title, &is_open))
|
||||||
ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove))
|
|
||||||
{
|
{
|
||||||
s32 dlg_left_value = static_cast<s32>(left_value.value_or(default_left));
|
s32 dlg_left_value = static_cast<s32>(left_value.value_or(default_left));
|
||||||
s32 dlg_top_value = static_cast<s32>(top_value.value_or(default_top));
|
s32 dlg_top_value = static_cast<s32>(top_value.value_or(default_top));
|
||||||
@ -2921,12 +2866,9 @@ bool FullscreenUI::DrawIntRectSetting(SettingsInterface* bsi, const char* title,
|
|||||||
}
|
}
|
||||||
EndMenuButtons();
|
EndMenuButtons();
|
||||||
|
|
||||||
ImGui::EndPopup();
|
EndFixedPopupModal();
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::PopStyleVar(4);
|
|
||||||
ImGui::PopFont();
|
|
||||||
|
|
||||||
return changed;
|
return changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2953,18 +2895,9 @@ void FullscreenUI::DrawIntSpinBoxSetting(SettingsInterface* bsi, const char* tit
|
|||||||
}
|
}
|
||||||
|
|
||||||
ImGui::SetNextWindowSize(LayoutScale(500.0f, 194.0f));
|
ImGui::SetNextWindowSize(LayoutScale(500.0f, 194.0f));
|
||||||
ImGui::SetNextWindowPos(ImGui::GetIO().DisplaySize * 0.5f, ImGuiCond_Always, ImVec2(0.5f, 0.5f));
|
|
||||||
|
|
||||||
ImGui::PushFont(UIStyle.LargeFont);
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, LayoutScale(10.0f));
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, LayoutScale(ImGuiFullscreen::LAYOUT_MENU_BUTTON_X_PADDING,
|
|
||||||
ImGuiFullscreen::LAYOUT_MENU_BUTTON_Y_PADDING));
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 0.0f);
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, LayoutScale(20.0f, 20.0f));
|
|
||||||
|
|
||||||
bool is_open = true;
|
bool is_open = true;
|
||||||
if (ImGui::BeginPopupModal(title, &is_open,
|
if (BeginFixedPopupModal(title, &is_open))
|
||||||
ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove))
|
|
||||||
{
|
{
|
||||||
BeginMenuButtons();
|
BeginMenuButtons();
|
||||||
|
|
||||||
@ -3050,11 +2983,8 @@ void FullscreenUI::DrawIntSpinBoxSetting(SettingsInterface* bsi, const char* tit
|
|||||||
}
|
}
|
||||||
EndMenuButtons();
|
EndMenuButtons();
|
||||||
|
|
||||||
ImGui::EndPopup();
|
EndFixedPopupModal();
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::PopStyleVar(4);
|
|
||||||
ImGui::PopFont();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[[maybe_unused]] void FullscreenUI::DrawStringListSetting(SettingsInterface* bsi, const char* title,
|
[[maybe_unused]] void FullscreenUI::DrawStringListSetting(SettingsInterface* bsi, const char* title,
|
||||||
@ -4663,16 +4593,8 @@ void FullscreenUI::DrawControllerSettingsPage()
|
|||||||
1.0f, 0.01f, 100.0f, "%.0f%%");
|
1.0f, 0.01f, 100.0f, "%.0f%%");
|
||||||
|
|
||||||
ImGui::SetNextWindowSize(LayoutScale(500.0f, 180.0f));
|
ImGui::SetNextWindowSize(LayoutScale(500.0f, 180.0f));
|
||||||
ImGui::SetNextWindowPos(ImGui::GetIO().DisplaySize * 0.5f, ImGuiCond_Always, ImVec2(0.5f, 0.5f));
|
|
||||||
|
|
||||||
ImGui::PushFont(UIStyle.LargeFont);
|
if (BeginFixedPopupModal(freq_label, nullptr))
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, LayoutScale(10.0f));
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, LayoutScale(ImGuiFullscreen::LAYOUT_MENU_BUTTON_X_PADDING,
|
|
||||||
ImGuiFullscreen::LAYOUT_MENU_BUTTON_Y_PADDING));
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, LayoutScale(20.0f, 20.0f));
|
|
||||||
|
|
||||||
if (ImGui::BeginPopupModal(freq_label, nullptr,
|
|
||||||
ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove))
|
|
||||||
{
|
{
|
||||||
ImGui::SetNextItemWidth(LayoutScale(450.0f));
|
ImGui::SetNextItemWidth(LayoutScale(450.0f));
|
||||||
if (ImGui::SliderInt("##value", &frequency, 0, 60, FSUI_CSTR("Toggle every %d frames"),
|
if (ImGui::SliderInt("##value", &frequency, 0, 60, FSUI_CSTR("Toggle every %d frames"),
|
||||||
@ -4689,11 +4611,8 @@ void FullscreenUI::DrawControllerSettingsPage()
|
|||||||
ImGui::CloseCurrentPopup();
|
ImGui::CloseCurrentPopup();
|
||||||
EndMenuButtons();
|
EndMenuButtons();
|
||||||
|
|
||||||
ImGui::EndPopup();
|
EndFixedPopupModal();
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::PopStyleVar(3);
|
|
||||||
ImGui::PopFont();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ci->settings.empty())
|
if (!ci->settings.empty())
|
||||||
@ -5511,18 +5430,9 @@ void FullscreenUI::DrawPostProcessingSettingsPage()
|
|||||||
ImGui::OpenPopup(tstr);
|
ImGui::OpenPopup(tstr);
|
||||||
|
|
||||||
ImGui::SetNextWindowSize(LayoutScale(500.0f, 194.0f));
|
ImGui::SetNextWindowSize(LayoutScale(500.0f, 194.0f));
|
||||||
ImGui::SetNextWindowPos(ImGui::GetIO().DisplaySize * 0.5f, ImGuiCond_Always, ImVec2(0.5f, 0.5f));
|
|
||||||
|
|
||||||
ImGui::PushFont(UIStyle.LargeFont);
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, LayoutScale(10.0f));
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, LayoutScale(ImGuiFullscreen::LAYOUT_MENU_BUTTON_X_PADDING,
|
|
||||||
ImGuiFullscreen::LAYOUT_MENU_BUTTON_Y_PADDING));
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, LayoutScale(20.0f, 20.0f));
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 0.0f);
|
|
||||||
|
|
||||||
bool is_open = true;
|
bool is_open = true;
|
||||||
if (ImGui::BeginPopupModal(tstr, &is_open,
|
if (BeginFixedPopupModal(tstr, &is_open))
|
||||||
ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove))
|
|
||||||
{
|
{
|
||||||
BeginMenuButtons();
|
BeginMenuButtons();
|
||||||
|
|
||||||
@ -5595,11 +5505,8 @@ void FullscreenUI::DrawPostProcessingSettingsPage()
|
|||||||
}
|
}
|
||||||
EndMenuButtons();
|
EndMenuButtons();
|
||||||
|
|
||||||
ImGui::EndPopup();
|
EndFixedPopupModal();
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::PopStyleVar(4);
|
|
||||||
ImGui::PopFont();
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -5612,18 +5519,9 @@ void FullscreenUI::DrawPostProcessingSettingsPage()
|
|||||||
ImGui::OpenPopup(tstr);
|
ImGui::OpenPopup(tstr);
|
||||||
|
|
||||||
ImGui::SetNextWindowSize(LayoutScale(500.0f, 194.0f));
|
ImGui::SetNextWindowSize(LayoutScale(500.0f, 194.0f));
|
||||||
ImGui::SetNextWindowPos(ImGui::GetIO().DisplaySize * 0.5f, ImGuiCond_Always, ImVec2(0.5f, 0.5f));
|
|
||||||
|
|
||||||
ImGui::PushFont(UIStyle.LargeFont);
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, LayoutScale(10.0f));
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, LayoutScale(ImGuiFullscreen::LAYOUT_MENU_BUTTON_X_PADDING,
|
|
||||||
ImGuiFullscreen::LAYOUT_MENU_BUTTON_Y_PADDING));
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, LayoutScale(20.0f, 20.0f));
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 0.0f);
|
|
||||||
|
|
||||||
bool is_open = true;
|
bool is_open = true;
|
||||||
if (ImGui::BeginPopupModal(tstr, &is_open,
|
if (BeginFixedPopupModal(tstr, &is_open))
|
||||||
ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove))
|
|
||||||
{
|
{
|
||||||
BeginMenuButtons();
|
BeginMenuButtons();
|
||||||
|
|
||||||
@ -5695,11 +5593,8 @@ void FullscreenUI::DrawPostProcessingSettingsPage()
|
|||||||
}
|
}
|
||||||
EndMenuButtons();
|
EndMenuButtons();
|
||||||
|
|
||||||
ImGui::EndPopup();
|
EndFixedPopupModal();
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::PopStyleVar(4);
|
|
||||||
ImGui::PopFont();
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -6041,22 +5936,11 @@ void FullscreenUI::DrawAchievementsLoginWindow()
|
|||||||
};
|
};
|
||||||
|
|
||||||
ImGui::SetNextWindowSize(LayoutScale(600.0f, 0.0f));
|
ImGui::SetNextWindowSize(LayoutScale(600.0f, 0.0f));
|
||||||
ImGui::SetNextWindowPos(ImGui::GetIO().DisplaySize * 0.5f, ImGuiCond_Always, ImVec2(0.5f, 0.5f));
|
|
||||||
|
|
||||||
ImGui::PushFont(UIStyle.LargeFont);
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, LayoutScale(10.0f));
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding,
|
|
||||||
LayoutScale(LAYOUT_MENU_BUTTON_X_PADDING, LAYOUT_MENU_BUTTON_Y_PADDING));
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, LayoutScale(20.0f, 20.0f));
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 0.0f);
|
|
||||||
ImGui::PushStyleColor(ImGuiCol_Text, UIStyle.PrimaryTextColor);
|
|
||||||
ImGui::PushStyleColor(ImGuiCol_TitleBg, UIStyle.PrimaryDarkColor);
|
|
||||||
ImGui::PushStyleColor(ImGuiCol_TitleBgActive, UIStyle.PrimaryColor);
|
|
||||||
|
|
||||||
const char* popup_title = FSUI_ICONSTR(ICON_FA_KEY, "RetroAchievements Login");
|
const char* popup_title = FSUI_ICONSTR(ICON_FA_KEY, "RetroAchievements Login");
|
||||||
bool popup_closed = false;
|
bool popup_closed = false;
|
||||||
ImGui::OpenPopup(popup_title);
|
ImGui::OpenPopup(popup_title);
|
||||||
if (ImGui::BeginPopupModal(popup_title, nullptr, ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize))
|
if (BeginFixedPopupModal(popup_title, nullptr))
|
||||||
{
|
{
|
||||||
BeginMenuButtons();
|
BeginMenuButtons();
|
||||||
|
|
||||||
@ -6131,13 +6015,9 @@ void FullscreenUI::DrawAchievementsLoginWindow()
|
|||||||
|
|
||||||
EndMenuButtons();
|
EndMenuButtons();
|
||||||
|
|
||||||
ImGui::EndPopup();
|
EndFixedPopupModal();
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::PopStyleColor(3);
|
|
||||||
ImGui::PopStyleVar(4);
|
|
||||||
ImGui::PopFont();
|
|
||||||
|
|
||||||
if (popup_closed)
|
if (popup_closed)
|
||||||
actually_close_popup();
|
actually_close_popup();
|
||||||
}
|
}
|
||||||
@ -6298,18 +6178,9 @@ void FullscreenUI::DrawPatchesOrCheatsSettingsPage(bool cheats)
|
|||||||
ImGui::OpenPopup(title);
|
ImGui::OpenPopup(title);
|
||||||
|
|
||||||
ImGui::SetNextWindowSize(LayoutScale(500.0f, 194.0f));
|
ImGui::SetNextWindowSize(LayoutScale(500.0f, 194.0f));
|
||||||
ImGui::SetNextWindowPos(ImGui::GetIO().DisplaySize * 0.5f, ImGuiCond_Always, ImVec2(0.5f, 0.5f));
|
|
||||||
|
|
||||||
ImGui::PushFont(UIStyle.LargeFont);
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, LayoutScale(10.0f));
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, LayoutScale(ImGuiFullscreen::LAYOUT_MENU_BUTTON_X_PADDING,
|
|
||||||
ImGuiFullscreen::LAYOUT_MENU_BUTTON_Y_PADDING));
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 0.0f);
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, LayoutScale(20.0f, 20.0f));
|
|
||||||
|
|
||||||
bool is_open = true;
|
bool is_open = true;
|
||||||
if (ImGui::BeginPopupModal(title, &is_open,
|
if (BeginFixedPopupModal(title, &is_open))
|
||||||
ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove))
|
|
||||||
{
|
{
|
||||||
BeginMenuButtons();
|
BeginMenuButtons();
|
||||||
|
|
||||||
@ -6380,11 +6251,8 @@ void FullscreenUI::DrawPatchesOrCheatsSettingsPage(bool cheats)
|
|||||||
}
|
}
|
||||||
EndMenuButtons();
|
EndMenuButtons();
|
||||||
|
|
||||||
ImGui::EndPopup();
|
EndFixedPopupModal();
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::PopStyleVar(4);
|
|
||||||
ImGui::PopFont();
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -8406,7 +8274,7 @@ void FullscreenUI::CopyTextToClipboard(std::string title, std::string_view text)
|
|||||||
|
|
||||||
void FullscreenUI::DrawAboutWindow()
|
void FullscreenUI::DrawAboutWindow()
|
||||||
{
|
{
|
||||||
ImGui::SetNextWindowSize(LayoutScale(1000.0f, 545.0f));
|
ImGui::SetNextWindowSize(LayoutScale(1000.0f, 550.0f));
|
||||||
ImGui::SetNextWindowPos(ImGui::GetIO().DisplaySize * 0.5f, ImGuiCond_Always, ImVec2(0.5f, 0.5f));
|
ImGui::SetNextWindowPos(ImGui::GetIO().DisplaySize * 0.5f, ImGuiCond_Always, ImVec2(0.5f, 0.5f));
|
||||||
ImGui::OpenPopup(FSUI_CSTR("About DuckStation"));
|
ImGui::OpenPopup(FSUI_CSTR("About DuckStation"));
|
||||||
|
|
||||||
|
@ -46,6 +46,8 @@ static constexpr float SMOOTH_SCROLLING_SPEED = 3.5f;
|
|||||||
static std::optional<Image> LoadTextureImage(std::string_view path, u32 svg_width, u32 svg_height);
|
static std::optional<Image> LoadTextureImage(std::string_view path, u32 svg_width, u32 svg_height);
|
||||||
static std::shared_ptr<GPUTexture> UploadTexture(std::string_view path, const Image& image);
|
static std::shared_ptr<GPUTexture> UploadTexture(std::string_view path, const Image& image);
|
||||||
|
|
||||||
|
static void PushPopupStyle(float window_padding = 20.0f);
|
||||||
|
static void PopPopupStyle();
|
||||||
static void DrawFileSelector();
|
static void DrawFileSelector();
|
||||||
static void DrawChoiceDialog();
|
static void DrawChoiceDialog();
|
||||||
static void DrawInputDialog();
|
static void DrawInputDialog();
|
||||||
@ -619,6 +621,54 @@ void ImGuiFullscreen::EndLayout()
|
|||||||
s_state.had_hovered_menu_item = std::exchange(s_state.has_hovered_menu_item, false);
|
s_state.had_hovered_menu_item = std::exchange(s_state.has_hovered_menu_item, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ImGuiFullscreen::PushPopupStyle(float window_padding)
|
||||||
|
{
|
||||||
|
ImGui::PushFont(UIStyle.LargeFont);
|
||||||
|
ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, LayoutScale(20.0f));
|
||||||
|
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, LayoutScale(window_padding, window_padding));
|
||||||
|
ImGui::PushStyleVar(ImGuiStyleVar_ScrollbarRounding, LayoutScale(10.0f));
|
||||||
|
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding,
|
||||||
|
LayoutScale(LAYOUT_MENU_BUTTON_X_PADDING, LAYOUT_MENU_BUTTON_Y_PADDING));
|
||||||
|
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 0.0f);
|
||||||
|
ImGui::PushStyleColor(ImGuiCol_PopupBg, UIStyle.PopupBackgroundColor);
|
||||||
|
ImGui::PushStyleColor(ImGuiCol_FrameBg, UIStyle.PopupFrameBackgroundColor);
|
||||||
|
ImGui::PushStyleColor(ImGuiCol_TitleBg, UIStyle.PrimaryDarkColor);
|
||||||
|
ImGui::PushStyleColor(ImGuiCol_TitleBgActive, UIStyle.PrimaryColor);
|
||||||
|
ImGui::PushStyleColor(ImGuiCol_Text, UIStyle.PrimaryTextColor);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ImGuiFullscreen::BeginFixedPopupModal(const char* name, bool* p_open)
|
||||||
|
{
|
||||||
|
PushPopupStyle();
|
||||||
|
|
||||||
|
ImGui::SetNextWindowPos((ImGui::GetIO().DisplaySize - LayoutScale(0.0f, LAYOUT_FOOTER_HEIGHT)) * 0.5f,
|
||||||
|
ImGuiCond_Always, ImVec2(0.5f, 0.5f));
|
||||||
|
|
||||||
|
if (!ImGui::BeginPopupModal(name, p_open, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove))
|
||||||
|
{
|
||||||
|
PopPopupStyle();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// don't draw unreadable text
|
||||||
|
ImGui::PushStyleColor(ImGuiCol_Text, UIStyle.BackgroundTextColor);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ImGuiFullscreen::PopPopupStyle()
|
||||||
|
{
|
||||||
|
ImGui::PopStyleColor(5);
|
||||||
|
ImGui::PopStyleVar(5);
|
||||||
|
ImGui::PopFont();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ImGuiFullscreen::EndFixedPopupModal()
|
||||||
|
{
|
||||||
|
ImGui::PopStyleColor();
|
||||||
|
ImGui::EndPopup();
|
||||||
|
PopPopupStyle();
|
||||||
|
}
|
||||||
|
|
||||||
void ImGuiFullscreen::RenderOverlays()
|
void ImGuiFullscreen::RenderOverlays()
|
||||||
{
|
{
|
||||||
if (!s_state.initialized)
|
if (!s_state.initialized)
|
||||||
@ -1755,18 +1805,8 @@ bool ImGuiFullscreen::RangeButton(const char* title, const char* summary, s32* v
|
|||||||
bool changed = false;
|
bool changed = false;
|
||||||
|
|
||||||
ImGui::SetNextWindowSize(LayoutScale(500.0f, 192.0f));
|
ImGui::SetNextWindowSize(LayoutScale(500.0f, 192.0f));
|
||||||
ImGui::SetNextWindowPos((ImGui::GetIO().DisplaySize - LayoutScale(0.0f, LAYOUT_FOOTER_HEIGHT)) * 0.5f,
|
|
||||||
ImGuiCond_Always, ImVec2(0.5f, 0.5f));
|
|
||||||
|
|
||||||
ImGui::PushFont(UIStyle.LargeFont);
|
if (BeginFixedPopupModal(title, nullptr))
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, LayoutScale(10.0f));
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, LayoutScale(ImGuiFullscreen::LAYOUT_MENU_BUTTON_X_PADDING,
|
|
||||||
ImGuiFullscreen::LAYOUT_MENU_BUTTON_Y_PADDING));
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 0.0f);
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, LayoutScale(20.0f, 20.0f));
|
|
||||||
|
|
||||||
if (ImGui::BeginPopupModal(title, nullptr,
|
|
||||||
ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove))
|
|
||||||
{
|
{
|
||||||
BeginMenuButtons();
|
BeginMenuButtons();
|
||||||
|
|
||||||
@ -1781,12 +1821,9 @@ bool ImGuiFullscreen::RangeButton(const char* title, const char* summary, s32* v
|
|||||||
ImGui::CloseCurrentPopup();
|
ImGui::CloseCurrentPopup();
|
||||||
EndMenuButtons();
|
EndMenuButtons();
|
||||||
|
|
||||||
ImGui::EndPopup();
|
EndFixedPopupModal();
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::PopStyleVar(4);
|
|
||||||
ImGui::PopFont();
|
|
||||||
|
|
||||||
return changed;
|
return changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1834,18 +1871,8 @@ bool ImGuiFullscreen::RangeButton(const char* title, const char* summary, float*
|
|||||||
bool changed = false;
|
bool changed = false;
|
||||||
|
|
||||||
ImGui::SetNextWindowSize(LayoutScale(500.0f, 192.0f));
|
ImGui::SetNextWindowSize(LayoutScale(500.0f, 192.0f));
|
||||||
ImGui::SetNextWindowPos((ImGui::GetIO().DisplaySize - LayoutScale(0.0f, LAYOUT_FOOTER_HEIGHT)) * 0.5f,
|
|
||||||
ImGuiCond_Always, ImVec2(0.5f, 0.5f));
|
|
||||||
|
|
||||||
ImGui::PushFont(UIStyle.LargeFont);
|
if (BeginFixedPopupModal(title, nullptr))
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, LayoutScale(10.0f));
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, LayoutScale(ImGuiFullscreen::LAYOUT_MENU_BUTTON_X_PADDING,
|
|
||||||
ImGuiFullscreen::LAYOUT_MENU_BUTTON_Y_PADDING));
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 0.0f);
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, LayoutScale(20.0f, 20.0f));
|
|
||||||
|
|
||||||
if (ImGui::BeginPopupModal(title, nullptr,
|
|
||||||
ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove))
|
|
||||||
{
|
{
|
||||||
BeginMenuButtons();
|
BeginMenuButtons();
|
||||||
|
|
||||||
@ -1859,12 +1886,9 @@ bool ImGuiFullscreen::RangeButton(const char* title, const char* summary, float*
|
|||||||
ImGui::CloseCurrentPopup();
|
ImGui::CloseCurrentPopup();
|
||||||
EndMenuButtons();
|
EndMenuButtons();
|
||||||
|
|
||||||
ImGui::EndPopup();
|
EndFixedPopupModal();
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::PopStyleVar(4);
|
|
||||||
ImGui::PopFont();
|
|
||||||
|
|
||||||
return changed;
|
return changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2383,20 +2407,11 @@ void ImGuiFullscreen::DrawFileSelector()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
ImGui::SetNextWindowSize(LayoutScale(1000.0f, 650.0f));
|
ImGui::SetNextWindowSize(LayoutScale(1000.0f, 650.0f));
|
||||||
ImGui::SetNextWindowPos((ImGui::GetIO().DisplaySize - LayoutScale(0.0f, LAYOUT_FOOTER_HEIGHT)) * 0.5f,
|
|
||||||
ImGuiCond_Always, ImVec2(0.5f, 0.5f));
|
|
||||||
ImGui::OpenPopup(s_state.file_selector_title.c_str());
|
ImGui::OpenPopup(s_state.file_selector_title.c_str());
|
||||||
|
|
||||||
FileSelectorItem* selected = nullptr;
|
FileSelectorItem* selected = nullptr;
|
||||||
|
|
||||||
ImGui::PushFont(UIStyle.LargeFont);
|
PushPopupStyle(10.0f);
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, LayoutScale(10.0f));
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding,
|
|
||||||
LayoutScale(LAYOUT_MENU_BUTTON_X_PADDING, LAYOUT_MENU_BUTTON_Y_PADDING));
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 0.0f);
|
|
||||||
ImGui::PushStyleColor(ImGuiCol_Text, UIStyle.PrimaryTextColor);
|
|
||||||
ImGui::PushStyleColor(ImGuiCol_TitleBg, UIStyle.PrimaryDarkColor);
|
|
||||||
ImGui::PushStyleColor(ImGuiCol_TitleBgActive, UIStyle.PrimaryColor);
|
|
||||||
|
|
||||||
bool is_open = !WantsToCloseMenu();
|
bool is_open = !WantsToCloseMenu();
|
||||||
bool directory_selected = false;
|
bool directory_selected = false;
|
||||||
@ -2443,9 +2458,7 @@ void ImGuiFullscreen::DrawFileSelector()
|
|||||||
is_open = false;
|
is_open = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::PopStyleColor(3);
|
PopPopupStyle();
|
||||||
ImGui::PopStyleVar(3);
|
|
||||||
ImGui::PopFont();
|
|
||||||
|
|
||||||
if (is_open)
|
if (is_open)
|
||||||
GetFileSelectorHelpText(s_state.fullscreen_footer_text);
|
GetFileSelectorHelpText(s_state.fullscreen_footer_text);
|
||||||
@ -2532,15 +2545,7 @@ void ImGuiFullscreen::DrawChoiceDialog()
|
|||||||
if (!s_state.choice_dialog_open)
|
if (!s_state.choice_dialog_open)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ImGui::PushFont(UIStyle.LargeFont);
|
PushPopupStyle(10.0f);
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, LayoutScale(10.0f));
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_ScrollbarRounding, LayoutScale(10.0f));
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding,
|
|
||||||
LayoutScale(LAYOUT_MENU_BUTTON_X_PADDING, LAYOUT_MENU_BUTTON_Y_PADDING));
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 0.0f);
|
|
||||||
ImGui::PushStyleColor(ImGuiCol_Text, UIStyle.PrimaryTextColor);
|
|
||||||
ImGui::PushStyleColor(ImGuiCol_TitleBg, UIStyle.PrimaryDarkColor);
|
|
||||||
ImGui::PushStyleColor(ImGuiCol_TitleBgActive, UIStyle.PrimaryColor);
|
|
||||||
|
|
||||||
const float width = LayoutScale(600.0f);
|
const float width = LayoutScale(600.0f);
|
||||||
const float title_height =
|
const float title_height =
|
||||||
@ -2602,9 +2607,7 @@ void ImGuiFullscreen::DrawChoiceDialog()
|
|||||||
ImGui::EndPopup();
|
ImGui::EndPopup();
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::PopStyleColor(3);
|
PopPopupStyle();
|
||||||
ImGui::PopStyleVar(4);
|
|
||||||
ImGui::PopFont();
|
|
||||||
|
|
||||||
is_open &= !WantsToCloseMenu();
|
is_open &= !WantsToCloseMenu();
|
||||||
|
|
||||||
@ -2664,21 +2667,15 @@ void ImGuiFullscreen::DrawInputDialog()
|
|||||||
ImGuiCond_Always, ImVec2(0.5f, 0.5f));
|
ImGuiCond_Always, ImVec2(0.5f, 0.5f));
|
||||||
ImGui::OpenPopup(s_state.input_dialog_title.c_str());
|
ImGui::OpenPopup(s_state.input_dialog_title.c_str());
|
||||||
|
|
||||||
ImGui::PushFont(UIStyle.LargeFont);
|
PushPopupStyle();
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, LayoutScale(10.0f));
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, LayoutScale(20.0f, 20.0f));
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding,
|
|
||||||
LayoutScale(LAYOUT_MENU_BUTTON_X_PADDING, LAYOUT_MENU_BUTTON_Y_PADDING));
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 0.0f);
|
|
||||||
ImGui::PushStyleColor(ImGuiCol_Text, UIStyle.PrimaryTextColor);
|
|
||||||
ImGui::PushStyleColor(ImGuiCol_TitleBg, UIStyle.PrimaryDarkColor);
|
|
||||||
ImGui::PushStyleColor(ImGuiCol_TitleBgActive, UIStyle.PrimaryColor);
|
|
||||||
|
|
||||||
bool is_open = true;
|
bool is_open = true;
|
||||||
if (ImGui::BeginPopupModal(s_state.input_dialog_title.c_str(), &is_open,
|
if (ImGui::BeginPopupModal(s_state.input_dialog_title.c_str(), &is_open,
|
||||||
ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize |
|
ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize |
|
||||||
ImGuiWindowFlags_NoMove))
|
ImGuiWindowFlags_NoMove))
|
||||||
{
|
{
|
||||||
|
ImGui::PushStyleColor(ImGuiCol_Text, UIStyle.BackgroundTextColor);
|
||||||
|
|
||||||
ResetFocusHere();
|
ResetFocusHere();
|
||||||
ImGui::TextWrapped("%s", s_state.input_dialog_message.c_str());
|
ImGui::TextWrapped("%s", s_state.input_dialog_message.c_str());
|
||||||
|
|
||||||
@ -2721,6 +2718,8 @@ void ImGuiFullscreen::DrawInputDialog()
|
|||||||
|
|
||||||
EndMenuButtons();
|
EndMenuButtons();
|
||||||
|
|
||||||
|
ImGui::PopStyleColor(1);
|
||||||
|
|
||||||
ImGui::EndPopup();
|
ImGui::EndPopup();
|
||||||
}
|
}
|
||||||
if (!is_open)
|
if (!is_open)
|
||||||
@ -2728,9 +2727,7 @@ void ImGuiFullscreen::DrawInputDialog()
|
|||||||
else
|
else
|
||||||
GetInputDialogHelpText(s_state.fullscreen_footer_text);
|
GetInputDialogHelpText(s_state.fullscreen_footer_text);
|
||||||
|
|
||||||
ImGui::PopStyleColor(3);
|
PopPopupStyle();
|
||||||
ImGui::PopStyleVar(4);
|
|
||||||
ImGui::PopFont();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ImGuiFullscreen::CloseInputDialog()
|
void ImGuiFullscreen::CloseInputDialog()
|
||||||
@ -2827,15 +2824,7 @@ void ImGuiFullscreen::DrawMessageDialog()
|
|||||||
ImGuiCond_Always, ImVec2(0.5f, 0.5f));
|
ImGuiCond_Always, ImVec2(0.5f, 0.5f));
|
||||||
ImGui::OpenPopup(win_id);
|
ImGui::OpenPopup(win_id);
|
||||||
|
|
||||||
ImGui::PushFont(UIStyle.LargeFont);
|
PushPopupStyle();
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, LayoutScale(20.0f, 20.0f));
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, LayoutScale(10.0f));
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding,
|
|
||||||
LayoutScale(LAYOUT_MENU_BUTTON_X_PADDING, LAYOUT_MENU_BUTTON_Y_PADDING));
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 0.0f);
|
|
||||||
ImGui::PushStyleColor(ImGuiCol_Text, UIStyle.PrimaryTextColor);
|
|
||||||
ImGui::PushStyleColor(ImGuiCol_TitleBg, UIStyle.PrimaryDarkColor);
|
|
||||||
ImGui::PushStyleColor(ImGuiCol_TitleBgActive, UIStyle.PrimaryColor);
|
|
||||||
|
|
||||||
bool is_open = true;
|
bool is_open = true;
|
||||||
const u32 flags = ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove |
|
const u32 flags = ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove |
|
||||||
@ -2844,6 +2833,8 @@ void ImGuiFullscreen::DrawMessageDialog()
|
|||||||
|
|
||||||
if (ImGui::BeginPopupModal(win_id, &is_open, flags))
|
if (ImGui::BeginPopupModal(win_id, &is_open, flags))
|
||||||
{
|
{
|
||||||
|
ImGui::PushStyleColor(ImGuiCol_Text, UIStyle.BackgroundTextColor);
|
||||||
|
|
||||||
ResetFocusHere();
|
ResetFocusHere();
|
||||||
BeginMenuButtons();
|
BeginMenuButtons();
|
||||||
|
|
||||||
@ -2862,12 +2853,11 @@ void ImGuiFullscreen::DrawMessageDialog()
|
|||||||
|
|
||||||
EndMenuButtons();
|
EndMenuButtons();
|
||||||
|
|
||||||
|
ImGui::PopStyleColor();
|
||||||
ImGui::EndPopup();
|
ImGui::EndPopup();
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::PopStyleColor(3);
|
PopPopupStyle();
|
||||||
ImGui::PopStyleVar(4);
|
|
||||||
ImGui::PopFont();
|
|
||||||
|
|
||||||
if (!is_open || result.has_value())
|
if (!is_open || result.has_value())
|
||||||
{
|
{
|
||||||
@ -3469,6 +3459,7 @@ void ImGuiFullscreen::SetTheme(bool light)
|
|||||||
UIStyle.BackgroundLineColor = HEX_TO_IMVEC4(0xf0f0f0, 0xff);
|
UIStyle.BackgroundLineColor = HEX_TO_IMVEC4(0xf0f0f0, 0xff);
|
||||||
UIStyle.BackgroundHighlight = HEX_TO_IMVEC4(0x4b4b4b, 0xc0);
|
UIStyle.BackgroundHighlight = HEX_TO_IMVEC4(0x4b4b4b, 0xc0);
|
||||||
UIStyle.PopupBackgroundColor = HEX_TO_IMVEC4(0x212121, 0xf2);
|
UIStyle.PopupBackgroundColor = HEX_TO_IMVEC4(0x212121, 0xf2);
|
||||||
|
UIStyle.PopupFrameBackgroundColor = HEX_TO_IMVEC4(0x313131, 0xf2);
|
||||||
UIStyle.PrimaryColor = HEX_TO_IMVEC4(0x2e2e2e, 0xff);
|
UIStyle.PrimaryColor = HEX_TO_IMVEC4(0x2e2e2e, 0xff);
|
||||||
UIStyle.PrimaryLightColor = HEX_TO_IMVEC4(0x484848, 0xff);
|
UIStyle.PrimaryLightColor = HEX_TO_IMVEC4(0x484848, 0xff);
|
||||||
UIStyle.PrimaryDarkColor = HEX_TO_IMVEC4(0x000000, 0xff);
|
UIStyle.PrimaryDarkColor = HEX_TO_IMVEC4(0x000000, 0xff);
|
||||||
@ -3489,6 +3480,7 @@ void ImGuiFullscreen::SetTheme(bool light)
|
|||||||
UIStyle.BackgroundLineColor = HEX_TO_IMVEC4(0xe1e2e1, 0xff);
|
UIStyle.BackgroundLineColor = HEX_TO_IMVEC4(0xe1e2e1, 0xff);
|
||||||
UIStyle.BackgroundHighlight = HEX_TO_IMVEC4(0xe1e2e1, 0xc0);
|
UIStyle.BackgroundHighlight = HEX_TO_IMVEC4(0xe1e2e1, 0xc0);
|
||||||
UIStyle.PopupBackgroundColor = HEX_TO_IMVEC4(0xd8d8d8, 0xf2);
|
UIStyle.PopupBackgroundColor = HEX_TO_IMVEC4(0xd8d8d8, 0xf2);
|
||||||
|
UIStyle.PopupFrameBackgroundColor = HEX_TO_IMVEC4(0xc8c8c8, 0xf2);
|
||||||
UIStyle.PrimaryColor = HEX_TO_IMVEC4(0x2a3e78, 0xff);
|
UIStyle.PrimaryColor = HEX_TO_IMVEC4(0x2a3e78, 0xff);
|
||||||
UIStyle.PrimaryLightColor = HEX_TO_IMVEC4(0x235cd9, 0xff);
|
UIStyle.PrimaryLightColor = HEX_TO_IMVEC4(0x235cd9, 0xff);
|
||||||
UIStyle.PrimaryDarkColor = HEX_TO_IMVEC4(0x1d2953, 0xff);
|
UIStyle.PrimaryDarkColor = HEX_TO_IMVEC4(0x1d2953, 0xff);
|
||||||
|
@ -50,6 +50,7 @@ struct ALIGN_TO_CACHE_LINE UIStyles
|
|||||||
ImVec4 BackgroundLineColor;
|
ImVec4 BackgroundLineColor;
|
||||||
ImVec4 BackgroundHighlight;
|
ImVec4 BackgroundHighlight;
|
||||||
ImVec4 PopupBackgroundColor;
|
ImVec4 PopupBackgroundColor;
|
||||||
|
ImVec4 PopupFrameBackgroundColor;
|
||||||
ImVec4 DisabledColor;
|
ImVec4 DisabledColor;
|
||||||
ImVec4 PrimaryColor;
|
ImVec4 PrimaryColor;
|
||||||
ImVec4 PrimaryLightColor;
|
ImVec4 PrimaryLightColor;
|
||||||
@ -148,6 +149,8 @@ void UploadAsyncTextures();
|
|||||||
|
|
||||||
void BeginLayout();
|
void BeginLayout();
|
||||||
void EndLayout();
|
void EndLayout();
|
||||||
|
bool BeginFixedPopupModal(const char* name, bool* p_open = nullptr);
|
||||||
|
void EndFixedPopupModal();
|
||||||
|
|
||||||
void RenderOverlays();
|
void RenderOverlays();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user