mirror of
https://github.com/osukey/osukey.git
synced 2025-05-08 07:07:18 +09:00
Use BindTarget
instead of caching for ControlItem
unread flow
This commit is contained in:
parent
49b74d7867
commit
e38d9eafa0
@ -22,7 +22,6 @@ namespace osu.Game.Overlays.Chat.ChannelControl
|
||||
|
||||
public readonly BindableInt Mentions = new BindableInt();
|
||||
|
||||
[Cached]
|
||||
public readonly BindableBool Unread = new BindableBool();
|
||||
|
||||
private readonly Channel channel;
|
||||
@ -85,6 +84,7 @@ namespace osu.Game.Overlays.Chat.ChannelControl
|
||||
{
|
||||
Anchor = Anchor.CentreLeft,
|
||||
Origin = Anchor.CentreLeft,
|
||||
Unread = { BindTarget = Unread },
|
||||
},
|
||||
new ControlItemMention
|
||||
{
|
||||
|
@ -15,13 +15,12 @@ namespace osu.Game.Overlays.Chat.ChannelControl
|
||||
{
|
||||
public class ControlItemText : Container
|
||||
{
|
||||
public readonly BindableBool Unread = new BindableBool();
|
||||
|
||||
private readonly Channel channel;
|
||||
|
||||
private OsuSpriteText? text;
|
||||
|
||||
[Resolved]
|
||||
private BindableBool unread { get; set; } = null!;
|
||||
|
||||
[Resolved]
|
||||
private OverlayColourProvider colourProvider { get; set; } = null!;
|
||||
|
||||
@ -51,7 +50,7 @@ namespace osu.Game.Overlays.Chat.ChannelControl
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
unread.BindValueChanged(change =>
|
||||
Unread.BindValueChanged(change =>
|
||||
{
|
||||
text!.Colour = change.NewValue ? colourProvider.Content1 : colourProvider.Light3;
|
||||
}, true);
|
||||
|
Loading…
x
Reference in New Issue
Block a user