diff --git a/Source/AutoActions.ProjectResources/ProjectLocales.Designer.cs b/Source/AutoActions.ProjectResources/ProjectLocales.Designer.cs
index 225a533..a8fd9b3 100644
--- a/Source/AutoActions.ProjectResources/ProjectLocales.Designer.cs
+++ b/Source/AutoActions.ProjectResources/ProjectLocales.Designer.cs
@@ -402,7 +402,16 @@ public static string ColorDepth {
return ResourceManager.GetString("ColorDepth", resourceCulture);
}
}
-
+
+ ///
+ /// Sucht eine lokalisierte Zeichenfolge, die Theme ähnelt.
+ ///
+ public static string Theme {
+ get {
+ return ResourceManager.GetString("Theme", resourceCulture);
+ }
+ }
+
///
/// Sucht eine lokalisierte Zeichenfolge, die 10-Bit ähnelt.
///
diff --git a/Source/AutoActions.ProjectResources/ProjectLocales.de.resx b/Source/AutoActions.ProjectResources/ProjectLocales.de.resx
index e100045..f6ec053 100644
--- a/Source/AutoActions.ProjectResources/ProjectLocales.de.resx
+++ b/Source/AutoActions.ProjectResources/ProjectLocales.de.resx
@@ -207,6 +207,18 @@
Beim Start auf neuere Version prüfen
+
+ Design
+
+
+ Automatisch
+
+
+ Hell
+
+
+ Dunkel
+
Anwendungen wählen
diff --git a/Source/AutoActions.ProjectResources/ProjectLocales.resx b/Source/AutoActions.ProjectResources/ProjectLocales.resx
index 1d4e8df..3da512f 100644
--- a/Source/AutoActions.ProjectResources/ProjectLocales.resx
+++ b/Source/AutoActions.ProjectResources/ProjectLocales.resx
@@ -217,6 +217,18 @@
Check for new version on startup
+
+ Theme
+
+
+ Auto
+
+
+ Light
+
+
+ Dark
+
Choose application
diff --git a/Source/AutoActions/App.xaml b/Source/AutoActions/App.xaml
index c8c1e11..a74f5c5 100644
--- a/Source/AutoActions/App.xaml
+++ b/Source/AutoActions/App.xaml
@@ -19,6 +19,8 @@
+
@@ -49,7 +51,7 @@
-
+
diff --git a/Source/AutoActions/App.xaml.cs b/Source/AutoActions/App.xaml.cs
index b689eb1..1a0f5e1 100644
--- a/Source/AutoActions/App.xaml.cs
+++ b/Source/AutoActions/App.xaml.cs
@@ -30,8 +30,10 @@ public static void Main()
if (mutex.WaitOne(TimeSpan.Zero, true))
{
var application = new App();
- application.InitializeComponent();
+ // Resolve the theme before InitializeComponent() so App.xaml merges the matching palette.
Globals.Instance.LoadSettings();
+ Theme = ResolveTheme(Globals.Instance.Settings.ThemeSetting);
+ application.InitializeComponent();
application.Run();
}
else
@@ -43,11 +45,34 @@ public static void Main()
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
+ // Dark theme: darken the native title bar of every window (main, dialogs, splash) as it loads.
+ if (App.Theme == Theme.Dark)
+ EventManager.RegisterClassHandler(typeof(Window), Window.LoadedEvent, new RoutedEventHandler(OnAnyWindowLoaded));
Views.AutoActionsMainView mainView = new Views.AutoActionsMainView();
if (!Globals.Instance.Settings.StartMinimizedToTray)
mainView.Show();
}
+ private static void OnAnyWindowLoaded(object sender, RoutedEventArgs e)
+ {
+ if (sender is Window window)
+ WinAPIFunctions.SetWindowDarkMode(window, true);
+ }
+
+ private static Theme ResolveTheme(ThemeSetting setting)
+ {
+ switch (setting)
+ {
+ case ThemeSetting.Light:
+ return Theme.Light;
+ case ThemeSetting.Dark:
+ return Theme.Dark;
+ default:
+ return AutoActions.Windows.UI.GetWindowsTheme() == AutoActions.Windows.WindowsTheme.Dark
+ ? Theme.Dark : Theme.Light;
+ }
+ }
+
protected override void OnExit(ExitEventArgs e)
{
if (mutex.WaitOne(TimeSpan.Zero, true))
diff --git a/Source/AutoActions/AutoActions.csproj b/Source/AutoActions/AutoActions.csproj
index eb92c32..05e1fc1 100644
--- a/Source/AutoActions/AutoActions.csproj
+++ b/Source/AutoActions/AutoActions.csproj
@@ -302,6 +302,7 @@
+
@@ -382,19 +383,15 @@
-
- Designer
- XamlIntelliSenseFileGenerator
-
XamlIntelliSenseFileGenerator
Designer
-
+
Designer
XamlIntelliSenseFileGenerator
-
+
Designer
XamlIntelliSenseFileGenerator
@@ -402,6 +399,10 @@
Designer
MSBuild:Compile
+
+ Designer
+ MSBuild:Compile
+
MSBuild:Compile
Designer
diff --git a/Source/AutoActions/Controls/1_Colors.xaml b/Source/AutoActions/Controls/1_Colors.xaml
deleted file mode 100644
index 3a2f2e9..0000000
--- a/Source/AutoActions/Controls/1_Colors.xaml
+++ /dev/null
@@ -1,40 +0,0 @@
-
- #2ac987
- #ff6666
- #fa8e8e
- #e36b6b
-
- White
- #fca9a9
- #FFDDDDDD
- White
- #FFCCCCCC
- #d4d4d4
- #FF444444
- #cfcfcf
- #8A8A8A
-
- #adadad
-
-
-
-
-
-
-
-
-
-
-
- #ad7b7b
- #757575
- #969696
- #a1a1a1
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Source/AutoActions/Controls/2_DefaultControls.xaml b/Source/AutoActions/Controls/1_DefaultControls.xaml
similarity index 96%
rename from Source/AutoActions/Controls/2_DefaultControls.xaml
rename to Source/AutoActions/Controls/1_DefaultControls.xaml
index f3328d7..8742a36 100644
--- a/Source/AutoActions/Controls/2_DefaultControls.xaml
+++ b/Source/AutoActions/Controls/1_DefaultControls.xaml
@@ -51,18 +51,18 @@
-
+
@@ -322,7 +292,7 @@
-
+
@@ -367,7 +337,7 @@