private void load(TestBrowser browser) { Padding = new MarginPadding { Horizontal = 5 }; BasicSliderBar <double> rateAdjustSlider; SpriteText rateText; ClickableContainer clickableReset; InternalChild = new GridContainer { RelativeSizeAxes = Axes.Both, ColumnDimensions = new[] { new Dimension(GridSizeMode.AutoSize), new Dimension(GridSizeMode.AutoSize), new Dimension(), }, Content = new[] { new Drawable[] { new SpriteText { Padding = new MarginPadding(5) { Right = 0 }, Text = "Rate:", Font = FrameworkFont.Condensed }, clickableReset = new ClickableContainer { AutoSizeAxes = Axes.Both, Child = rateText = new SpriteText { Padding = new MarginPadding(5), Width = 45, Colour = FrameworkColour.Yellow, Font = FrameworkFont.Condensed }, }, rateAdjustSlider = new BasicSliderBar <double> { RelativeSizeAxes = Axes.Both, Current = browser.PlaybackRate }, } } }; rateAdjustSlider.Current.BindValueChanged(e => rateText.Text = e.NewValue.ToString("0%"), true); clickableReset.Action = () => rateAdjustSlider.Current.SetDefault(); }
public WedgeButton() { Child = new Container { Anchor = Anchor.BottomLeft, Origin = Anchor.BottomCentre, RelativeSizeAxes = Axes.Y, Width = 100, Shear = new Vector2(-0.1f, 0), Masking = true, Child = clickCon = new ClickableContainer { Shear = new Vector2(0.1f, 0), Anchor = Anchor.BottomRight, Origin = Anchor.BottomRight, Size = new Vector2(wedge_width * 1.1f), Action = () => Action?.Invoke(), Masking = true, EdgeEffect = new EdgeEffectParameters { Colour = Color4.Black.Opacity(0.05f), Type = EdgeEffectType.Shadow, Radius = 10 }, Children = new Drawable[] { background = new Box { Anchor = Anchor.BottomRight, Origin = Anchor.BottomRight, RelativeSizeAxes = Axes.Both, Shear = new Vector2(-0.05f, 0.05f), Width = 0.95f, Colour = ActiveColour, EdgeSmoothness = Vector2.One }, new Box { Anchor = Anchor.BottomRight, Origin = Anchor.BottomRight, RelativeSizeAxes = Axes.Both, Shear = new Vector2(-0.05f, 0.05f), Width = 0.95f, Colour = Color4.White.Opacity(0.1f), Alpha = 0 }, ButtonIcon = new SpriteIcon { RelativeSizeAxes = Axes.Both, Y = -10, Anchor = Anchor.Centre, Origin = Anchor.Centre, FillMode = FillMode.Fit, Colour = Color4.White }, buttonText = new SpriteText { Y = 25, Shadow = true, AllowMultiline = false, Anchor = Anchor.Centre, Origin = Anchor.Centre, TextSize = 20 } } } }; buttonText.Hide(); }
public SymWindow(Vector2 size) { Container topBar; Anchor = Anchor.Centre; Origin = Anchor.Centre; CornerRadius = 6; Masking = true; AutoSizeAxes = Axes.Both; Children = new Drawable[] { topBar = new Container { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Height = 20, Width = size.X, Children = new Drawable[] { new Box { Colour = Color4.Black, RelativeSizeAxes = Axes.Both, Alpha = 0.5f }, WindowTitle = new SpriteText { Anchor = Anchor.Centre, Origin = Anchor.Centre, TextSize = 18 }, new ClickableContainer { Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, RelativeSizeAxes = Axes.Y, Width = 30, Action = Close, Child = new Box { Colour = Color4.Red, RelativeSizeAxes = Axes.Both, Alpha = 0.5f } }, minimize = new ClickableContainer { Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, RelativeSizeAxes = Axes.Y, Width = 30, Position = new Vector2(-30, 0), Action = Minimize, Child = new Box { Colour = Color4.White, RelativeSizeAxes = Axes.Both, Alpha = 0.5f } } } }, WindowContent = new Container { Size = size, Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre } }; WindowContent.Position = new Vector2(0, topBar.Height); }