Skip to content

Commit

Permalink
center all inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
misternebula committed Feb 19, 2024
1 parent 2b2fd15 commit 99a07ab
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/OWML.ModHelper.Menus/NewMenuSystem/OptionsMenuManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,10 @@ public IOWMLToggleElement AddCheckboxInput(Menu menu, string label, string toolt
menu._selectOnActivate = newCheckbox.GetComponent<Selectable>();
}

var labelBlock = newCheckbox.transform.Find("HorizontalLayoutGroup").Find("LabelBlock").GetComponent<LayoutElement>();
labelBlock.minWidth = 860;
labelBlock.preferredWidth = -1;

return customCheckboxScript;
}

Expand Down Expand Up @@ -296,6 +300,10 @@ public IOWMLTwoButtonToggleElement AddToggleInput(Menu menu, string label, strin
menu._selectOnActivate = newToggle.GetComponent<Selectable>();
}

var labelBlock = newScript.transform.Find("HorizontalLayoutGroup").Find("LabelBlock").GetComponent<LayoutElement>();
labelBlock.minWidth = 860;
labelBlock.preferredWidth = -1;

return newScript;
}

Expand Down Expand Up @@ -339,6 +347,10 @@ public IOWMLOptionsSelectorElement AddSelectorInput(Menu menu, string label, str

newSelector.SetActive(true);

var labelBlock = newScript.transform.Find("HorizontalLayoutGroup").Find("LabelBlock").GetComponent<LayoutElement>();
labelBlock.minWidth = 860;
labelBlock.preferredWidth = -1;

return newScript;
}

Expand Down Expand Up @@ -373,6 +385,10 @@ public IOWMLSliderElement AddSliderInput(Menu menu, string label, float lower, f
menu._selectOnActivate = newSlider.GetComponent<Selectable>();
}

var labelBlock = newScript.transform.Find("HorizontalLayoutGroup").Find("Panel-Label").GetComponent<LayoutElement>();
labelBlock.minWidth = 860;
labelBlock.preferredWidth = -1;

return newScript;
}

Expand Down

0 comments on commit 99a07ab

Please sign in to comment.