private void load(ConfigColourProvider colourProvider) { var colour = colourProvider.GetContentColour(this); // set header box and text to target color. var headerBox = InternalChildren.FirstOrDefault(); var title = (InternalChildren.LastOrDefault() as Container)?.Children?.FirstOrDefault(); if (headerBox == null || title == null) { return; } headerBox.Colour = colour; title.Colour = colour; }
public Header() { RelativeSizeAxes = Axes.X; Height = HEIGHT; Children = new Drawable[] { background = new Box { RelativeSizeAxes = Axes.Both, Colour = Color4Extensions.FromHex(@"#1f1921"), }, new Container { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Left = 10 }, Children = new Drawable[] { title = new KaraokeConfigHeaderTitle { Anchor = Anchor.CentreLeft, Origin = Anchor.BottomLeft, }, tabs = new KaraokeConfigPageTabControl { Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft, RelativeSizeAxes = Axes.X, Scale = new Vector2(1.5f) }, }, }, }; tabs.Current.BindValueChanged(x => { background.Delay(200).Then().FadeColour(colourProvider.GetBackground2Colour(x.NewValue), 500); tabs.Colour = colourProvider.GetContent2Colour(x.NewValue); tabs.StripColour = colourProvider.GetContentColour(x.NewValue); }); }