-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ugly
- Loading branch information
Showing
7 changed files
with
66 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,33 @@ | ||
using Avalonia; | ||
using Avalonia.Controls; | ||
using Avalonia.Controls.ApplicationLifetimes; | ||
using Avalonia.Interactivity; | ||
|
||
namespace Turbulence.Desktop; | ||
|
||
public partial class MainWindow : Window | ||
{ | ||
SettingsWindow? _settingsWindow; | ||
public MainWindow() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
public async void OnSettings(object? _1, RoutedEventArgs _2) | ||
{ | ||
//TODO: instead show as a independent window? | ||
_settingsWindow = new(); | ||
await _settingsWindow.ShowDialog(this); | ||
} | ||
|
||
public void OnExit(object? _1, RoutedEventArgs _2) | ||
{ | ||
var current = Application.Current; | ||
if (current == null) | ||
return; | ||
|
||
var lifetime = current.ApplicationLifetime; | ||
if (lifetime is IClassicDesktopStyleApplicationLifetime desktop) | ||
desktop.Shutdown(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<Window xmlns="https://github.com/avaloniaui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d" d:DesignWidth="600" d:DesignHeight="500" | ||
Width="600" Height="500" | ||
MinWidth="600" MinHeight="500" | ||
WindowStartupLocation="CenterOwner" | ||
x:Class="Turbulence.Desktop.SettingsWindow" | ||
Title="Settings"> | ||
Welcome to Avalonia! | ||
</Window> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using Avalonia.Controls; | ||
|
||
namespace Turbulence.Desktop | ||
{ | ||
public partial class SettingsWindow : Window | ||
{ | ||
public SettingsWindow() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters