1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-17 19:44:22 +08:00
Commit Graph

6 Commits

  • Refactor ShearedButton to allow easier relative sizing (#36802)
    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>
  • Refactor TestSceneScreenFooter to test entire OsuScreens (#36718)
    Part of the `ScreenFooter` refactor, which intends to move the footer
    content handling to `OsuScreen`. This commit updates the `ScreenFooter`
    test to operate on entire `OsuScreen`s, in order to better test the
    entire flow of pushing a screen, and having it create and add its own
    content to the footer.
    
    This should be 80-90% identical to the original test case structure
    wise, just that instead of manually manipulating the footer with
    `SetButtons()`, various screens with the appropriate buttons are being
    moved around the screen stack.
    
    Additionally this adds some more tests handling common use cases, as
    well as removes `TestLoadOverlayAfterFooterIsDisplayed()`, since as far
    as I understand the behaviour described in it doesn't actually happen in
    production code. From what I can see, Screens instantiate their overlays
    in `load()`, and then register them in `LoadComplete()`. There seems to
    be no case where a `ShearedOverlayContainer` is created in the middle of
    a screen's lifecycle.
  • Fix intermittent footer test failures
    See:
    https://github.com/ppy/osu/pull/35367/checks?check_run_id=53269836615
    
    Can be reproed via a `Thread.Sleep(1000)` in a `TestScreenOne` BDL load.
    Code here is similar to `OsuGameTestScene.PushAndConfirm()`.