1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-13 21:53:22 +08:00

Merge pull request #30315 from OliBomby/popover-ux

Improve scale/rotate popover UX to better match user expectation
This commit is contained in:
Dean Herbert 2024-10-23 18:18:24 +09:00 committed by GitHub
commit ba4411f72c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 30 additions and 0 deletions

View File

@ -5,10 +5,13 @@ using System;
using System.Linq; using System.Linq;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Framework.Extensions;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Framework.Input.Events;
using osu.Game.Graphics.UserInterfaceV2; using osu.Game.Graphics.UserInterfaceV2;
using osu.Game.Input.Bindings;
using osu.Game.Rulesets.Osu.UI; using osu.Game.Rulesets.Osu.UI;
using osu.Game.Screens.Edit.Components.RadioButtons; using osu.Game.Screens.Edit.Components.RadioButtons;
using osu.Game.Screens.Edit.Compose.Components; using osu.Game.Screens.Edit.Compose.Components;
@ -55,6 +58,7 @@ namespace osu.Game.Rulesets.Osu.Edit
MaxValue = 360, MaxValue = 360,
Precision = 1 Precision = 1
}, },
KeyboardStep = 1f,
Instantaneous = true Instantaneous = true
}, },
rotationOrigin = new EditorRadioButtonCollection rotationOrigin = new EditorRadioButtonCollection
@ -126,6 +130,17 @@ namespace osu.Game.Rulesets.Osu.Edit
if (IsLoaded) if (IsLoaded)
rotationHandler.Commit(); rotationHandler.Commit();
} }
public override bool OnPressed(KeyBindingPressEvent<GlobalAction> e)
{
if (e.Action == GlobalAction.Select && !e.Repeat)
{
this.HidePopover();
return true;
}
return base.OnPressed(e);
}
} }
public enum RotationOrigin public enum RotationOrigin

View File

@ -5,11 +5,14 @@ using System;
using System.Linq; using System.Linq;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Framework.Extensions;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Framework.Input.Events;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osu.Game.Graphics.UserInterfaceV2; using osu.Game.Graphics.UserInterfaceV2;
using osu.Game.Input.Bindings;
using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Osu.Objects; using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Rulesets.Osu.UI; using osu.Game.Rulesets.Osu.UI;
@ -70,6 +73,7 @@ namespace osu.Game.Rulesets.Osu.Edit
Value = 1, Value = 1,
Default = 1, Default = 1,
}, },
KeyboardStep = 0.01f,
Instantaneous = true Instantaneous = true
}, },
scaleOrigin = new EditorRadioButtonCollection scaleOrigin = new EditorRadioButtonCollection
@ -282,6 +286,17 @@ namespace osu.Game.Rulesets.Osu.Edit
if (IsLoaded) scaleHandler.Commit(); if (IsLoaded) scaleHandler.Commit();
} }
public override bool OnPressed(KeyBindingPressEvent<GlobalAction> e)
{
if (e.Action == GlobalAction.Select && !e.Repeat)
{
this.HidePopover();
return true;
}
return base.OnPressed(e);
}
} }
public enum ScaleOrigin public enum ScaleOrigin