mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 07:33:55 +09:00
Update dependencies
This commit is contained in:
@ -18,7 +18,7 @@ namespace osu.Game.Overlays.Comments
|
||||
private readonly CommentableType type;
|
||||
private readonly long id;
|
||||
|
||||
public readonly Bindable<SortCommentsBy> Sort = new Bindable<SortCommentsBy>();
|
||||
public readonly Bindable<CommentsSortCriteria> Sort = new Bindable<CommentsSortCriteria>();
|
||||
public readonly BindableBool ShowDeleted = new BindableBool();
|
||||
|
||||
[Resolved]
|
||||
@ -74,7 +74,7 @@ namespace osu.Game.Overlays.Comments
|
||||
base.LoadComplete();
|
||||
}
|
||||
|
||||
private void onSortChanged(ValueChangedEvent<SortCommentsBy> sort) => getComments();
|
||||
private void onSortChanged(ValueChangedEvent<CommentsSortCriteria> sort) => getComments();
|
||||
|
||||
private void getComments()
|
||||
{
|
||||
|
@ -20,7 +20,7 @@ namespace osu.Game.Overlays.Comments
|
||||
private const int padding = 50;
|
||||
private const int text_size = 14;
|
||||
|
||||
public readonly Bindable<SortCommentsBy> Sort = new Bindable<SortCommentsBy>();
|
||||
public readonly Bindable<CommentsSortCriteria> Sort = new Bindable<CommentsSortCriteria>();
|
||||
public readonly BindableBool ShowDeleted = new BindableBool();
|
||||
|
||||
private readonly Box background;
|
||||
@ -79,13 +79,11 @@ namespace osu.Game.Overlays.Comments
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
{
|
||||
background.Colour = colours.Gray4;
|
||||
background.Colour = colours.Gray3;
|
||||
}
|
||||
|
||||
private class ShowDeletedButton : HeaderButton
|
||||
{
|
||||
private const int spacing = 5;
|
||||
|
||||
public readonly BindableBool Checked = new BindableBool();
|
||||
|
||||
private readonly SpriteIcon checkboxIcon;
|
||||
@ -96,7 +94,7 @@ namespace osu.Game.Overlays.Comments
|
||||
{
|
||||
AutoSizeAxes = Axes.Both,
|
||||
Direction = FillDirection.Horizontal,
|
||||
Spacing = new Vector2(spacing, 0),
|
||||
Spacing = new Vector2(5, 0),
|
||||
Children = new Drawable[]
|
||||
{
|
||||
checkboxIcon = new SpriteIcon
|
||||
|
@ -50,7 +50,7 @@ namespace osu.Game.Overlays.Comments
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
{
|
||||
background.Colour = colours.Gray6;
|
||||
background.Colour = colours.Gray4;
|
||||
}
|
||||
|
||||
protected override bool OnHover(HoverEvent e)
|
||||
@ -65,8 +65,8 @@ namespace osu.Game.Overlays.Comments
|
||||
FadeOutBackground();
|
||||
}
|
||||
|
||||
public void FadeInBackground() => background.FadeIn(duration, Easing.OutQuint);
|
||||
protected void FadeInBackground() => background.FadeIn(duration, Easing.OutQuint);
|
||||
|
||||
public void FadeOutBackground() => background.FadeOut(duration, Easing.OutQuint);
|
||||
protected void FadeOutBackground() => background.FadeOut(duration, Easing.OutQuint);
|
||||
}
|
||||
}
|
||||
|
@ -10,16 +10,18 @@ using osuTK;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Framework.Input.Events;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Allocation;
|
||||
using osuTK.Graphics;
|
||||
|
||||
namespace osu.Game.Overlays.Comments
|
||||
{
|
||||
public class SortSelector : OsuTabControl<SortCommentsBy>
|
||||
public class SortSelector : OsuTabControl<CommentsSortCriteria>
|
||||
{
|
||||
private const int spacing = 5;
|
||||
|
||||
protected override Dropdown<SortCommentsBy> CreateDropdown() => null;
|
||||
protected override Dropdown<CommentsSortCriteria> CreateDropdown() => null;
|
||||
|
||||
protected override TabItem<SortCommentsBy> CreateTabItem(SortCommentsBy value) => new SortTabItem(value);
|
||||
protected override TabItem<CommentsSortCriteria> CreateTabItem(CommentsSortCriteria value) => new SortTabItem(value);
|
||||
|
||||
protected override TabFillFlowContainer CreateTabFlow() => new TabFillFlowContainer
|
||||
{
|
||||
@ -33,21 +35,23 @@ namespace osu.Game.Overlays.Comments
|
||||
AutoSizeAxes = Axes.Both;
|
||||
}
|
||||
|
||||
private class SortTabItem : TabItem<SortCommentsBy>
|
||||
private class SortTabItem : TabItem<CommentsSortCriteria>
|
||||
{
|
||||
private readonly TabContent content;
|
||||
|
||||
public SortTabItem(SortCommentsBy value)
|
||||
public SortTabItem(CommentsSortCriteria value)
|
||||
: base(value)
|
||||
{
|
||||
AutoSizeAxes = Axes.Both;
|
||||
Child = content = new TabContent(value)
|
||||
{ Active = { BindTarget = Active } };
|
||||
{
|
||||
Active = { BindTarget = Active }
|
||||
};
|
||||
}
|
||||
|
||||
protected override void OnActivated() => content.FadeInBackground();
|
||||
protected override void OnActivated() => content.Activate();
|
||||
|
||||
protected override void OnDeactivated() => content.FadeOutBackground();
|
||||
protected override void OnDeactivated() => content.Deactivate();
|
||||
|
||||
private class TabContent : HeaderButton
|
||||
{
|
||||
@ -55,15 +59,36 @@ namespace osu.Game.Overlays.Comments
|
||||
|
||||
public readonly BindableBool Active = new BindableBool();
|
||||
|
||||
public TabContent(SortCommentsBy value)
|
||||
[Resolved]
|
||||
private OsuColour colours { get; set; }
|
||||
|
||||
private readonly SpriteText text;
|
||||
|
||||
public TabContent(CommentsSortCriteria value)
|
||||
{
|
||||
Add(new SpriteText
|
||||
Add(text = new SpriteText
|
||||
{
|
||||
Font = OsuFont.GetFont(size: text_size),
|
||||
Text = value.ToString()
|
||||
});
|
||||
}
|
||||
|
||||
public void Activate()
|
||||
{
|
||||
FadeInBackground();
|
||||
text.Font = text.Font.With(weight: FontWeight.Bold);
|
||||
text.Colour = colours.BlueLighter;
|
||||
}
|
||||
|
||||
public void Deactivate()
|
||||
{
|
||||
if (!IsHovered)
|
||||
FadeOutBackground();
|
||||
|
||||
text.Font = text.Font.With(weight: FontWeight.Medium);
|
||||
text.Colour = Color4.White;
|
||||
}
|
||||
|
||||
protected override void OnHoverLost(HoverLostEvent e)
|
||||
{
|
||||
if (!Active.Value) base.OnHoverLost(e);
|
||||
@ -72,7 +97,7 @@ namespace osu.Game.Overlays.Comments
|
||||
}
|
||||
}
|
||||
|
||||
public enum SortCommentsBy
|
||||
public enum CommentsSortCriteria
|
||||
{
|
||||
New,
|
||||
Old,
|
||||
|
Reference in New Issue
Block a user