Fix dropdown header padding when selected mod filter is hidden

This commit is contained in:
Joehu 2019-10-07 16:17:58 -07:00
parent 8e6e90eaec
commit 9fdbe58326
1 changed files with 4 additions and 2 deletions

View File

@ -20,6 +20,7 @@ public class BeatmapDetailAreaTabControl : Container
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
@ -39,10 +40,9 @@ public BeatmapDetailAreaTabControl()
Height = 1, Height = 1,
Colour = Color4.White.Opacity(0.2f), Colour = Color4.White.Opacity(0.2f),
}, },
new Container tabsContainer = 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,
@ -79,6 +79,8 @@ private void invokeOnFilter()
OnFilter?.Invoke(tabs.Current.Value, modsCheckbox.Current.Value); OnFilter?.Invoke(tabs.Current.Value, modsCheckbox.Current.Value);
modsCheckbox.FadeTo(tabs.Current.Value == BeatmapDetailTab.Details ? 0 : 1, 200, Easing.OutQuint); modsCheckbox.FadeTo(tabs.Current.Value == BeatmapDetailTab.Details ? 0 : 1, 200, Easing.OutQuint);
tabsContainer.Padding = new MarginPadding { Right = tabs.Current.Value == BeatmapDetailTab.Details ? 0 : 100 };
} }
} }