diff options
| author | Jake Mannens <jake@asger.xyz> | 2023-09-07 09:34:07 +1000 |
|---|---|---|
| committer | Jake Mannens <jake@asger.xyz> | 2023-09-07 09:34:07 +1000 |
| commit | 85e718f94d4dd9ed539de82971710f117566b740 (patch) | |
| tree | 267b2487439e974f2ec2d9c74efa377d0ae26450 /Services/DialogService.cs | |
| parent | 013c841bf30771b04173cfeefe4e1d16d1127dea (diff) | |
Improved dialog styling and made dialogs draggable
Diffstat (limited to 'Services/DialogService.cs')
| -rw-r--r-- | Services/DialogService.cs | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/Services/DialogService.cs b/Services/DialogService.cs deleted file mode 100644 index 5967d95..0000000 --- a/Services/DialogService.cs +++ /dev/null @@ -1,39 +0,0 @@ -using HyperBooru.Pages.Component; - -namespace HyperBooru.Services; - -public interface IDialogService { - public void Register(Dialog dialog); - public void Unregister(Dialog dialog); - public void BumpZIndex(Dialog dialog); -} - -public class DialogService : IDialogService { - private const int MinZLevel = 900; - - private List<Dialog> dialogs = new(); - - public void Register(Dialog dialog) { - if(!dialogs.Contains(dialog)) - dialogs.Add(dialog); - - dialog.ZIndex = dialogs.Count() - 1 + MinZLevel; - } - - public void Unregister(Dialog dialog) { - dialogs.Remove(dialog); - for(int i = 0; i < dialogs.Count(); i++) - dialogs[i].ZIndex = i + MinZLevel; - } - - public void BumpZIndex(Dialog dialog) { - if(!dialogs.Contains(dialog)) - return; - - dialogs.Remove(dialog); - dialogs.Add(dialog); - - for(int i = 0; i < dialogs.Count(); i++) - dialogs[i].ZIndex = i + MinZLevel; - } -}
\ No newline at end of file |
