added tray menu

This commit is contained in:
2026-08-12 04:59:22 +05:00
parent 08192d317e
commit a0d3098fe4
21 changed files with 1327 additions and 42 deletions
+28 -1
View File
@@ -265,6 +265,28 @@ public sealed class MainWindowTests
});
}
// The application lives in the tray, and the settings window is a guest on the
// screen: its close button puts it away rather than ends anything
[Fact]
public void The_window_hooks_up_to_the_tray()
{
Sta.Run(() =>
{
using SettingsViewModel viewModel = CreateViewModel();
Open(viewModel, window =>
{
window.Close();
Assert.False(window.IsVisible);
// A closed window would refuse this
window.Show();
Assert.True(window.IsVisible);
});
});
}
[Fact]
public void The_window_hooks_up_to_the_placement()
{
@@ -305,7 +327,9 @@ public sealed class MainWindowTests
MainWindowPlacement placement,
Action<MainWindow> check)
{
var window = new MainWindow(viewModel, theme, placement)
var presenter = new MainWindowPresenter(placement);
var window = new MainWindow(viewModel, theme, placement, presenter)
{
// The window is needed alive, but not in sight
Opacity = 0,
@@ -322,6 +346,9 @@ public sealed class MainWindowTests
}
finally
{
// The window belongs to the tray now and refuses to close until
// the application is on its way out
presenter.AllowClose();
window.Close();
}
}