-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rework overlays #1402
Rework overlays #1402
Conversation
Fixes : #1379 |
This PR conflicts with |
@halgari I thought the plan was to ditch overlays and replace them with modal windows (Avalonia Dialogs) in the future |
That's what I thought as well, which is why I didn't rework overlays into modal dialogs in my own PR (#1390). We have issue #1128 open, but previously decided not to work on that until later. |
src/NexusMods.App.UI/Overlays/Generic/MessageBox/OkCancel/MessageBoxOkCancelView.axaml.cs
Outdated
Show resolved
Hide resolved
src/NexusMods.App.UI/Overlays/Login/NexusLoginOverlayService.cs
Outdated
Show resolved
Hide resolved
src/NexusMods.App.UI/Overlays/Login/NexusLoginOverlayViewModel.cs
Outdated
Show resolved
Hide resolved
src/NexusMods.App.UI/Overlays/MetricsOptIn/MetricsOptInViewModel.cs
Outdated
Show resolved
Hide resolved
This isn't a full redesign of the main parts of the overlay. This is the side-effect of me spending most of a day trying to figure out why overlays weren't working and getting fed up with how complex the code currently is. |
# Conflicts: # src/NexusMods.App.UI/Pages/Downloads/InProgressViewModel.cs # src/NexusMods.App.UI/Windows/MainWindowViewModel.cs
This PR doesn't conflict with |
Co-authored-by: erri120 <erri120@fossmailer.de>
// Has to be here, because otherwise Fody breaks the codegen and doesn't make a backing | ||
// field for Status for some reason :| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lmao, might be because this is an abstract class or something.
What started as frustration with how overlays were implemented has slowly turned into a rework of the OverlayController. Now with a lot less Rx and a lot less complexity. Added some tests for the OAuth overlay that failed until I fixed some of the Rx issues in play here.
OverlayController now contains all the active overlays (multiple windows would show the same overlay if we supported multi-window), only one of which is visible. Closing any overlay updates/deactives/activates the overlays. Overlays can optionally have a return value which is used for the Ok/Cancel dialogs. Everything now sits on top of abstract classes to reduce duplicated code.