first commit
This commit is contained in:
8
Nitrox.Launcher/Views/Abstract/ModalBase.cs
Normal file
8
Nitrox.Launcher/Views/Abstract/ModalBase.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Nitrox.Launcher.Views.Abstract;
|
||||
|
||||
public abstract class ModalBase : Window
|
||||
{
|
||||
protected override void OnInitialized() => this.ApplyOsWindowStyling();
|
||||
}
|
7
Nitrox.Launcher/Views/Abstract/RoutableViewBase.cs
Normal file
7
Nitrox.Launcher/Views/Abstract/RoutableViewBase.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
using Avalonia.Controls;
|
||||
using Nitrox.Launcher.ViewModels.Abstract;
|
||||
|
||||
namespace Nitrox.Launcher.Views.Abstract;
|
||||
|
||||
public abstract class RoutableViewBase<TViewModel> : UserControl
|
||||
where TViewModel : RoutableViewModelBase;
|
21
Nitrox.Launcher/Views/Abstract/WindowEx.cs
Normal file
21
Nitrox.Launcher/Views/Abstract/WindowEx.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using Avalonia.Controls;
|
||||
using Nitrox.Launcher.Models.Design;
|
||||
using Nitrox.Launcher.ViewModels.Abstract;
|
||||
|
||||
namespace Nitrox.Launcher.Views.Abstract;
|
||||
|
||||
public abstract class WindowEx<T> : Window where T : ViewModelBase
|
||||
{
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
this.ApplyOsWindowStyling();
|
||||
|
||||
// On Linux systems, Avalonia has trouble allowing windows to resize without "decorations". So we enable it in full, but hide the custom titlebar as it'll look bad.
|
||||
if (OperatingSystem.IsLinux())
|
||||
{
|
||||
SystemDecorations = SystemDecorations.Full;
|
||||
NitroxAttached.SetUseCustomTitleBar(this, false);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user