about summary refs log tree commit diff
path: root/MatrixRoomUtils.Desktop/App.axaml.cs
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2024-01-08 13:55:15 +0100
committerRory& <root@rory.gay>2024-01-08 13:56:32 +0100
commitede3857084bc7c6e65b7d36cbf913b09596e2787 (patch)
treeb94694c307fb831ea5e63fabde0dbb5f56f02941 /MatrixRoomUtils.Desktop/App.axaml.cs
parentSmall changes (diff)
downloadMatrixUtils-ede3857084bc7c6e65b7d36cbf913b09596e2787.tar.xz
Internal changes to policy list viewer (extensibility), fix duplicating change handler for room list page (performance), use /state in room list page before sync
Diffstat (limited to 'MatrixRoomUtils.Desktop/App.axaml.cs')
-rw-r--r--MatrixRoomUtils.Desktop/App.axaml.cs12
1 files changed, 7 insertions, 5 deletions
diff --git a/MatrixRoomUtils.Desktop/App.axaml.cs b/MatrixRoomUtils.Desktop/App.axaml.cs
index 3963be6..aeb154c 100644
--- a/MatrixRoomUtils.Desktop/App.axaml.cs
+++ b/MatrixRoomUtils.Desktop/App.axaml.cs
@@ -1,7 +1,9 @@
 using Avalonia;
 using Avalonia.Controls.ApplicationLifetimes;
 using Avalonia.Markup.Xaml;
+using Avalonia.Styling;
 using LibMatrix.Services;
+using MatrixRoomUtils.Abstractions;
 using Microsoft.Extensions.DependencyInjection;
 using Microsoft.Extensions.Hosting;
 
@@ -10,10 +12,6 @@ namespace MatrixRoomUtils.Desktop;
 public partial class App : Application {
     public IHost host { get; set; }
 
-    public override void Initialize() {
-        AvaloniaXamlLoader.Load(this);
-    }
-
     public override void OnFrameworkInitializationCompleted() {
         host = Host.CreateDefaultBuilder().ConfigureServices((ctx, services) => {
             services.AddSingleton<MRUDesktopConfiguration>();
@@ -42,6 +40,10 @@ public partial class App : Application {
             var scope = scopeFac.CreateScope();
             desktop.MainWindow = scope.ServiceProvider.GetRequiredService<MainWindow>();
         }
+        
+        if(Environment.GetEnvironmentVariable("AVALONIA_THEME")?.Equals("dark", StringComparison.OrdinalIgnoreCase) ?? false)
+            RequestedThemeVariant = ThemeVariant.Dark;
+        
         base.OnFrameworkInitializationCompleted();
     }
-}
+}
\ No newline at end of file