Use fixed numbers for padding instead

This commit is contained in:
Joehu
2019-10-07 16:11:40 -07:00
parent 11d937beab
commit 8e6e90eaec
2 changed files with 4 additions and 13 deletions

View File

@ -18,7 +18,6 @@ namespace osu.Game.Overlays.SearchableList
private const float padding = 10; private const float padding = 10;
private readonly Container filterContainer; private readonly Container filterContainer;
private readonly Container tabsContainer;
private readonly Box tabStrip; private readonly Box tabStrip;
public readonly SearchTextBox Search; public readonly SearchTextBox Search;
@ -86,10 +85,11 @@ namespace osu.Game.Overlays.SearchableList
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
Margin = new MarginPadding { Top = controls != null ? padding : 0 }, Margin = new MarginPadding { Top = controls != null ? padding : 0 },
}, },
tabsContainer = new Container new Container
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
Padding = new MarginPadding { Right = 225 },
Child = Tabs = new PageTabControl<T> Child = Tabs = new PageTabControl<T>
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
@ -133,8 +133,6 @@ namespace osu.Game.Overlays.SearchableList
Height = filterContainer.Height; Height = filterContainer.Height;
DisplayStyleControl.Margin = new MarginPadding { Top = filterContainer.Height - 35, Right = SearchableListOverlay.WIDTH_PADDING }; DisplayStyleControl.Margin = new MarginPadding { Top = filterContainer.Height - 35, Right = SearchableListOverlay.WIDTH_PADDING };
tabsContainer.Padding = new MarginPadding { Right = DisplayStyleControl.Width };
} }
private class FilterSearchTextBox : SearchTextBox private class FilterSearchTextBox : SearchTextBox

View File

@ -20,7 +20,6 @@ namespace osu.Game.Screens.Select
public static readonly float HEIGHT = 24; public static readonly float HEIGHT = 24;
private readonly OsuTabControlCheckbox modsCheckbox; private readonly OsuTabControlCheckbox modsCheckbox;
private readonly OsuTabControl<BeatmapDetailTab> tabs; private readonly OsuTabControl<BeatmapDetailTab> tabs;
private readonly Container tabsContainer;
public Action<BeatmapDetailTab, bool> OnFilter; //passed the selected tab and if mods is checked public Action<BeatmapDetailTab, bool> OnFilter; //passed the selected tab and if mods is checked
@ -40,9 +39,10 @@ namespace osu.Game.Screens.Select
Height = 1, Height = 1,
Colour = Color4.White.Opacity(0.2f), Colour = Color4.White.Opacity(0.2f),
}, },
tabsContainer = new Container new Container
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding { Right = 100 },
Child = tabs = new OsuTabControl<BeatmapDetailTab> Child = tabs = new OsuTabControl<BeatmapDetailTab>
{ {
Anchor = Anchor.BottomLeft, Anchor = Anchor.BottomLeft,
@ -74,13 +74,6 @@ namespace osu.Game.Screens.Select
tabs.Current.TriggerChange(); tabs.Current.TriggerChange();
} }
protected override void Update()
{
base.Update();
tabsContainer.Padding = new MarginPadding { Right = modsCheckbox.Width };
}
private void invokeOnFilter() private void invokeOnFilter()
{ {
OnFilter?.Invoke(tabs.Current.Value, modsCheckbox.Current.Value); OnFilter?.Invoke(tabs.Current.Value, modsCheckbox.Current.Value);