private ChannelListItemCloseButton?createCloseButton() { if (isSelector) { return(null); } return(new ChannelListItemCloseButton { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, Margin = new MarginPadding { Right = 3 }, Action = () => OnRequestLeave?.Invoke(Channel), }); }
private void load() { Height = 30; RelativeSizeAxes = Axes.X; Children = new Drawable[] { hoverBox = new Box { RelativeSizeAxes = Axes.Both, Colour = colourProvider.Background3, Alpha = 0f, }, selectBox = new Box { RelativeSizeAxes = Axes.Both, Colour = colourProvider.Background4, Alpha = 0f, }, new Container { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Left = 18, Right = 10 }, Child = new GridContainer { RelativeSizeAxes = Axes.Both, ColumnDimensions = new[] { new Dimension(GridSizeMode.AutoSize), new Dimension(), new Dimension(GridSizeMode.AutoSize), new Dimension(GridSizeMode.AutoSize), }, Content = new[] { new[] { createIcon(), text = new OsuSpriteText { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, Text = channel.Name, Font = OsuFont.Torus.With(size: 17, weight: FontWeight.SemiBold), Colour = colourProvider.Light3, Margin = new MarginPadding { Bottom = 2 }, RelativeSizeAxes = Axes.X, Truncate = true, }, new ChannelListItemMentionPill { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, Margin = new MarginPadding { Right = 3 }, Mentions = { BindTarget = Mentions }, }, close = new ChannelListItemCloseButton { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, Margin = new MarginPadding { Right = 3 }, Action = () => OnRequestLeave?.Invoke(channel), } } }, }, }, }; Action = () => OnRequestSelect?.Invoke(channel); }