Ejemplo n.º 1
0
        protected override void LoadComplete()
        {
            base.LoadComplete();

            DownloadTracker.State.BindValueChanged(_ => UpdateState());
            Expanded.BindValueChanged(_ => UpdateState(), true);
            FinishTransforms(true);
        }
Ejemplo n.º 2
0
        protected override void LoadComplete()
        {
            base.LoadComplete();

            Expanded.BindValueChanged(v =>
            {
                this.ResizeWidthTo(v.NewValue ? expandedWidth : contractedWidth, 500, Easing.OutQuint);
            }, true);
        }
Ejemplo n.º 3
0
        protected override void LoadComplete()
        {
            base.LoadComplete();

            expandingContainer?.Expanded.BindValueChanged(containerExpanded =>
            {
                if (containerExpanded.NewValue && !Expanded.Value)
                {
                    Expanded.Value      = true;
                    expandedByContainer = true;
                }
                else if (!containerExpanded.NewValue && expandedByContainer)
                {
                    Expanded.Value      = false;
                    expandedByContainer = false;
                }

                updateActiveState();
            }, true);

            Expanded.BindValueChanged(v =>
            {
                // clearing transforms can break autosizing, see: https://github.com/ppy/osu-framework/issues/5064
                if (v.NewValue != v.OldValue)
                {
                    content.ClearTransforms();
                }

                if (v.NewValue)
                {
                    content.AutoSizeAxes = Axes.Y;
                }
                else
                {
                    content.AutoSizeAxes = Axes.None;
                    content.ResizeHeightTo(0, transition_duration, Easing.OutQuint);
                }

                button.FadeColour(Expanded.Value ? expandedColour : Color4.White, 200, Easing.InOutQuint);
            }, true);

            this.Delay(600).Schedule(updateActiveState);
        }
Ejemplo n.º 4
0
        protected override void LoadComplete()
        {
            base.LoadComplete();

            expandingContainer?.Expanded.BindValueChanged(containerExpanded =>
            {
                if (containerExpanded.NewValue && !Expanded.Value)
                {
                    Expanded.Value      = true;
                    expandedByContainer = true;
                }
                else if (!containerExpanded.NewValue && expandedByContainer)
                {
                    Expanded.Value      = false;
                    expandedByContainer = false;
                }

                updateActiveState();
            }, true);

            Expanded.BindValueChanged(v =>
            {
                content.ClearTransforms();

                if (v.NewValue)
                {
                    content.AutoSizeAxes = Axes.Y;
                }
                else
                {
                    content.AutoSizeAxes = Axes.None;
                    content.ResizeHeightTo(0, transition_duration, Easing.OutQuint);
                }

                button.FadeColour(Expanded.Value ? expandedColour : Color4.White, 200, Easing.InOutQuint);
            }, true);

            this.Delay(600).Schedule(updateActiveState);
        }