fix int sliders to fill the window like float sliders (#1984)

* fix int sliders to fill the window like float sliders

* add a spacer to make it consistent with float slider

* add a spacer to make it consistent with float slider

* adding pop width further constancy with float slider
This commit is contained in:
frizzle101101 2022-11-23 16:14:11 -05:00 committed by GitHub
parent 4526550e95
commit d65718db85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -285,6 +285,7 @@ namespace UIWidgets {
}
ImGui::Text(text, val);
Spacer(0);
if (disabled) {
DisableComponentSwitch(disabledTooltipText, alpha);
@ -305,13 +306,23 @@ namespace UIWidgets {
DisableComponentSwitch(disabledTooltipText, alpha);
}
}
if (PlusMinusButton) {
#ifdef __SWITCH__
ImGui::PushItemWidth(ImGui::GetWindowSize().x - 110.0f);
#elif defined(__WIIU__)
ImGui::PushItemWidth(ImGui::GetWindowSize().x - 79.0f * 2);
#else
ImGui::PushItemWidth(ImGui::GetWindowSize().x - 79.0f);
#endif
}
if (ImGui::SliderInt(id, &val, min, max, format))
{
CVar_SetS32(cvarName, val);
SohImGui::RequestCvarSaveOnNextTick();
}
if (PlusMinusButton) {
ImGui::PopItemWidth();
}
if(PlusMinusButton) {
if (disabled) {
DisableComponentSwitch(disabledTooltipText, alpha);
@ -364,9 +375,7 @@ namespace UIWidgets {
} else {
ImGui::Text(text, static_cast<int>(100 * val));
}
Spacer(0);
if(PlusMinusButton) {
std::string MinusBTNName = " - ##";
MinusBTNName += cvarName;