mirror of
https://github.com/stenzek/duckstation.git
synced 2025-06-07 03:55:33 +00:00
FullscreenUI: Add padding to game list
This commit is contained in:
parent
d840a825e2
commit
75ae7deadb
@ -7875,7 +7875,7 @@ void FullscreenUI::DrawGameList(const ImVec2& heading_size)
|
|||||||
ImGui::SetNextWindowScroll(ImVec2(0.0f, 0.0f));
|
ImGui::SetNextWindowScroll(ImVec2(0.0f, 0.0f));
|
||||||
|
|
||||||
if (BeginFullscreenColumnWindow(0.0f, -530.0f, "game_list_entries",
|
if (BeginFullscreenColumnWindow(0.0f, -530.0f, "game_list_entries",
|
||||||
ModAlpha(UIStyle.BackgroundColor, GetBackgroundAlpha())))
|
ModAlpha(UIStyle.BackgroundColor, GetBackgroundAlpha()), ImVec2(10.0f, 10.0f)))
|
||||||
{
|
{
|
||||||
const ImVec2 image_size(LayoutScale(LAYOUT_MENU_BUTTON_HEIGHT, LAYOUT_MENU_BUTTON_HEIGHT));
|
const ImVec2 image_size(LayoutScale(LAYOUT_MENU_BUTTON_HEIGHT, LAYOUT_MENU_BUTTON_HEIGHT));
|
||||||
|
|
||||||
|
@ -985,7 +985,8 @@ void ImGuiFullscreen::EndFullscreenColumns()
|
|||||||
ImGui::PopStyleVar(3);
|
ImGui::PopStyleVar(3);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ImGuiFullscreen::BeginFullscreenColumnWindow(float start, float end, const char* name, const ImVec4& background)
|
bool ImGuiFullscreen::BeginFullscreenColumnWindow(float start, float end, const char* name, const ImVec4& background,
|
||||||
|
const ImVec2& padding)
|
||||||
{
|
{
|
||||||
start = LayoutScale(start);
|
start = LayoutScale(start);
|
||||||
end = LayoutScale(end);
|
end = LayoutScale(end);
|
||||||
@ -999,15 +1000,19 @@ bool ImGuiFullscreen::BeginFullscreenColumnWindow(float start, float end, const
|
|||||||
const ImVec2 size(end - start, ImGui::GetCurrentWindow()->Size.y);
|
const ImVec2 size(end - start, ImGui::GetCurrentWindow()->Size.y);
|
||||||
|
|
||||||
ImGui::PushStyleColor(ImGuiCol_ChildBg, background);
|
ImGui::PushStyleColor(ImGuiCol_ChildBg, background);
|
||||||
|
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, LayoutScale(padding));
|
||||||
|
|
||||||
ImGui::SetCursorPos(pos);
|
ImGui::SetCursorPos(pos);
|
||||||
|
|
||||||
return ImGui::BeginChild(name, size, false, ImGuiWindowFlags_NavFlattened);
|
return ImGui::BeginChild(name, size,
|
||||||
|
(padding.x != 0.0f || padding.y != 0.0f) ? ImGuiChildFlags_AlwaysUseWindowPadding : 0,
|
||||||
|
ImGuiWindowFlags_NavFlattened);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ImGuiFullscreen::EndFullscreenColumnWindow()
|
void ImGuiFullscreen::EndFullscreenColumnWindow()
|
||||||
{
|
{
|
||||||
ImGui::EndChild();
|
ImGui::EndChild();
|
||||||
|
ImGui::PopStyleVar();
|
||||||
ImGui::PopStyleColor();
|
ImGui::PopStyleColor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -245,7 +245,7 @@ bool BeginFullscreenColumns(const char* title = nullptr, float pos_y = 0.0f, boo
|
|||||||
void EndFullscreenColumns();
|
void EndFullscreenColumns();
|
||||||
|
|
||||||
bool BeginFullscreenColumnWindow(float start, float end, const char* name,
|
bool BeginFullscreenColumnWindow(float start, float end, const char* name,
|
||||||
const ImVec4& background = UIStyle.BackgroundColor);
|
const ImVec4& background = UIStyle.BackgroundColor, const ImVec2& padding = ImVec2());
|
||||||
void EndFullscreenColumnWindow();
|
void EndFullscreenColumnWindow();
|
||||||
|
|
||||||
bool BeginFullscreenWindow(float left, float top, float width, float height, const char* name,
|
bool BeginFullscreenWindow(float left, float top, float width, float height, const char* name,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user