This commit rearranges the contents of `ShearedButtons` to be more
independent of each other in regards to sizing. Thanks to that, the
custom logic related to enabling autosizing is no longer necessary.
Witdh and height are no longer set via the constructor, and can be
freely configured using the initializer syntax.
Additionally, this allows the button to use relative sizing without
having to resort to any hackery with `Size` (this will come in handy for
me when implementing the new footer on multiplayer screens).
Given that most of the `ShearedButton`s currently in use set their width
explicitly, I did not set `AutoSizeAxes = Axes.X` like it would be by
default previously. Instead it is set on the only two such buttons (show
converts/selected mods on ssv2). I suppose it might be a good idea to
have it set that by default if no `Width` is specified, as right now
it'll just not show anything.
Also I've set the margin on the text field by default in all cases
instead of only when autosizing like how it was previously, since
otherwise it would be a pain to set that on each button instance when
needed. I've checked all affected components and could not find any text
overflowing issues that this could cause.
---------
Co-authored-by: Dean Herbert <pe@ppy.sh>
Closes https://github.com/ppy/osu/issues/33748.
I (and tests) can't find any regressions from this. One would hope we
aren't relying on fall-through mouse down anywhere beneath buttons..
Keep masking back in `Content`, since the scaling animation is happening
on `Content` instead of `this`. This doesn't regress the intended
behaviour in this PR (which is to just to make the button class itself
sheared instead of its content).
Saves having this defined in 20+ places. If we ever make any changes to
shear, it's 100% going to need to be applied to every usage (there will
never be a case of multiple different shears in the game).
Also fixes a mismatching definition in `ShearedNub`.
Also includes a test case in `TestSceneShearedButton`s to ensure the buttons' shear factors don't change on different heights (I've encountered issues with that previously).
The border would previously get brighter after click, but then dim
instantly when the flash layer has fully faded out. The underlying issue
there is https://github.com/ppy/osu-framework/issues/5191, but
`ShearedButton` was placing the flashing layer incorrectly anyway, as
the intent was that it should also apply to the border.