private void Pack(Widget widget, uint duration, Easing easing, Blocking blocking, bool end)
        {
            if (widget == null)
            {
                throw new ArgumentNullException("widget");
            }

            AnimatedWidget animated_widget = new AnimatedWidget(widget, duration, easing, blocking, horizontal);

            animated_widget.Parent           = this;
            animated_widget.WidgetDestroyed += OnWidgetDestroyed;
            stage.Add(animated_widget, duration);
            animated_widget.Node = end ? children.AddLast(animated_widget) : children.AddFirst(animated_widget);

            RecalculateSpacings();
            if (active_count == 0)
            {
                if (border_state == AnimationState.Going)
                {
                    border_bias = Percent;
                }
                else
                {
                    border_easing = easing;
                    border_bias   = 1.0;
                }
                border_state = AnimationState.Coming;
                border_stage.Reset((uint)(duration * border_bias));
            }
            active_count++;
        }
        public void Popup()
        {
            if (!IsComposited)
            {
                throw new InvalidOperationException("Only works with composited screen. Check Widget.IsComposited.");
            }

            var rgbaColormap = Screen.RgbaColormap;

            if (rgbaColormap == null)
            {
                return;
            }
            Colormap = rgbaColormap;

            int x, y;

            editor.GdkWindow.GetOrigin(out x, out y);
            Move(x + bounds.X - (int)(ExpandWidth / 2), y + bounds.Y - (int)(ExpandHeight / 2));
            Resize(bounds.Width + (int)ExpandWidth, bounds.Height + (int)ExpandHeight);

            stage.ActorStep += OnAnimationActorStep;
            stage.Iteration += OnAnimationIteration;

            stage.UpdateFrequency = 10;
            stage.Add(this, Duration);

            Show();
        }
Beispiel #3
0
        public void StartPulsing()
        {
            if (!Stage.Contains(Target))
            {
                Stage.Add(Target);
            }

            Stage[Target].CanExpire = false;
        }