public ThemedSlider() { var rail = new Spline { Id = "Rail" }; rail.AddNode(new SplinePoint { Position = new Vector2(0, 0.5f) }); rail.AddNode(new SplinePoint { Position = new Vector2(1, 0.5f) }); AddNode(rail); rail.ExpandToContainerWithAnchors(); var thumb = new Widget { Id = "Thumb", Size = new Vector2(8, 16), Pivot = Vector2.Half, }; AddNode(thumb); MinSize = new Vector2(30, 16); thumb.CompoundPresenter.Add(new SliderThumbPresenter()); CompoundPresenter.Add(new SliderPresenter()); }
public IPresenter Clone() { var r = new CompoundPresenter(); foreach (var i in this) { r.Add(i.Clone()); } return(r); }
public ThemedComboBox() { MinSize = Theme.Metrics.DefaultButtonSize; MaxHeight = Theme.Metrics.DefaultButtonSize.Y; CompoundPresenter.Add(new ThemedDropDownList.DropDownListPresenter()); var editBox = new ThemedEditBox { Id = "TextWidget" }; AddNode(editBox); editBox.ExpandToContainerWithAnchors(); editBox.Width -= ThemedDropDownList.DropDownListPresenter.IconWidth; }
public ThemedDropDownList() { MinSize = Theme.Metrics.DefaultButtonSize; MaxHeight = Theme.Metrics.DefaultButtonSize.Y; TabTravesable = new TabTraversable(); var text = new ThemedSimpleText { Id = "TextWidget", VAlignment = VAlignment.Center, }; CompoundPresenter.Add(new DropDownListPresenter(this)); PostPresenter = new Theme.MouseHoverBorderPresenter(); LateTasks.Add(Theme.MouseHoverInvalidationTask(this)); Padding = Theme.Metrics.ControlsPadding; AddNode(text); text.ExpandToContainerWithAnchors(); text.X += 4; text.Width -= DropDownListPresenter.IconWidth + 4; }
public ThemedTabCloseButton() { var presenter = new VectorShapeButtonPresenter(new VectorShape { new VectorShape.Line(0.3f, 0.3f, 0.7f, 0.7f, Color4.White, 0.075f * 1.5f), new VectorShape.Line(0.3f, 0.7f, 0.7f, 0.3f, Color4.White, 0.0751f * 1.5f), }); fill = new WidgetFlatFillPresenter(Theme.Colors.CloseButtonFocusBorderNormal); LayoutCell = new LayoutCell(Alignment.Center, stretchX: 0); MinMaxSize = Theme.Metrics.CloseButtonSize; DefaultAnimation.AnimationEngine = new AnimationEngineDelegate { OnRunAnimation = (animation, markerId, animationTimeCorrection) => { presenter.SetState(markerId); return(true); } }; CompoundPresenter.Add(presenter); CompoundPresenter.Add(fill); }
public ThemedInvalidableWindowWidget(IWindow window) : base(window) { CompoundPresenter.Push(new WindowWidgetPresenter()); }
public ThemedDefaultWindowWidget(IWindow window) : base(window) { CompoundPresenter.Push(new WindowWidgetPresenter()); }
public ThemedFrame() { CompoundPresenter.Add(new ThemedFramePresenter(Theme.Colors.GrayBackground, Theme.Colors.ControlBorder)); }