Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion Source/AutoActions.ProjectResources/ProjectLocales.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions Source/AutoActions.ProjectResources/ProjectLocales.de.resx
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,18 @@
<data name="CheckForNewVersion" xml:space="preserve">
<value>Beim Start auf neuere Version prüfen</value>
</data>
<data name="Theme" xml:space="preserve">
<value>Design</value>
</data>
<data name="ThemeSetting.System" xml:space="preserve">
<value>Automatisch</value>
</data>
<data name="ThemeSetting.Light" xml:space="preserve">
<value>Hell</value>
</data>
<data name="ThemeSetting.Dark" xml:space="preserve">
<value>Dunkel</value>
</data>
<data name="ChooseApplication" xml:space="preserve">
<value>Anwendungen wählen</value>
</data>
Expand Down
12 changes: 12 additions & 0 deletions Source/AutoActions.ProjectResources/ProjectLocales.resx
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,18 @@
<data name="CheckForNewVersion" xml:space="preserve">
<value>Check for new version on startup</value>
</data>
<data name="Theme" xml:space="preserve">
<value>Theme</value>
</data>
<data name="ThemeSetting.System" xml:space="preserve">
<value>Auto</value>
</data>
<data name="ThemeSetting.Light" xml:space="preserve">
<value>Light</value>
</data>
<data name="ThemeSetting.Dark" xml:space="preserve">
<value>Dark</value>
</data>
<data name="ChooseApplication" xml:space="preserve">
<value>Choose application</value>
</data>
Expand Down
4 changes: 3 additions & 1 deletion Source/AutoActions/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
<ResourceDictionary>

<ResourceDictionary.MergedDictionaries>
<thm:ThemeResourceDirectory LightResource="/AutoActions;component/Theming/LightColors.xaml"
DarkResource="/AutoActions;component/Theming/DarkColors.xaml"/>
<ResourceDictionary Source="Controls\AppResources.xaml"/>
</ResourceDictionary.MergedDictionaries>

Expand Down Expand Up @@ -49,7 +51,7 @@
</DataTrigger>

<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsSelected}" Value="False" >
<Setter TargetName="HeaderContent" Property="Foreground" Value="Black"/>
<Setter TargetName="HeaderContent" Property="Foreground" Value="{StaticResource TextForegroundBrush}"/>
<Setter TargetName="HeaderContent" Property="FontSize" Value="{StaticResource DefaultFontSize}"/>

</DataTrigger>
Expand Down
27 changes: 26 additions & 1 deletion Source/AutoActions/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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))
Expand Down
13 changes: 7 additions & 6 deletions Source/AutoActions/AutoActions.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@
<Compile Include="Profiles\Actions\ReferenceProfileAction.cs" />
<Compile Include="Theming\ThemeResourceDirectory.cs" />
<Compile Include="Theming\Theme.cs" />
<Compile Include="Theming\ThemeSetting.cs" />
<Compile Include="UserAppSettings.cs" />
<Compile Include="UWP\WWAHostHandler.cs" />
<Compile Include="Views\StatusView.xaml.cs">
Expand Down Expand Up @@ -382,26 +383,26 @@
<Compile Include="UWP\AppxManifest.cs" />
<Compile Include="UWP\UWPAppsManager.cs" />
<Compile Include="UWP\UWPApp.cs" />
<Page Include="Controls\1_Colors.xaml">
<SubType>Designer</SubType>
<Generator>XamlIntelliSenseFileGenerator</Generator>
</Page>
<Page Include="Controls\AppResources.xaml">
<Generator>XamlIntelliSenseFileGenerator</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Controls\2_DefaultControls.xaml">
<Page Include="Controls\1_DefaultControls.xaml">
<SubType>Designer</SubType>
<Generator>XamlIntelliSenseFileGenerator</Generator>
</Page>
<Page Include="Controls\3_CustomComboBox.xaml">
<Page Include="Controls\2_CustomComboBox.xaml">
<SubType>Designer</SubType>
<Generator>XamlIntelliSenseFileGenerator</Generator>
</Page>
<Page Include="Theming\LightColors.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Theming\DarkColors.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\StatusView.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
Expand Down
40 changes: 0 additions & 40 deletions Source/AutoActions/Controls/1_Colors.xaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,18 @@
</Style>
<Style x:Key="DefaultTextBlock" TargetType="TextBlock">
<Setter Property="FontSize" Value="{StaticResource DefaultFontSize}" />
<Setter Property="Foreground" Value="Black"/>
<Setter Property="Foreground" Value="{StaticResource TextForegroundBrush}"/>
<Setter Property="Margin" Value="5"/>

