mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-01-10 21:48:17 -05:00
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:
parent
4526550e95
commit
d65718db85
@ -285,6 +285,7 @@ namespace UIWidgets {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ImGui::Text(text, val);
|
ImGui::Text(text, val);
|
||||||
|
Spacer(0);
|
||||||
|
|
||||||
if (disabled) {
|
if (disabled) {
|
||||||
DisableComponentSwitch(disabledTooltipText, alpha);
|
DisableComponentSwitch(disabledTooltipText, alpha);
|
||||||
@ -305,13 +306,23 @@ namespace UIWidgets {
|
|||||||
DisableComponentSwitch(disabledTooltipText, alpha);
|
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))
|
if (ImGui::SliderInt(id, &val, min, max, format))
|
||||||
{
|
{
|
||||||
CVar_SetS32(cvarName, val);
|
CVar_SetS32(cvarName, val);
|
||||||
SohImGui::RequestCvarSaveOnNextTick();
|
SohImGui::RequestCvarSaveOnNextTick();
|
||||||
}
|
}
|
||||||
|
if (PlusMinusButton) {
|
||||||
|
ImGui::PopItemWidth();
|
||||||
|
}
|
||||||
if(PlusMinusButton) {
|
if(PlusMinusButton) {
|
||||||
if (disabled) {
|
if (disabled) {
|
||||||
DisableComponentSwitch(disabledTooltipText, alpha);
|
DisableComponentSwitch(disabledTooltipText, alpha);
|
||||||
@ -364,9 +375,7 @@ namespace UIWidgets {
|
|||||||
} else {
|
} else {
|
||||||
ImGui::Text(text, static_cast<int>(100 * val));
|
ImGui::Text(text, static_cast<int>(100 * val));
|
||||||
}
|
}
|
||||||
|
|
||||||
Spacer(0);
|
Spacer(0);
|
||||||
|
|
||||||
if(PlusMinusButton) {
|
if(PlusMinusButton) {
|
||||||
std::string MinusBTNName = " - ##";
|
std::string MinusBTNName = " - ##";
|
||||||
MinusBTNName += cvarName;
|
MinusBTNName += cvarName;
|
||||||
|
Loading…
Reference in New Issue
Block a user