Refactor ShearedButton to allow easier relative sizing#36802
Merged
peppy merged 3 commits intoppy:masterfrom Mar 5, 2026
Merged
Refactor ShearedButton to allow easier relative sizing#36802peppy merged 3 commits intoppy:masterfrom
ShearedButton to allow easier relative sizing#36802peppy merged 3 commits intoppy:masterfrom
Conversation
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. With 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`.
LiquidPL
added a commit
to LiquidPL/osu
that referenced
this pull request
Mar 5, 2026
Related to (but shouldn't depend on) ppy#36802. Depends on ppy/osu-resources#408. Pushing this ahead of time mostly to set the new icon on the add to playlist button.
LiquidPL
added a commit
to LiquidPL/osu
that referenced
this pull request
Mar 5, 2026
Related to (but shouldn't depend on) ppy#36802. Depends on ppy/osu-resources#408. Pushing this ahead of time mostly to set the new icon on the add to playlist button.
LiquidPL
added a commit
to LiquidPL/osu
that referenced
this pull request
Mar 5, 2026
Depends on ppy#36802 and ppy/osu-resources#408. Pushing this ahead of time mostly to set the new icon on the add to playlist button.
LiquidPL
added a commit
to LiquidPL/osu
that referenced
this pull request
Mar 5, 2026
Depends on ppy#36802 and ppy/osu-resources#408. This moves out the common layout from `AddToPlaylistFooterButton` to a separate `ShearedFooterButton`, that is intended to be used in other screens which I'm currently working on migrating them to the new footer. It also adds a new 'add' icon to be used on the playlists button. Pushing this ahead of time (without any other buttons using it yet) mostly to get the new icon on the add to playlist button. I've set the icon size to `20`. Could get it smaller, howvever I think it should be a *bit* taller than the button label.
peppy
approved these changes
Mar 5, 2026
LiquidPL
added a commit
to LiquidPL/osu
that referenced
this pull request
Mar 13, 2026
Depends on ppy#36802 and ppy/osu-resources#408. This moves out the common layout from `AddToPlaylistFooterButton` to a separate `ShearedFooterButton`, that is intended to be used in other screens which I'm currently working on migrating them to the new footer. It also adds a new 'add' icon to be used on the playlists button. Pushing this ahead of time (without any other buttons using it yet) mostly to get the new icon on the add to playlist button. I've set the icon size to `20`. Could get it smaller, howvever I think it should be a *bit* taller than the button label.
This was referenced Mar 16, 2026
LiquidPL
added a commit
to LiquidPL/osu
that referenced
this pull request
Mar 23, 2026
Depends on ppy#36802 and ppy/osu-resources#408. This moves out the common layout from `AddToPlaylistFooterButton` to a separate `ShearedFooterButton`, that is intended to be used in other screens which I'm currently working on migrating them to the new footer. It also adds a new 'add' icon to be used on the playlists button. Pushing this ahead of time (without any other buttons using it yet) mostly to get the new icon on the add to playlist button. I've set the icon size to `20`. Could get it smaller, howvever I think it should be a *bit* taller than the button label. # Conflicts: # osu.Game/Screens/OnlinePlay/Playlists/AddToPlaylistFooterButton.cs
This was referenced Apr 6, 2026
This was referenced Apr 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit rearranges the contents of
ShearedButtonsto 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
ShearedButtons currently in use set their width explicitly, I did not setAutoSizeAxes = Axes.Xlike 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 noWidthis 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.