</Style>
<Style x:Key="TitleTextBlock" TargetType="TextBlock" BasedOn="{StaticResource DefaultTextBlock}">
<Setter Property="FontSize" Value="25"/>
<Setter Property="Foreground" Value="Black"/>
<Setter Property="Foreground" Value="{StaticResource TextForegroundBrush}"/>
<Setter Property="FontWeight" Value="Bold"/>
</Style>
<Style x:Key="SubTitleTextBlock" TargetType="TextBlock" BasedOn="{StaticResource DefaultTextBlock}">
<Setter Property="FontSize" Value="20"/>
<Setter Property="Foreground" Value="Black"/>
<Setter Property="Foreground" Value="{StaticResource TextForegroundBrush}"/>
<Setter Property="FontWeight" Value="DemiBold"/>
</Style>
<Style x:Key="ToggleStatus" TargetType="{x:Type CheckBox}">
Expand All @@ -83,7 +83,7 @@
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type CheckBox}">
<Ellipse Fill="{TemplateBinding Background}" HorizontalAlignment="Stretch" Stroke="Black" VerticalAlignment="Stretch" />
<Ellipse Fill="{TemplateBinding Background}" HorizontalAlignment="Stretch" Stroke="{StaticResource GlyphBrush}" VerticalAlignment="Stretch" />
</ControlTemplate>
</Setter.Value>
</Setter>
Expand All @@ -99,12 +99,14 @@
</Style>
<Style x:Key="DefaultUserControl" TargetType="UserControl">
<Setter Property="Background" Value="{StaticResource WindowBackgroundBrush}"/>
<Setter Property="Foreground" Value="Black"/>
<Setter Property="Foreground" Value="{StaticResource TextForegroundBrush}"/>

</Style>
<Style TargetType="UserControl" BasedOn="{StaticResource DefaultUserControl}"/>
<Style x:Key="DefaultTextBox" TargetType="TextBox" >
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Background" Value="{StaticResource ControlLightBrush}"/>
<Setter Property="Foreground" Value="{StaticResource TextForegroundBrush}"/>
<Setter Property="FontSize" Value="{StaticResource DefaultFontSize}"/>
<Setter Property="FontWeight" Value="Normal" />
<Setter Property="Template">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
<Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
<Setter Property="MinWidth" Value="120"/>
<Setter Property="MinHeight" Value="20"/>
<Setter Property="Foreground" Value="Black"/>
<Setter Property="Foreground" Value="{StaticResource TextForegroundBrush}"/>
<Setter Property="FontWeight" Value="DemiBold"/>
<Setter Property="FontSize" Value="{StaticResource DefaultFontSize}" />
<Setter Property="Template">
Expand Down Expand Up @@ -136,7 +136,7 @@

