Esempio n. 1
0
        public ProgressNotification()
        {
            IconContent.Add(new Box
            {
                RelativeSizeAxes = Axes.Both,
            });

            Content.Add(textDrawable = new OsuTextFlowContainer(t =>
            {
                t.TextSize = 16;
            })
            {
                Colour           = OsuColour.Gray(128),
                AutoSizeAxes     = Axes.Y,
                RelativeSizeAxes = Axes.X,
            });

            NotificationContent.Add(progressBar = new ProgressBar
            {
                Origin           = Anchor.BottomLeft,
                Anchor           = Anchor.BottomLeft,
                RelativeSizeAxes = Axes.X,
            });

            State = ProgressNotificationState.Queued;

            // don't close on click by default.
            Activated = () => false;
        }
Esempio n. 2
0
        public override void Close()
        {
            switch (State)
            {
            case ProgressNotificationState.Cancelled:
                base.Close();
                break;

            case ProgressNotificationState.Active:
            case ProgressNotificationState.Queued:
                State = ProgressNotificationState.Cancelled;
                break;
            }
        }
Esempio n. 3
0
        public override void Close()
        {
            switch (State)
            {
            case ProgressNotificationState.Cancelled:
                base.Close();
                break;

            case ProgressNotificationState.Active:
            case ProgressNotificationState.Queued:
                if (CancelRequested?.Invoke() != false)
                {
                    State = ProgressNotificationState.Cancelled;
                }
                break;
            }
        }
Esempio n. 4
0
        public ProgressNotification()
        {
            IconContent.Add(new Box
            {
                RelativeSizeAxes = Axes.Both,
            });

            Content.Add(textDrawable = new OsuSpriteText
            {
                TextSize         = 16,
                Colour           = OsuColour.Gray(128),
                AutoSizeAxes     = Axes.Y,
                RelativeSizeAxes = Axes.X,
            });

            NotificationContent.Add(progressBar = new ProgressBar
            {
                Origin           = Anchor.BottomLeft,
                Anchor           = Anchor.BottomLeft,
                RelativeSizeAxes = Axes.X,
            });

            State = ProgressNotificationState.Queued;
        }