protected override Size OnGetPreferredSize(SizeConstraint w, SizeConstraint h) { if (Widget != null) { var req = Widget.Surface.GetPreferredSize(); widget_alloc.Width = req.Width; widget_alloc.Height = req.Height; } if (horizontal) { Width = Choreographer.PixelCompose(percent, widget_alloc.Width + StartPadding + EndPadding, Easing); Height = widget_alloc.Height; } else { Width = widget_alloc.Width; Height = Choreographer.PixelCompose(percent, widget_alloc.Height + StartPadding + EndPadding, Easing); } return(new Size(Width, Height)); }
protected override void OnSizeRequested(ref Requisition requisition) { if (Widget != null) { Requisition req = Widget.SizeRequest(); widget_alloc.Width = req.Width; widget_alloc.Height = req.Height; } if (horizontal) { Width = Choreographer.PixelCompose(percent, widget_alloc.Width + StartPadding + EndPadding, Easing); Height = widget_alloc.Height; } else { Width = widget_alloc.Width; Height = Choreographer.PixelCompose(percent, widget_alloc.Height + StartPadding + EndPadding, Easing); } requisition.Width = Width; requisition.Height = Height; }
private void OnBorderIteration(object sender, EventArgs args) { if (border_stage.Actor == null) { if (border_state == AnimationState.Coming) { start_border = start_padding; end_border = end_padding; } else { start_border = end_border = 0; } border_state = AnimationState.Idle; } else { double percent = border_state == AnimationState.Coming ? Percent : 1.0 - Percent; start_border = Choreographer.PixelCompose(percent, start_padding, border_easing); end_border = Choreographer.PixelCompose(percent, end_padding, border_easing); } QueueResizeNoRedraw(); }