<Style x:Key="{x:Type ComboBoxItem}" TargetType="{x:Type ComboBoxItem}">
<Setter Property="SnapsToDevicePixels" Value="true"/>
<Setter Property="Foreground" Value="Black"/>
<Setter Property="Foreground" Value="{StaticResource TextForegroundBrush}"/>
<Setter Property="OverridesDefaultStyle" Value="true"/>
<Setter Property="Template">
<Setter.Value>
Expand Down
52 changes: 11 additions & 41 deletions Source/AutoActions/Controls/AppResources.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,7 @@
<!--This is an auto-generated file. Do not change by yourself since it's overridden with each build-->
<!---->
<!---->
<!--Merged from file 1_Colors.xaml-->
<Color x:Key="ActiveColor">#2ac987</Color>
<Color x:Key="AccentColor">#ff6666</Color>
<Color x:Key="ControlMouseOverColor">#fa8e8e</Color>
<Color x:Key="ControlPressedColor">#e36b6b</Color>
<Color x:Key="WindowColor">White</Color>
<Color x:Key="SelectedBackgroundColor">#fca9a9</Color>
<Color x:Key="SelectedUnfocusedColor">#FFDDDDDD</Color>
<Color x:Key="ControlLightColor">White</Color>
<Color x:Key="ControlMediumColor">#FFCCCCCC</Color>
<Color x:Key="IconBackgroundColor">#d4d4d4</Color>
<Color x:Key="GlyphColor">#FF444444</Color>
<Color x:Key="DisabledForegroundColor">#cfcfcf</Color>
<Color x:Key="DisabledControlDarkColor">#8A8A8A</Color>
<Color x:Key="DisabledBorderColor">#adadad</Color>
<SolidColorBrush x:Key="WindowBackgroundBrush" Color="{StaticResource WindowColor}" />
<SolidColorBrush x:Key="ButtonForegroundBrush" Color="{StaticResource WindowColor}" />
<SolidColorBrush x:Key="ActiveBrush" Color="{StaticResource ActiveColor}" />
<SolidColorBrush x:Key="AccentBrush" Color="{StaticResource AccentColor}" />
<SolidColorBrush x:Key="HighlightedBrush" Color="{StaticResource SelectedBackgroundColor}" />
<SolidColorBrush x:Key="MouseOverBrush" Color="{StaticResource ControlMouseOverColor}" />
<SolidColorBrush x:Key="ControlLightBrush" Color="{StaticResource ControlLightColor}" />
<SolidColorBrush x:Key="GlyphBrush" Color="{StaticResource GlyphColor}" />
<SolidColorBrush x:Key="IconBackgroundBrush" Color="{StaticResource IconBackgroundColor}" />
<SolidColorBrush x:Key="InactiveAccentBrush">#ad7b7b</SolidColorBrush>
<SolidColorBrush x:Key="DragScrollBrush">#757575</SolidColorBrush>
<SolidColorBrush x:Key="ScrollBrush">#969696</SolidColorBrush>
<SolidColorBrush x:Key="MouseOverScrollBrush">#a1a1a1</SolidColorBrush>
<SolidColorBrush x:Key="DisabledAccentBrush" Color="{StaticResource DisabledControlDarkColor}" />
<SolidColorBrush x:Key="HighlightedInactiveAccentBrush" Color="#95bfdb" />
<StaticResource x:Key="ButtonBackgroundBrush" ResourceKey="AccentBrush" />
<!---->
<!--Merged from file 2_DefaultControls.xaml-->
<!--Merged from file 1_DefaultControls.xaml-->
<system:Double x:Key="DefaultFontSize">15</system:Double>
<system:Double x:Key="DefaultRadius">7.5</system:Double>
<CornerRadius x:Key="DefaultCornerRadius">7.5</CornerRadius>
Expand Down Expand Up @@ -77,17 +45,17 @@
</Style>
<Style x:Key="DefaultTextBlock" TargetType="TextBlock">
<Setter Property="FontSize" Value="{StaticResource DefaultFontSize}" />
<Setter Property="Foreground" Value="Black" />
<Setter Property="Foreground" Value="{StaticResource TextForegroundBrush}" />
<Setter Property="Margin" Value="5" />
</Style>
<Style x:Key="TitleTextBlock" TargetType="TextBlock" BasedOn="{StaticResource DefaultTextBlock}">
<Setter Property="FontSize" Value="25" />
<Setter Property="Foreground" Value="Black" />
<Setter Property="Foreground" Value="{StaticResource TextForegroundBrush}" />
<Setter Property="FontWeight" Value="Bold" />
</Style>
<Style x:Key="SubTitleTextBlock" TargetType="TextBlock" BasedOn="{StaticResource DefaultTextBlock}">
<Setter Property="FontSize" Value="20" />
<Setter Property="Foreground" Value="Black" />
<Setter Property="Foreground" Value="{StaticResource TextForegroundBrush}" />
<Setter Property="FontWeight" Value="DemiBold" />
</Style>
<Style x:Key="ToggleStatus" TargetType="{x:Type CheckBox}">
Expand All @@ -100,7 +68,7 @@
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type CheckBox}">
<Ellipse Fill="{TemplateBinding Background}" HorizontalAlignment="Stretch" Stroke="Black" VerticalAlignment="Stretch" />
<Ellipse Fill="{TemplateBinding Background}" HorizontalAlignment="Stretch" Stroke="{StaticResource GlyphBrush}" VerticalAlignment="Stretch" />
</ControlTemplate>
</Setter.Value>
</Setter>
Expand All @@ -115,11 +83,13 @@
</Style>
<Style x:Key="DefaultUserControl" TargetType="UserControl">
<Setter Property="Background" Value="{StaticResource WindowBackgroundBrush}" />
<Setter Property="Foreground" Value="Black" />
<Setter Property="Foreground" Value="{StaticResource TextForegroundBrush}" />
</Style>
<Style TargetType="UserControl" BasedOn="{StaticResource DefaultUserControl}" />
<Style x:Key="DefaultTextBox" TargetType="TextBox">
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Background" Value="{StaticResource ControlLightBrush}" />
<Setter Property="Foreground" Value="{StaticResource TextForegroundBrush}" />
<Setter Property="FontSize" Value="{StaticResource DefaultFontSize}" />
<Setter Property="FontWeight" Value="Normal" />
<Setter Property="Template">
Expand Down Expand Up @@ -285,7 +255,7 @@
</Style>
<Style TargetType="CheckBox" BasedOn="{StaticResource DefaultCheckBox}" />
<!---->
<!--Merged from file 3_CustomComboBox.xaml-->
<!--Merged from file 2_CustomComboBox.xaml-->
<ControlTemplate x:Key="ComboBoxToggleButton" TargetType="{x:Type ToggleButton}">
<Grid>
<Grid.ColumnDefinitions>
Expand Down Expand Up @@ -322,7 +292,7 @@
<Setter Property="ScrollViewer.CanContentScroll" Value="true" />
<Setter Property="MinWidth" Value="120" />
<Setter Property="MinHeight" Value="20" />
<Setter Property="Foreground" Value="Black" />
<Setter Property="Foreground" Value="{StaticResource TextForegroundBrush}" />
<Setter Property="FontWeight" Value="DemiBold" />
<Setter Property="FontSize" Value="{StaticResource DefaultFontSize}" />
<Setter Property="Template">
Expand Down Expand Up @@ -367,7 +337,7 @@
</Style>
<Style x:Key="{x:Type ComboBoxItem}" TargetType="{x:Type ComboBoxItem}">
<Setter Property="SnapsToDevicePixels" Value="true" />
<Setter Property="Foreground" Value="Black" />
<Setter Property="Foreground" Value="{StaticResource TextForegroundBrush}" />
<Setter Property="OverridesDefaultStyle" Value="true" />
<Setter Property="Template">
<Setter.Value>
Expand Down
Loading