Skip to content

Commit

Permalink
Merge pull request #28201 from frenzibyte/fix-settings-padding
Browse files Browse the repository at this point in the history
Fix checkboxes looking misaligned when placed next to a slider bar
  • Loading branch information
peppy authored May 19, 2024
2 parents 9c559d9 + a912e56 commit 9fcd3b5
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions osu.Game/Graphics/UserInterface/OsuCheckbox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ public OsuCheckbox(bool nubOnRight = true, float nubSize = Nub.DEFAULT_EXPANDED_
AutoSizeAxes = Axes.Y;
RelativeSizeAxes = Axes.X;

const float nub_padding = 5;

Children = new Drawable[]
{
LabelTextFlowContainer = new OsuTextFlowContainer(ApplyLabelParameters)
Expand All @@ -69,15 +67,13 @@ public OsuCheckbox(bool nubOnRight = true, float nubSize = Nub.DEFAULT_EXPANDED_
{
Nub.Anchor = Anchor.CentreRight;
Nub.Origin = Anchor.CentreRight;
Nub.Margin = new MarginPadding { Right = nub_padding };
LabelTextFlowContainer.Padding = new MarginPadding { Right = Nub.DEFAULT_EXPANDED_SIZE + nub_padding * 2 };
LabelTextFlowContainer.Padding = new MarginPadding { Right = Nub.DEFAULT_EXPANDED_SIZE + 10f };
}
else
{
Nub.Anchor = Anchor.CentreLeft;
Nub.Origin = Anchor.CentreLeft;
Nub.Margin = new MarginPadding { Left = nub_padding };
LabelTextFlowContainer.Padding = new MarginPadding { Left = Nub.DEFAULT_EXPANDED_SIZE + nub_padding * 2 };
LabelTextFlowContainer.Padding = new MarginPadding { Left = Nub.DEFAULT_EXPANDED_SIZE + 10f };
}

Nub.Current.BindTo(Current);
Expand Down

0 comments on commit 9fcd3b5

Please sign in to comment.