Skip to content

Commit

Permalink
Hide popover content when selecting background/audio in iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
frenzibyte committed Dec 7, 2024
1 parent 3e7005d commit ebfe417
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 16 deletions.
51 changes: 36 additions & 15 deletions osu.Game/Graphics/UserInterfaceV2/FormFileSelector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,8 @@ private partial class FileChooserPopover : OsuPopover
protected override string PopInSampleName => "UI/overlay-big-pop-in";
protected override string PopOutSampleName => "UI/overlay-big-pop-out";

private readonly FileSelector fileSelector;

public FileChooserPopover(string[] handledExtensions, Bindable<FileInfo?> currentFile, string? chooserPath)
: base(false)
{
Expand All @@ -264,7 +266,7 @@ public FileChooserPopover(string[] handledExtensions, Bindable<FileInfo?> curren
// simplest solution to avoid underlying text to bleed through the bottom border
// https://github.com/ppy/osu/pull/30005#issuecomment-2378884430
Padding = new MarginPadding { Bottom = 1 },
Child = new OsuFileSelector(chooserPath, handledExtensions)
Child = fileSelector = new FileSelector(chooserPath, handledExtensions)
{
RelativeSizeAxes = Axes.Both,
CurrentFile = { BindTarget = currentFile }
Expand All @@ -273,24 +275,43 @@ public FileChooserPopover(string[] handledExtensions, Bindable<FileInfo?> curren
}

[BackgroundDependencyLoader]
private void load(OverlayColourProvider colourProvider)
private void load()
{
Add(new Container
if (fileSelector.UsingSystemFileSelector)

Check failure on line 280 in osu.Game/Graphics/UserInterfaceV2/FormFileSelector.cs

View workflow job for this annotation

GitHub Actions / Test (Linux, ubuntu-latest, MultiThreaded)

'FormFileSelector.FileChooserPopover.FileSelector' does not contain a definition for 'UsingSystemFileSelector' and no accessible extension method 'UsingSystemFileSelector' accepting a first argument of type 'FormFileSelector.FileChooserPopover.FileSelector' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 280 in osu.Game/Graphics/UserInterfaceV2/FormFileSelector.cs

View workflow job for this annotation

GitHub Actions / Test (Linux, ubuntu-latest, MultiThreaded)

'FormFileSelector.FileChooserPopover.FileSelector' does not contain a definition for 'UsingSystemFileSelector' and no accessible extension method 'UsingSystemFileSelector' accepting a first argument of type 'FormFileSelector.FileChooserPopover.FileSelector' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 280 in osu.Game/Graphics/UserInterfaceV2/FormFileSelector.cs

View workflow job for this annotation

GitHub Actions / Test (Linux, ubuntu-latest, SingleThread)

'FormFileSelector.FileChooserPopover.FileSelector' does not contain a definition for 'UsingSystemFileSelector' and no accessible extension method 'UsingSystemFileSelector' accepting a first argument of type 'FormFileSelector.FileChooserPopover.FileSelector' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 280 in osu.Game/Graphics/UserInterfaceV2/FormFileSelector.cs

View workflow job for this annotation

GitHub Actions / Test (Linux, ubuntu-latest, SingleThread)

'FormFileSelector.FileChooserPopover.FileSelector' does not contain a definition for 'UsingSystemFileSelector' and no accessible extension method 'UsingSystemFileSelector' accepting a first argument of type 'FormFileSelector.FileChooserPopover.FileSelector' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 280 in osu.Game/Graphics/UserInterfaceV2/FormFileSelector.cs

View workflow job for this annotation

GitHub Actions / Code Quality

'FormFileSelector.FileChooserPopover.FileSelector' does not contain a definition for 'UsingSystemFileSelector' and no accessible extension method 'UsingSystemFileSelector' accepting a first argument of type 'FormFileSelector.FileChooserPopover.FileSelector' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 280 in osu.Game/Graphics/UserInterfaceV2/FormFileSelector.cs

View workflow job for this annotation

GitHub Actions / Code Quality

'FormFileSelector.FileChooserPopover.FileSelector' does not contain a definition for 'UsingSystemFileSelector' and no accessible extension method 'UsingSystemFileSelector' accepting a first argument of type 'FormFileSelector.FileChooserPopover.FileSelector' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 280 in osu.Game/Graphics/UserInterfaceV2/FormFileSelector.cs

View workflow job for this annotation

GitHub Actions / Build only (iOS)

'FormFileSelector.FileChooserPopover.FileSelector' does not contain a definition for 'UsingSystemFileSelector' and no accessible extension method 'UsingSystemFileSelector' accepting a first argument of type 'FormFileSelector.FileChooserPopover.FileSelector' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 280 in osu.Game/Graphics/UserInterfaceV2/FormFileSelector.cs

View workflow job for this annotation

GitHub Actions / Build only (iOS)

'FormFileSelector.FileChooserPopover.FileSelector' does not contain a definition for 'UsingSystemFileSelector' and no accessible extension method 'UsingSystemFileSelector' accepting a first argument of type 'FormFileSelector.FileChooserPopover.FileSelector' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 280 in osu.Game/Graphics/UserInterfaceV2/FormFileSelector.cs

View workflow job for this annotation

GitHub Actions / Test (Windows, windows-latest, MultiThreaded)

'FormFileSelector.FileChooserPopover.FileSelector' does not contain a definition for 'UsingSystemFileSelector' and no accessible extension method 'UsingSystemFileSelector' accepting a first argument of type 'FormFileSelector.FileChooserPopover.FileSelector' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 280 in osu.Game/Graphics/UserInterfaceV2/FormFileSelector.cs

View workflow job for this annotation

GitHub Actions / Test (Windows, windows-latest, MultiThreaded)

'FormFileSelector.FileChooserPopover.FileSelector' does not contain a definition for 'UsingSystemFileSelector' and no accessible extension method 'UsingSystemFileSelector' accepting a first argument of type 'FormFileSelector.FileChooserPopover.FileSelector' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 280 in osu.Game/Graphics/UserInterfaceV2/FormFileSelector.cs

View workflow job for this annotation

GitHub Actions / Test (Windows, windows-latest, SingleThread)

'FormFileSelector.FileChooserPopover.FileSelector' does not contain a definition for 'UsingSystemFileSelector' and no accessible extension method 'UsingSystemFileSelector' accepting a first argument of type 'FormFileSelector.FileChooserPopover.FileSelector' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 280 in osu.Game/Graphics/UserInterfaceV2/FormFileSelector.cs

View workflow job for this annotation

GitHub Actions / Test (Windows, windows-latest, SingleThread)

'FormFileSelector.FileChooserPopover.FileSelector' does not contain a definition for 'UsingSystemFileSelector' and no accessible extension method 'UsingSystemFileSelector' accepting a first argument of type 'FormFileSelector.FileChooserPopover.FileSelector' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 280 in osu.Game/Graphics/UserInterfaceV2/FormFileSelector.cs

View workflow job for this annotation

GitHub Actions / Build only (Android)

'FormFileSelector.FileChooserPopover.FileSelector' does not contain a definition for 'UsingSystemFileSelector' and no accessible extension method 'UsingSystemFileSelector' accepting a first argument of type 'FormFileSelector.FileChooserPopover.FileSelector' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 280 in osu.Game/Graphics/UserInterfaceV2/FormFileSelector.cs

View workflow job for this annotation

GitHub Actions / Build only (Android)

'FormFileSelector.FileChooserPopover.FileSelector' does not contain a definition for 'UsingSystemFileSelector' and no accessible extension method 'UsingSystemFileSelector' accepting a first argument of type 'FormFileSelector.FileChooserPopover.FileSelector' could be found (are you missing a using directive or an assembly reference?)
{
RelativeSizeAxes = Axes.Both,
Masking = true,
BorderThickness = 2,
CornerRadius = 10,
BorderColour = colourProvider.Highlight1,
Children = new Drawable[]
// keep present for FileSelector scheduling to still work.
Body.AlwaysPresent = true;
Body.Hide();
}
}

private partial class FileSelector : OsuFileSelector
{
public FileSelector(string? initialPath = null, string[]? validFileExtensions = null)
: base(initialPath, validFileExtensions)
{
}

[BackgroundDependencyLoader]
private void load(OverlayColourProvider colourProvider)
{
TopLevelContent.Add(new Container

Check failure on line 298 in osu.Game/Graphics/UserInterfaceV2/FormFileSelector.cs

View workflow job for this annotation

GitHub Actions / Test (Linux, ubuntu-latest, MultiThreaded)

The name 'TopLevelContent' does not exist in the current context

Check failure on line 298 in osu.Game/Graphics/UserInterfaceV2/FormFileSelector.cs

View workflow job for this annotation

GitHub Actions / Test (Linux, ubuntu-latest, MultiThreaded)

The name 'TopLevelContent' does not exist in the current context

Check failure on line 298 in osu.Game/Graphics/UserInterfaceV2/FormFileSelector.cs

View workflow job for this annotation

GitHub Actions / Test (Linux, ubuntu-latest, SingleThread)

The name 'TopLevelContent' does not exist in the current context

Check failure on line 298 in osu.Game/Graphics/UserInterfaceV2/FormFileSelector.cs

View workflow job for this annotation

GitHub Actions / Test (Linux, ubuntu-latest, SingleThread)

The name 'TopLevelContent' does not exist in the current context

Check failure on line 298 in osu.Game/Graphics/UserInterfaceV2/FormFileSelector.cs

View workflow job for this annotation

GitHub Actions / Code Quality

The name 'TopLevelContent' does not exist in the current context

Check failure on line 298 in osu.Game/Graphics/UserInterfaceV2/FormFileSelector.cs

View workflow job for this annotation

GitHub Actions / Code Quality

The name 'TopLevelContent' does not exist in the current context

Check failure on line 298 in osu.Game/Graphics/UserInterfaceV2/FormFileSelector.cs

View workflow job for this annotation

GitHub Actions / Build only (iOS)

The name 'TopLevelContent' does not exist in the current context

Check failure on line 298 in osu.Game/Graphics/UserInterfaceV2/FormFileSelector.cs

View workflow job for this annotation

GitHub Actions / Build only (iOS)

The name 'TopLevelContent' does not exist in the current context

Check failure on line 298 in osu.Game/Graphics/UserInterfaceV2/FormFileSelector.cs

View workflow job for this annotation

GitHub Actions / Test (Windows, windows-latest, MultiThreaded)

The name 'TopLevelContent' does not exist in the current context

Check failure on line 298 in osu.Game/Graphics/UserInterfaceV2/FormFileSelector.cs

View workflow job for this annotation

GitHub Actions / Test (Windows, windows-latest, MultiThreaded)

The name 'TopLevelContent' does not exist in the current context

Check failure on line 298 in osu.Game/Graphics/UserInterfaceV2/FormFileSelector.cs

View workflow job for this annotation

GitHub Actions / Test (Windows, windows-latest, SingleThread)

The name 'TopLevelContent' does not exist in the current context

Check failure on line 298 in osu.Game/Graphics/UserInterfaceV2/FormFileSelector.cs

View workflow job for this annotation

GitHub Actions / Test (Windows, windows-latest, SingleThread)

The name 'TopLevelContent' does not exist in the current context

Check failure on line 298 in osu.Game/Graphics/UserInterfaceV2/FormFileSelector.cs

View workflow job for this annotation

GitHub Actions / Build only (Android)

The name 'TopLevelContent' does not exist in the current context

Check failure on line 298 in osu.Game/Graphics/UserInterfaceV2/FormFileSelector.cs

View workflow job for this annotation

GitHub Actions / Build only (Android)

The name 'TopLevelContent' does not exist in the current context
{
new Box
RelativeSizeAxes = Axes.Both,
Masking = true,
BorderThickness = 2,
CornerRadius = 10,
BorderColour = colourProvider.Highlight1,
Children = new Drawable[]
{
Colour = Color4.Transparent,
RelativeSizeAxes = Axes.Both,
},
}
});
new Box
{
Colour = Color4.Transparent,
RelativeSizeAxes = Axes.Both,
},
}
});
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion osu.Game/Graphics/UserInterfaceV2/OsuFileSelector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public OsuFileSelector(string? initialPath = null, string[]? validFileExtensions
[BackgroundDependencyLoader]
private void load(OverlayColourProvider colourProvider)
{
AddInternal(new Box
TopLevelContent.Add(new Box

Check failure on line 32 in osu.Game/Graphics/UserInterfaceV2/OsuFileSelector.cs

View workflow job for this annotation

GitHub Actions / Test (Linux, ubuntu-latest, MultiThreaded)

The name 'TopLevelContent' does not exist in the current context

Check failure on line 32 in osu.Game/Graphics/UserInterfaceV2/OsuFileSelector.cs

View workflow job for this annotation

GitHub Actions / Test (Linux, ubuntu-latest, MultiThreaded)

The name 'TopLevelContent' does not exist in the current context

Check failure on line 32 in osu.Game/Graphics/UserInterfaceV2/OsuFileSelector.cs

View workflow job for this annotation

GitHub Actions / Test (Linux, ubuntu-latest, SingleThread)

The name 'TopLevelContent' does not exist in the current context

Check failure on line 32 in osu.Game/Graphics/UserInterfaceV2/OsuFileSelector.cs

View workflow job for this annotation

GitHub Actions / Test (Linux, ubuntu-latest, SingleThread)

The name 'TopLevelContent' does not exist in the current context

Check failure on line 32 in osu.Game/Graphics/UserInterfaceV2/OsuFileSelector.cs

View workflow job for this annotation

GitHub Actions / Code Quality

The name 'TopLevelContent' does not exist in the current context

Check failure on line 32 in osu.Game/Graphics/UserInterfaceV2/OsuFileSelector.cs

View workflow job for this annotation

GitHub Actions / Code Quality

The name 'TopLevelContent' does not exist in the current context

Check failure on line 32 in osu.Game/Graphics/UserInterfaceV2/OsuFileSelector.cs

View workflow job for this annotation

GitHub Actions / Build only (iOS)

The name 'TopLevelContent' does not exist in the current context

Check failure on line 32 in osu.Game/Graphics/UserInterfaceV2/OsuFileSelector.cs

View workflow job for this annotation

GitHub Actions / Build only (iOS)

The name 'TopLevelContent' does not exist in the current context

Check failure on line 32 in osu.Game/Graphics/UserInterfaceV2/OsuFileSelector.cs

View workflow job for this annotation

GitHub Actions / Test (Windows, windows-latest, MultiThreaded)

The name 'TopLevelContent' does not exist in the current context

Check failure on line 32 in osu.Game/Graphics/UserInterfaceV2/OsuFileSelector.cs

View workflow job for this annotation

GitHub Actions / Test (Windows, windows-latest, MultiThreaded)

The name 'TopLevelContent' does not exist in the current context

Check failure on line 32 in osu.Game/Graphics/UserInterfaceV2/OsuFileSelector.cs

View workflow job for this annotation

GitHub Actions / Test (Windows, windows-latest, SingleThread)

The name 'TopLevelContent' does not exist in the current context

Check failure on line 32 in osu.Game/Graphics/UserInterfaceV2/OsuFileSelector.cs

View workflow job for this annotation

GitHub Actions / Test (Windows, windows-latest, SingleThread)

The name 'TopLevelContent' does not exist in the current context

Check failure on line 32 in osu.Game/Graphics/UserInterfaceV2/OsuFileSelector.cs

View workflow job for this annotation

GitHub Actions / Build only (Android)

The name 'TopLevelContent' does not exist in the current context

Check failure on line 32 in osu.Game/Graphics/UserInterfaceV2/OsuFileSelector.cs

View workflow job for this annotation

GitHub Actions / Build only (Android)

The name 'TopLevelContent' does not exist in the current context
{
RelativeSizeAxes = Axes.Both,
Colour = colourProvider.Background5,
Expand Down

0 comments on commit ebfe417

Please sign in to comment.