mirror of
https://github.com/PCSX2/pcsx2.git
synced 2026-01-31 01:15:24 +01:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
82e5f80f11 | ||
|
|
44ba9e283e | ||
|
|
0244cde98d | ||
|
|
d75612e4c9 | ||
|
|
cbfc838aab |
@@ -2562,7 +2562,7 @@ void MainWindow::createDisplayWidget(bool fullscreen, bool render_to_main)
|
||||
m_display_container = m_display_surface->createWindowContainer(getContentParent());
|
||||
}
|
||||
|
||||
if (fullscreen)
|
||||
if (fullscreen || g_emu_thread->isExclusiveFullscreen())
|
||||
{
|
||||
// On Wayland, while move/restoreGeometry can't position the window, it can influence which screen they show up on.
|
||||
// Other platforms can position windows fine, but the only thing that matters here is the screen.
|
||||
@@ -2572,13 +2572,21 @@ void MainWindow::createDisplayWidget(bool fullscreen, bool render_to_main)
|
||||
m_display_surface->setFramePosition(pos());
|
||||
else
|
||||
restoreDisplayWindowGeometryFromConfig();
|
||||
m_display_surface->showFullScreen();
|
||||
|
||||
if (fullscreen)
|
||||
m_display_surface->showFullScreen();
|
||||
else
|
||||
m_display_surface->showNormal();
|
||||
#else
|
||||
if (isVisible() && g_emu_thread->shouldRenderToMain())
|
||||
m_display_container->move(pos());
|
||||
else
|
||||
restoreDisplayWindowGeometryFromConfig();
|
||||
m_display_container->showFullScreen();
|
||||
|
||||
if (fullscreen)
|
||||
m_display_container->showFullScreen();
|
||||
else
|
||||
m_display_container->showNormal();
|
||||
#endif
|
||||
}
|
||||
else if (!render_to_main)
|
||||
|
||||
@@ -2528,7 +2528,7 @@ void GSState::Move()
|
||||
if (m_env.TRXPOS.DIRX)
|
||||
{
|
||||
// Only allow it to reverse if the destination is behind the source.
|
||||
if (!intersect || (sx <= dx && (sx == dx || ((!m_env.TRXPOS.DIRY && sy >= dy) || (m_env.TRXPOS.DIRY && sy < dy)))))
|
||||
if (!intersect || sx < dx)
|
||||
{
|
||||
sx += w - 1;
|
||||
dx += w - 1;
|
||||
@@ -2538,7 +2538,7 @@ void GSState::Move()
|
||||
if (m_env.TRXPOS.DIRY)
|
||||
{
|
||||
// Only allow it to reverse if the destination is behind the source.
|
||||
if (!intersect || (sy <= dy && (sy == dy || ((!m_env.TRXPOS.DIRX && sx >= dx) || (m_env.TRXPOS.DIRX && sx < dx)))))
|
||||
if (!intersect || sy < dy)
|
||||
{
|
||||
sy += h - 1;
|
||||
dy += h - 1;
|
||||
|
||||
@@ -123,17 +123,18 @@ std::vector<GSAdapterInfo> D3D::GetAdapterInfo(IDXGIFactory5* factory)
|
||||
return adapters;
|
||||
}
|
||||
|
||||
bool D3D::GetRequestedExclusiveFullscreenModeDesc(IDXGIFactory5* factory, const RECT& window_rect, u32 width,
|
||||
bool D3D::GetRequestedExclusiveFullscreenModeDesc(IDXGIFactory5* factory, HWND window_hwnd, u32 width,
|
||||
u32 height, float refresh_rate, DXGI_FORMAT format, DXGI_MODE_DESC* fullscreen_mode, IDXGIOutput** output)
|
||||
{
|
||||
// We need to find which monitor the window is located on.
|
||||
const GSVector4i client_rc_vec = GSVector4i::load<false>(&window_rect);
|
||||
// DXGI seems to use the nearest monitor if the window is out of bounds.
|
||||
const auto* monitor = MonitorFromWindow(window_hwnd, MONITOR_DEFAULTTONEAREST);
|
||||
|
||||
// The window might be on a different adapter to which we are rendering.. so we have to enumerate them all.
|
||||
// The monitor might be on a different adapter to which we are rendering.. so we have to enumerate them all.
|
||||
HRESULT hr;
|
||||
wil::com_ptr_nothrow<IDXGIOutput> first_output, intersecting_output;
|
||||
wil::com_ptr_nothrow<IDXGIOutput> first_output, monitor_output;
|
||||
|
||||
for (u32 adapter_index = 0; !intersecting_output; adapter_index++)
|
||||
for (u32 adapter_index = 0; !monitor_output; adapter_index++)
|
||||
{
|
||||
wil::com_ptr_nothrow<IDXGIAdapter1> adapter;
|
||||
hr = factory->EnumAdapters1(adapter_index, adapter.put());
|
||||
@@ -152,10 +153,9 @@ bool D3D::GetRequestedExclusiveFullscreenModeDesc(IDXGIFactory5* factory, const
|
||||
else if (FAILED(hr) || FAILED(this_output->GetDesc(&output_desc)))
|
||||
continue;
|
||||
|
||||
const GSVector4i output_rc = GSVector4i::load<false>(&output_desc.DesktopCoordinates);
|
||||
if (!client_rc_vec.rintersect(output_rc).rempty())
|
||||
if (output_desc.Monitor == monitor)
|
||||
{
|
||||
intersecting_output = std::move(this_output);
|
||||
monitor_output = std::move(this_output);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ bool D3D::GetRequestedExclusiveFullscreenModeDesc(IDXGIFactory5* factory, const
|
||||
}
|
||||
}
|
||||
|
||||
if (!intersecting_output)
|
||||
if (!monitor_output)
|
||||
{
|
||||
if (!first_output)
|
||||
{
|
||||
@@ -174,7 +174,7 @@ bool D3D::GetRequestedExclusiveFullscreenModeDesc(IDXGIFactory5* factory, const
|
||||
}
|
||||
|
||||
Console.Warning("No DXGI output found for window, using first.");
|
||||
intersecting_output = std::move(first_output);
|
||||
monitor_output = std::move(first_output);
|
||||
}
|
||||
|
||||
DXGI_MODE_DESC request_mode = {};
|
||||
@@ -184,15 +184,15 @@ bool D3D::GetRequestedExclusiveFullscreenModeDesc(IDXGIFactory5* factory, const
|
||||
request_mode.RefreshRate.Numerator = static_cast<UINT>(std::floor(refresh_rate * 1000.0f));
|
||||
request_mode.RefreshRate.Denominator = 1000u;
|
||||
|
||||
if (FAILED(hr = intersecting_output->FindClosestMatchingMode(&request_mode, fullscreen_mode, nullptr)) ||
|
||||
if (FAILED(hr = monitor_output->FindClosestMatchingMode(&request_mode, fullscreen_mode, nullptr)) ||
|
||||
request_mode.Format != format)
|
||||
{
|
||||
ERROR_LOG("Failed to find closest matching mode, hr={:08X}", static_cast<unsigned>(hr));
|
||||
return false;
|
||||
}
|
||||
|
||||
*output = intersecting_output.get();
|
||||
intersecting_output->AddRef();
|
||||
*output = monitor_output.get();
|
||||
monitor_output->AddRef();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace D3D
|
||||
std::vector<GSAdapterInfo> GetAdapterInfo(IDXGIFactory5* factory);
|
||||
|
||||
// returns the fullscreen mode to use for the specified dimensions
|
||||
bool GetRequestedExclusiveFullscreenModeDesc(IDXGIFactory5* factory, const RECT& window_rect, u32 width, u32 height,
|
||||
bool GetRequestedExclusiveFullscreenModeDesc(IDXGIFactory5* factory, HWND window_hwnd, u32 width, u32 height,
|
||||
float refresh_rate, DXGI_FORMAT format, DXGI_MODE_DESC* fullscreen_mode, IDXGIOutput** output);
|
||||
|
||||
// get an adapter based on name
|
||||
|
||||
@@ -659,7 +659,7 @@ bool GSDevice11::CreateSwapChain()
|
||||
float fullscreen_refresh_rate;
|
||||
m_is_exclusive_fullscreen =
|
||||
GetRequestedExclusiveFullscreenMode(&fullscreen_width, &fullscreen_height, &fullscreen_refresh_rate) &&
|
||||
D3D::GetRequestedExclusiveFullscreenModeDesc(m_dxgi_factory.get(), client_rc, fullscreen_width,
|
||||
D3D::GetRequestedExclusiveFullscreenModeDesc(m_dxgi_factory.get(), window_hwnd, fullscreen_width,
|
||||
fullscreen_height, fullscreen_refresh_rate, swap_chain_format, &fullscreen_mode,
|
||||
fullscreen_output.put());
|
||||
|
||||
|
||||
@@ -822,7 +822,7 @@ bool GSDevice12::CreateSwapChain()
|
||||
float fullscreen_refresh_rate;
|
||||
m_is_exclusive_fullscreen =
|
||||
GetRequestedExclusiveFullscreenMode(&fullscreen_width, &fullscreen_height, &fullscreen_refresh_rate) &&
|
||||
D3D::GetRequestedExclusiveFullscreenModeDesc(m_dxgi_factory.get(), client_rc, fullscreen_width,
|
||||
D3D::GetRequestedExclusiveFullscreenModeDesc(m_dxgi_factory.get(), window_hwnd, fullscreen_width,
|
||||
fullscreen_height, fullscreen_refresh_rate, swap_chain_format, &fullscreen_mode,
|
||||
fullscreen_output.put());
|
||||
|
||||
|
||||
@@ -481,7 +481,7 @@ bool GSDeviceVK::CreateDevice(VkSurfaceKHR surface, bool enable_validation_layer
|
||||
vkGetPhysicalDeviceQueueFamilyProperties(m_physical_device, &queue_family_count, queue_family_properties.data());
|
||||
DevCon.WriteLn("%u vulkan queue families", queue_family_count);
|
||||
|
||||
std::vector<int> queue_family_users(queue_family_count, 0);
|
||||
std::vector<uint32_t> queue_family_users(queue_family_count, 0);
|
||||
|
||||
m_graphics_queue_family_index = queue_family_count;
|
||||
m_present_queue_family_index = queue_family_count;
|
||||
@@ -528,7 +528,7 @@ bool GSDeviceVK::CreateDevice(VkSurfaceKHR surface, bool enable_validation_layer
|
||||
else
|
||||
{
|
||||
// No spare queue? Try the graphics queue.
|
||||
if ((queue_family_properties[m_graphics_queue_family_index].queueCount & VK_QUEUE_COMPUTE_BIT) &&
|
||||
if ((queue_family_properties[m_graphics_queue_family_index].queueFlags & VK_QUEUE_COMPUTE_BIT) &&
|
||||
(queue_family_properties[m_graphics_queue_family_index].timestampValidBits != 0))
|
||||
{
|
||||
m_spin_queue_family_index = m_graphics_queue_family_index;
|
||||
@@ -647,7 +647,7 @@ bool GSDeviceVK::CreateDevice(VkSurfaceKHR surface, bool enable_validation_layer
|
||||
if (spin_queue_index == 1)
|
||||
queue_infos[1].pQueuePriorities = queue_priorities + 1;
|
||||
}
|
||||
else
|
||||
else if (m_spin_queue_family_index != queue_family_count)
|
||||
{
|
||||
VkDeviceQueueCreateInfo& spin_queue_info = queue_infos[device_info.queueCreateInfoCount++];
|
||||
spin_queue_info.sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO;
|
||||
|
||||
@@ -2558,13 +2558,25 @@ void FullscreenUI::DrawIntRangeSetting(SettingsInterface* bsi, const char* title
|
||||
LayoutScale(ImGuiFullscreen::LAYOUT_MENU_BUTTON_X_PADDING, ImGuiFullscreen::LAYOUT_MENU_BUTTON_Y_PADDING));
|
||||
|
||||
bool is_open = true;
|
||||
if (ImGui::BeginPopupModal(title, &is_open, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove))
|
||||
if (ImGui::BeginPopupModal(title, &is_open, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoScrollbar))
|
||||
{
|
||||
BeginMenuButtons();
|
||||
|
||||
const float end = ImGui::GetCurrentWindow()->WorkRect.GetWidth();
|
||||
ImGui::SetNextItemWidth(end);
|
||||
s32 dlg_value = static_cast<s32>(value.value_or(default_value));
|
||||
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, LayoutScale(8.0f));
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, LayoutScale(1.0f));
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_GrabRounding, LayoutScale(8.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_FrameBg, ImVec4(0.2f, 0.2f, 0.2f, 1.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_FrameBgHovered, ImVec4(0.25f, 0.25f, 0.25f, 1.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_FrameBgActive, ImVec4(0.3f, 0.3f, 0.3f, 1.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(0.4f, 0.4f, 0.4f, 1.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_SliderGrab, ImVec4(0.45f, 0.65f, 0.95f, 1.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_SliderGrabActive, ImVec4(0.55f, 0.75f, 1.0f, 1.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1.0f, 1.0f, 1.0f, 1.0f));
|
||||
|
||||
if (ImGui::SliderInt("##value", &dlg_value, min_value, max_value, format, ImGuiSliderFlags_NoInput))
|
||||
{
|
||||
if (IsEditingGameSettings(bsi) && dlg_value == default_value)
|
||||
@@ -2575,6 +2587,9 @@ void FullscreenUI::DrawIntRangeSetting(SettingsInterface* bsi, const char* title
|
||||
SetSettingsChanged(bsi);
|
||||
}
|
||||
|
||||
ImGui::PopStyleColor(7);
|
||||
ImGui::PopStyleVar(3);
|
||||
|
||||
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + LayoutScale(10.0f));
|
||||
if (MenuButtonWithoutSummary(FSUI_CSTR("OK"), true, LAYOUT_MENU_BUTTON_HEIGHT_NO_SUMMARY, g_large_font, ImVec2(0.5f, 0.0f)))
|
||||
{
|
||||
@@ -2618,7 +2633,7 @@ void FullscreenUI::DrawIntSpinBoxSetting(SettingsInterface* bsi, const char* tit
|
||||
LayoutScale(ImGuiFullscreen::LAYOUT_MENU_BUTTON_X_PADDING, ImGuiFullscreen::LAYOUT_MENU_BUTTON_Y_PADDING));
|
||||
|
||||
bool is_open = true;
|
||||
if (ImGui::BeginPopupModal(title, &is_open, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove))
|
||||
if (ImGui::BeginPopupModal(title, &is_open, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoScrollbar))
|
||||
{
|
||||
BeginMenuButtons();
|
||||
|
||||
@@ -2633,6 +2648,15 @@ void FullscreenUI::DrawIntSpinBoxSetting(SettingsInterface* bsi, const char* tit
|
||||
const float end = ImGui::GetCurrentWindow()->WorkRect.GetWidth();
|
||||
ImGui::SetNextItemWidth(end);
|
||||
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, LayoutScale(8.0f));
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, LayoutScale(12.0f, 10.0f));
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, LayoutScale(1.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_FrameBg, ImVec4(0.2f, 0.2f, 0.2f, 1.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_FrameBgHovered, ImVec4(0.25f, 0.25f, 0.25f, 1.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_FrameBgActive, ImVec4(0.3f, 0.3f, 0.3f, 1.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(0.4f, 0.4f, 0.4f, 1.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1.0f, 1.0f, 1.0f, 1.0f));
|
||||
|
||||
if (ImGui::InputText("##value", str_value, std::size(str_value), ImGuiInputTextFlags_CharsDecimal))
|
||||
{
|
||||
const s32 new_value = StringUtil::FromChars<s32>(str_value).value_or(dlg_value);
|
||||
@@ -2640,6 +2664,9 @@ void FullscreenUI::DrawIntSpinBoxSetting(SettingsInterface* bsi, const char* tit
|
||||
dlg_value = new_value;
|
||||
}
|
||||
|
||||
ImGui::PopStyleColor(5);
|
||||
ImGui::PopStyleVar(3);
|
||||
|
||||
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + LayoutScale(10.0f));
|
||||
}
|
||||
else
|
||||
@@ -2732,13 +2759,25 @@ void FullscreenUI::DrawFloatRangeSetting(SettingsInterface* bsi, const char* tit
|
||||
LayoutScale(ImGuiFullscreen::LAYOUT_MENU_BUTTON_X_PADDING, ImGuiFullscreen::LAYOUT_MENU_BUTTON_Y_PADDING));
|
||||
|
||||
bool is_open = true;
|
||||
if (ImGui::BeginPopupModal(title, &is_open, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove))
|
||||
if (ImGui::BeginPopupModal(title, &is_open, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoScrollbar))
|
||||
{
|
||||
BeginMenuButtons();
|
||||
|
||||
const float end = ImGui::GetCurrentWindow()->WorkRect.GetWidth();
|
||||
ImGui::SetNextItemWidth(end);
|
||||
float dlg_value = value.value_or(default_value) * multiplier;
|
||||
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, LayoutScale(8.0f));
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, LayoutScale(1.0f));
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_GrabRounding, LayoutScale(8.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_FrameBg, ImVec4(0.2f, 0.2f, 0.2f, 1.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_FrameBgHovered, ImVec4(0.25f, 0.25f, 0.25f, 1.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_FrameBgActive, ImVec4(0.3f, 0.3f, 0.3f, 1.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(0.4f, 0.4f, 0.4f, 1.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_SliderGrab, ImVec4(0.45f, 0.65f, 0.95f, 1.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_SliderGrabActive, ImVec4(0.55f, 0.75f, 1.0f, 1.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1.0f, 1.0f, 1.0f, 1.0f));
|
||||
|
||||
if (ImGui::SliderFloat("##value", &dlg_value, min_value * multiplier, max_value * multiplier, format, ImGuiSliderFlags_NoInput))
|
||||
{
|
||||
dlg_value /= multiplier;
|
||||
@@ -2751,6 +2790,9 @@ void FullscreenUI::DrawFloatRangeSetting(SettingsInterface* bsi, const char* tit
|
||||
SetSettingsChanged(bsi);
|
||||
}
|
||||
|
||||
ImGui::PopStyleColor(7);
|
||||
ImGui::PopStyleVar(3);
|
||||
|
||||
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + LayoutScale(10.0f));
|
||||
if (MenuButtonWithoutSummary(FSUI_CSTR("OK"), true, LAYOUT_MENU_BUTTON_HEIGHT_NO_SUMMARY, g_large_font, ImVec2(0.5f, 0.0f)))
|
||||
{
|
||||
@@ -2794,7 +2836,7 @@ void FullscreenUI::DrawFloatSpinBoxSetting(SettingsInterface* bsi, const char* t
|
||||
LayoutScale(ImGuiFullscreen::LAYOUT_MENU_BUTTON_X_PADDING, ImGuiFullscreen::LAYOUT_MENU_BUTTON_Y_PADDING));
|
||||
|
||||
bool is_open = true;
|
||||
if (ImGui::BeginPopupModal(title, &is_open, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove))
|
||||
if (ImGui::BeginPopupModal(title, &is_open, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoScrollbar))
|
||||
{
|
||||
BeginMenuButtons();
|
||||
|
||||
@@ -2816,6 +2858,13 @@ void FullscreenUI::DrawFloatSpinBoxSetting(SettingsInterface* bsi, const char* t
|
||||
((tmp_value.value() - std::floor(tmp_value.value())) < 0.01f) ? "%.0f" : "%f", tmp_value.value());
|
||||
}
|
||||
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, LayoutScale(8.0f));
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, LayoutScale(12.0f, 10.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_FrameBg, ImVec4(0.2f, 0.2f, 0.2f, 1.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_FrameBgHovered, ImVec4(0.25f, 0.25f, 0.25f, 1.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_FrameBgActive, ImVec4(0.3f, 0.3f, 0.3f, 1.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1.0f, 1.0f, 1.0f, 1.0f));
|
||||
|
||||
if (ImGui::InputText("##value", str_value, std::size(str_value), ImGuiInputTextFlags_CharsDecimal))
|
||||
{
|
||||
const float new_value = StringUtil::FromChars<float>(str_value).value_or(dlg_value);
|
||||
@@ -2823,6 +2872,9 @@ void FullscreenUI::DrawFloatSpinBoxSetting(SettingsInterface* bsi, const char* t
|
||||
dlg_value = new_value;
|
||||
}
|
||||
|
||||
ImGui::PopStyleColor(4);
|
||||
ImGui::PopStyleVar(2);
|
||||
|
||||
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + LayoutScale(10.0f));
|
||||
}
|
||||
else
|
||||
@@ -2930,7 +2982,7 @@ void FullscreenUI::DrawIntRectSetting(SettingsInterface* bsi, const char* title,
|
||||
LayoutScale(ImGuiFullscreen::LAYOUT_MENU_BUTTON_X_PADDING, ImGuiFullscreen::LAYOUT_MENU_BUTTON_Y_PADDING));
|
||||
|
||||
bool is_open = true;
|
||||
if (ImGui::BeginPopupModal(title, &is_open, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove))
|
||||
if (ImGui::BeginPopupModal(title, &is_open, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoScrollbar))
|
||||
{
|
||||
static constexpr const char* labels[4] = {
|
||||
FSUI_NSTR("Left: "),
|
||||
@@ -2988,6 +3040,15 @@ void FullscreenUI::DrawIntRectSetting(SettingsInterface* bsi, const char* title,
|
||||
ImGui::SetNextItemWidth(end);
|
||||
ImGui::SetCursorPosY(button_pos.y);
|
||||
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, LayoutScale(8.0f));
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, LayoutScale(12.0f, 10.0f));
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, LayoutScale(1.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_FrameBg, ImVec4(0.2f, 0.2f, 0.2f, 1.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_FrameBgHovered, ImVec4(0.25f, 0.25f, 0.25f, 1.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_FrameBgActive, ImVec4(0.3f, 0.3f, 0.3f, 1.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(0.4f, 0.4f, 0.4f, 1.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1.0f, 1.0f, 1.0f, 1.0f));
|
||||
|
||||
if (ImGui::InputText("##value", str_value, std::size(str_value), ImGuiInputTextFlags_CharsDecimal))
|
||||
{
|
||||
const s32 new_value = StringUtil::FromChars<s32>(str_value).value_or(dlg_value);
|
||||
@@ -2995,6 +3056,9 @@ void FullscreenUI::DrawIntRectSetting(SettingsInterface* bsi, const char* title,
|
||||
dlg_value = new_value;
|
||||
}
|
||||
|
||||
ImGui::PopStyleColor(5);
|
||||
ImGui::PopStyleVar(3);
|
||||
|
||||
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + LayoutScale(10.0f));
|
||||
}
|
||||
else
|
||||
@@ -6341,18 +6405,33 @@ void FullscreenUI::DrawControllerSettingsPage()
|
||||
LayoutScale(ImGuiFullscreen::LAYOUT_MENU_BUTTON_X_PADDING, ImGuiFullscreen::LAYOUT_MENU_BUTTON_Y_PADDING));
|
||||
|
||||
if (ImGui::BeginPopupModal(
|
||||
freq_label.c_str(), nullptr, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove))
|
||||
freq_label.c_str(), nullptr, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoScrollbar))
|
||||
{
|
||||
ImGui::SetNextItemWidth(LayoutScale(450.0f));
|
||||
if (ImGui::SliderInt("##value", &frequency, 0, 60, FSUI_CSTR("Toggle every %d frames"), ImGuiSliderFlags_NoInput))
|
||||
{
|
||||
if (frequency == 0)
|
||||
bsi->DeleteValue(section, freq_key.c_str());
|
||||
else
|
||||
bsi->SetIntValue(section, freq_key.c_str(), frequency);
|
||||
ImGui::SetNextItemWidth(LayoutScale(450.0f));
|
||||
|
||||
SetSettingsChanged(bsi);
|
||||
}
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, LayoutScale(8.0f));
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, LayoutScale(1.0f));
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_GrabRounding, LayoutScale(8.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_FrameBg, ImVec4(0.2f, 0.2f, 0.2f, 1.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_FrameBgHovered, ImVec4(0.25f, 0.25f, 0.25f, 1.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_FrameBgActive, ImVec4(0.3f, 0.3f, 0.3f, 1.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(0.4f, 0.4f, 0.4f, 1.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_SliderGrab, ImVec4(0.45f, 0.65f, 0.95f, 1.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_SliderGrabActive, ImVec4(0.55f, 0.75f, 1.0f, 1.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1.0f, 1.0f, 1.0f, 1.0f));
|
||||
|
||||
if (ImGui::SliderInt("##value", &frequency, 0, 60, FSUI_CSTR("Toggle every %d frames"), ImGuiSliderFlags_NoInput))
|
||||
{
|
||||
if (frequency == 0)
|
||||
bsi->DeleteValue(section, freq_key.c_str());
|
||||
else
|
||||
bsi->SetIntValue(section, freq_key.c_str(), frequency);
|
||||
|
||||
SetSettingsChanged(bsi);
|
||||
}
|
||||
|
||||
ImGui::PopStyleColor(7);
|
||||
ImGui::PopStyleVar(3);
|
||||
|
||||
BeginMenuButtons();
|
||||
if (MenuButton("OK", nullptr, true, LAYOUT_MENU_BUTTON_HEIGHT_NO_SUMMARY))
|
||||
@@ -7595,7 +7674,7 @@ void FullscreenUI::DrawResumeStateSelector()
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, LayoutScale(20.0f, 20.0f));
|
||||
|
||||
bool is_open = true;
|
||||
if (ImGui::BeginPopupModal(FSUI_CSTR("Load Resume State"), &is_open, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize))
|
||||
if (ImGui::BeginPopupModal(FSUI_CSTR("Load Resume State"), &is_open, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoScrollbar))
|
||||
{
|
||||
const SaveStateListEntry& entry = s_save_state_selector_slots.front();
|
||||
ImGui::TextWrapped(FSUI_CSTR("A resume save state created at %s was found.\n\nDo you want to load this save and continue?"),
|
||||
@@ -8749,11 +8828,14 @@ void FullscreenUI::DrawAchievementsLoginWindow()
|
||||
ImGui::Spacing();
|
||||
ImGui::Spacing();
|
||||
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, LayoutScale(6.0f));
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, LayoutScale(8.0f));
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, LayoutScale(12.0f, 10.0f));
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, LayoutScale(1.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_FrameBg, ImVec4(0.2f, 0.2f, 0.2f, 1.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_FrameBgHovered, ImVec4(0.25f, 0.25f, 0.25f, 1.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_FrameBgActive, ImVec4(0.3f, 0.3f, 0.3f, 1.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(0.4f, 0.4f, 0.4f, 1.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1.0f, 1.0f, 1.0f, 1.0f));
|
||||
|
||||
if (s_achievements_login_logging_in)
|
||||
ImGui::BeginDisabled();
|
||||
@@ -8766,8 +8848,8 @@ void FullscreenUI::DrawAchievementsLoginWindow()
|
||||
ImGui::SetNextItemWidth(content_width);
|
||||
ImGui::InputTextWithHint("##password", FSUI_CSTR("Password"), s_achievements_login_password, sizeof(s_achievements_login_password), ImGuiInputTextFlags_Password);
|
||||
|
||||
ImGui::PopStyleColor(3);
|
||||
ImGui::PopStyleVar(2);
|
||||
ImGui::PopStyleColor(5);
|
||||
ImGui::PopStyleVar(3);
|
||||
|
||||
if (s_achievements_login_logging_in)
|
||||
ImGui::EndDisabled();
|
||||
@@ -8793,7 +8875,7 @@ void FullscreenUI::DrawAchievementsLoginWindow()
|
||||
|
||||
ImGui::SetCursorPosX(ImGui::GetCursorPosX() + start_x);
|
||||
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, LayoutScale(6.0f));
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, LayoutScale(8.0f));
|
||||
|
||||
const bool can_login = !s_achievements_login_logging_in &&
|
||||
strlen(s_achievements_login_username) > 0 &&
|
||||
|
||||
@@ -2390,6 +2390,7 @@ void ImGuiFullscreen::DrawChoiceDialog()
|
||||
return;
|
||||
|
||||
ImGui::PushFont(g_large_font.first, g_large_font.second);
|
||||
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);
|
||||
@@ -2466,7 +2467,7 @@ void ImGuiFullscreen::DrawChoiceDialog()
|
||||
}
|
||||
|
||||
ImGui::PopStyleColor(4);
|
||||
ImGui::PopStyleVar(3);
|
||||
ImGui::PopStyleVar(4);
|
||||
ImGui::PopFont();
|
||||
|
||||
if (choice >= 0)
|
||||
@@ -2518,6 +2519,7 @@ void ImGuiFullscreen::DrawInputDialog()
|
||||
ImGui::OpenPopup(s_input_dialog_title.c_str());
|
||||
|
||||
ImGui::PushFont(g_large_font.first, g_large_font.second);
|
||||
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);
|
||||
@@ -2528,7 +2530,7 @@ void ImGuiFullscreen::DrawInputDialog()
|
||||
|
||||
bool is_open = true;
|
||||
if (ImGui::BeginPopupModal(s_input_dialog_title.c_str(), &is_open,
|
||||
ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove))
|
||||
ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoScrollbar))
|
||||
{
|
||||
ResetFocusHere();
|
||||
ImGui::TextWrapped("%s", s_input_dialog_message.c_str());
|
||||
@@ -2578,10 +2580,22 @@ void ImGuiFullscreen::DrawInputDialog()
|
||||
if (s_focus_reset_queued != FocusResetType::None)
|
||||
ImGui::SetKeyboardFocusHere();
|
||||
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, LayoutScale(8.0f));
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, LayoutScale(12.0f, 10.0f));
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, LayoutScale(1.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_FrameBg, ImVec4(0.2f, 0.2f, 0.2f, 1.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_FrameBgHovered, ImVec4(0.25f, 0.25f, 0.25f, 1.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_FrameBgActive, ImVec4(0.3f, 0.3f, 0.3f, 1.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(0.4f, 0.4f, 0.4f, 1.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1.0f, 1.0f, 1.0f, 1.0f));
|
||||
|
||||
ImGui::InputText("##input", &s_input_dialog_text, flags,
|
||||
(s_input_dialog_filter_type != InputFilterType::None) ? input_callback : nullptr,
|
||||
(s_input_dialog_filter_type != InputFilterType::None) ? static_cast<void*>(&s_input_dialog_filter_type) : nullptr);
|
||||
|
||||
ImGui::PopStyleColor(5);
|
||||
ImGui::PopStyleVar(3);
|
||||
|
||||
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + LayoutScale(10.0f));
|
||||
|
||||
const bool ok_enabled = !s_input_dialog_text.empty();
|
||||
@@ -2613,7 +2627,7 @@ void ImGuiFullscreen::DrawInputDialog()
|
||||
GetInputDialogHelpText(s_fullscreen_footer_text);
|
||||
|
||||
ImGui::PopStyleColor(4);
|
||||
ImGui::PopStyleVar(3);
|
||||
ImGui::PopStyleVar(4);
|
||||
ImGui::PopFont();
|
||||
}
|
||||
|
||||
@@ -2705,7 +2719,8 @@ void ImGuiFullscreen::DrawMessageDialog()
|
||||
const char* win_id = s_message_dialog_title.empty() ? "##messagedialog" : s_message_dialog_title.c_str();
|
||||
|
||||
ImGui::SetNextWindowSize(LayoutScale(700.0f, 0.0f));
|
||||
ImGui::SetNextWindowPos(ImGui::GetIO().DisplaySize * 0.5f, ImGuiCond_Always, ImVec2(0.5f, 0.5f));
|
||||
ImGui::SetNextWindowPos((ImGui::GetIO().DisplaySize - LayoutScale(0.0f, LAYOUT_FOOTER_HEIGHT)) * 0.5f,
|
||||
ImGuiCond_Always, ImVec2(0.5f, 0.5f));
|
||||
ImGui::OpenPopup(win_id);
|
||||
|
||||
ImGui::PushFont(g_large_font.first, g_large_font.second);
|
||||
@@ -2719,7 +2734,7 @@ void ImGuiFullscreen::DrawMessageDialog()
|
||||
ImGui::PushStyleColor(ImGuiCol_PopupBg, UIPopupBackgroundColor);
|
||||
|
||||
bool is_open = true;
|
||||
const u32 flags = ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove |
|
||||
const u32 flags = ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoScrollbar |
|
||||
(s_message_dialog_title.empty() ? ImGuiWindowFlags_NoTitleBar : 0);
|
||||
std::optional<s32> result;
|
||||
|
||||
@@ -2870,7 +2885,8 @@ void ImGuiFullscreen::DrawProgressDialogs(ImVec2& position, float spacing)
|
||||
{
|
||||
const std::string popup_id = fmt::format("##progress_dialog_{}", data.id);
|
||||
ImGui::SetNextWindowSize(LayoutScale(600.0f, 0.0f));
|
||||
ImGui::SetNextWindowPos(ImGui::GetIO().DisplaySize * 0.5f, ImGuiCond_Always, ImVec2(0.5f, 0.5f));
|
||||
ImGui::SetNextWindowPos((ImGui::GetIO().DisplaySize - LayoutScale(0.0f, LAYOUT_FOOTER_HEIGHT)) * 0.5f,
|
||||
ImGuiCond_Always, ImVec2(0.5f, 0.5f));
|
||||
ImGui::OpenPopup(popup_id.c_str());
|
||||
|
||||
ImGui::PushFont(g_large_font.first, g_large_font.second);
|
||||
@@ -2885,7 +2901,7 @@ void ImGuiFullscreen::DrawProgressDialogs(ImVec2& position, float spacing)
|
||||
ImGui::PushStyleColor(ImGuiCol_PlotHistogram, UISecondaryColor);
|
||||
|
||||
bool is_open = true;
|
||||
const u32 flags = ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoTitleBar;
|
||||
const u32 flags = ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoScrollbar;
|
||||
|
||||
if (ImGui::BeginPopupModal(popup_id.c_str(), &is_open, flags))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user