mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Improve server browser styling
Set minimum window size based on theme, so that if there are more servers than displayable, the last listing wouldn't clip under the panel frame.
This commit is contained in:
parent
649e6cb63c
commit
b160f39379
@ -94,19 +94,35 @@ void CBrowser::RunFrame(void)
|
||||
}
|
||||
|
||||
int nVars = 0;
|
||||
float flWidth;
|
||||
float flHeight;
|
||||
if (m_Style == ImGuiStyle_t::MODERN)
|
||||
{
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2{ 8.f, 10.f }); nVars++;
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_Alpha, m_flFadeAlpha); nVars++;
|
||||
|
||||
flWidth = 621.f;
|
||||
flHeight = 532.f;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_Style == ImGuiStyle_t::LEGACY)
|
||||
{
|
||||
flWidth = 619.f;
|
||||
flHeight = 526.f;
|
||||
}
|
||||
else
|
||||
{
|
||||
flWidth = 618.f;
|
||||
flHeight = 524.f;
|
||||
}
|
||||
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2{ 6.f, 6.f }); nVars++;
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_Alpha, m_flFadeAlpha); nVars++;
|
||||
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_ChildBorderSize, 1.0f); nVars++;
|
||||
}
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowMinSize, ImVec2(928.f, 524.f)); nVars++;
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowMinSize, ImVec2(flWidth, flHeight)); nVars++;
|
||||
|
||||
if (m_bActivate && m_bReclaimFocus) // Reclaim focus on window apparition.
|
||||
{
|
||||
@ -233,7 +249,7 @@ void CBrowser::BrowserPanel(void)
|
||||
ImGui::Separator();
|
||||
|
||||
int iVars = 0; // Eliminate borders around server list table.
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2{ 1.f, 1.f }); iVars++;
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2{ 1.f, 0.f }); iVars++;
|
||||
|
||||
const float fFooterHeight = ImGui::GetStyle().ItemSpacing.y + ImGui::GetFrameHeightWithSpacing();
|
||||
ImGui::BeginChild("##ServerBrowser_ServerList", { 0, -fFooterHeight }, true, ImGuiWindowFlags_AlwaysVerticalScrollbar);
|
||||
|
Loading…
x
Reference in New Issue
Block a user