Skip to content

Commit 7b4a42d

Browse files
committed
1.8.0
[New] - Change color depth (Nvidia users only) - Little UI overhaul [Changes] - Audio actions are disabled for now, because the implementation is really buggy [Bug fixes] -Application crashing after waking up from sleep mode #61
1 parent 0227c25 commit 7b4a42d

17 files changed

+327
-409
lines changed

Source/AutoHDR.Displays/DisplayManagerNvidia.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public override void SetColorDepth(Display display, ColorDepth colorDepth)
105105
{
106106
DisplayDevice nvidiaDisplay = new DisplayDevice((uint)display.Tag);
107107
NvAPIWrapper.Native.Display.ColorDataDepth nvColorDepth = colorDepth.ConvertNvidiaColorDepth();
108-
ColorData colorData = new ColorData(nvidiaDisplay.CurrentColorData.ColorFormat, nvidiaDisplay.CurrentColorData.Colorimetry, nvidiaDisplay.CurrentColorData.DynamicRange, NvAPIWrapper.Native.Display.ColorDataDepth.BPC8, nvidiaDisplay.CurrentColorData.SelectionPolicy, nvidiaDisplay.CurrentColorData.DesktopColorDepth);
108+
ColorData colorData = new ColorData(nvidiaDisplay.CurrentColorData.ColorFormat, nvidiaDisplay.CurrentColorData.Colorimetry, nvidiaDisplay.CurrentColorData.DynamicRange, nvColorDepth, nvidiaDisplay.CurrentColorData.SelectionPolicy, nvidiaDisplay.CurrentColorData.DesktopColorDepth);
109109
nvidiaDisplay.SetColorData(colorData);
110110
}
111111

Source/AutoHDR.ProjectResources/ProjectLocales.Designer.cs

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Source/AutoHDR.ProjectResources/ProjectLocales.de.resx

+2-2
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,8 @@
276276
<data name="IsPrimaryMonitor" xml:space="preserve">
277277
<value>Hauptmonitor</value>
278278
</data>
279-
<data name="LastAction" xml:space="preserve">
280-
<value>Letzte Aktion</value>
279+
<data name="LastActions" xml:space="preserve">
280+
<value>Letzte Aktionen</value>
281281
</data>
282282
<data name="LaunchApplication" xml:space="preserve">
283283
<value>Starte Anwendung</value>

Source/AutoHDR.ProjectResources/ProjectLocales.resx

+2-2
Original file line numberDiff line numberDiff line change
@@ -310,8 +310,8 @@
310310
<data name="IsPrimaryMonitor" xml:space="preserve">
311311
<value>Primary</value>
312312
</data>
313-
<data name="LastAction" xml:space="preserve">
314-
<value>Last action</value>
313+
<data name="LastActions" xml:space="preserve">
314+
<value>Last actions</value>
315315
</data>
316316
<data name="LaunchApplication" xml:space="preserve">
317317
<value>Launch application</value>

Source/AutoHDR/App.xaml

+41-383
Large diffs are not rendered by default.

Source/AutoHDR/AutoHDR.csproj

+16-1
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,22 @@
260260
<Compile Include="UWP\AppxManifest.cs" />
261261
<Compile Include="UWP\UWPAppsManager.cs" />
262262
<Compile Include="UWP\UWPApp.cs" />
263+
<Page Include="Controls\Colors.xaml">
264+
<SubType>Designer</SubType>
265+
<Generator>MSBuild:Compile</Generator>
266+
</Page>
267+
<Page Include="Controls\ControlProperties.xaml">
268+
<SubType>Designer</SubType>
269+
<Generator>MSBuild:Compile</Generator>
270+
</Page>
271+
<Page Include="Controls\CustomComboBox.xaml">
272+
<SubType>Designer</SubType>
273+
<Generator>MSBuild:Compile</Generator>
274+
</Page>
275+
<Page Include="Controls\DefaultBorder.xaml">
276+
<SubType>Designer</SubType>
277+
<Generator>MSBuild:Compile</Generator>
278+
</Page>
263279
<Page Include="Theming\LightColors.xaml">
264280
<SubType>Designer</SubType>
265281
<Generator>MSBuild:Compile</Generator>
@@ -385,7 +401,6 @@
385401
</BootstrapperPackage>
386402
</ItemGroup>
387403
<ItemGroup>
388-
<Folder Include="Displays\" />
389404
<Folder Include="Plugins\" />
390405
</ItemGroup>
391406
<ItemGroup>

Source/AutoHDR/Controls/Colors.xaml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
2+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
3+
<Color x:Key="ActiveColor">#2ac987</Color>
4+
<Color x:Key="AccentColor">#ff6666</Color>
5+
<Color x:Key="ControlMouseOverColor">#fa8e8e</Color>
6+
<Color x:Key="ControlPressedColor">#e36b6b</Color>
7+
8+
<Color x:Key="WindowColor">White</Color>
9+
<Color x:Key="SelectedBackgroundColor">#fca9a9</Color>
10+
<Color x:Key="SelectedUnfocusedColor">#FFDDDDDD</Color>
11+
<Color x:Key="ControlLightColor">White</Color>
12+
<Color x:Key="ControlMediumColor">#FFCCCCCC</Color>
13+
<Color x:Key="GlyphColor">#FF444444</Color>
14+
<Color x:Key="DisabledForegroundColor">#cfcfcf</Color>
15+
<Color x:Key="DisabledControlDarkColor">#8a8a8a</Color>
16+
17+
<Color x:Key="DisabledBorderColor">#adadad</Color>
18+
<SolidColorBrush x:Key="WindowBackgroundBrush" Color="{StaticResource WindowColor}"/>
19+
<SolidColorBrush x:Key="ButtonForegroundBrush" Color="{StaticResource WindowColor}"/>
20+
<SolidColorBrush x:Key="ActiveBrush" Color="{StaticResource ActiveColor}"/>
21+
<SolidColorBrush x:Key="AccentBrush" Color="{StaticResource AccentColor}"/>
22+
<SolidColorBrush x:Key="HighlightedBrush" Color="{StaticResource SelectedBackgroundColor}"/>
23+
<SolidColorBrush x:Key="MouseOverBrush" Color="{StaticResource ControlMouseOverColor}"/>
24+
<SolidColorBrush x:Key="ControlLightBrush" Color="{StaticResource ControlLightColor}"/>
25+
<SolidColorBrush x:Key="GlyphBrush" Color="{StaticResource GlyphColor}"/>
26+
27+
<SolidColorBrush x:Key="InactiveAccentBrush">#ad7b7b</SolidColorBrush>
28+
<SolidColorBrush x:Key="DragScrollBrush">#757575</SolidColorBrush>
29+
<SolidColorBrush x:Key="ScrollBrush">#969696</SolidColorBrush>
30+
<SolidColorBrush x:Key="MouseOverScrollBrush">#a1a1a1</SolidColorBrush>
31+
32+
<SolidColorBrush x:Key="DisabledAccentBrush" Color="{StaticResource DisabledControlDarkColor}"/>
33+
<SolidColorBrush x:Key="HighlightedInactiveAccentBrush" Color="#95bfdb"/>
34+
<StaticResource x:Key="ButtonBackgroundBrush" ResourceKey="AccentBrush"/>
35+
36+
37+
</ResourceDictionary>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
2+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
3+
xmlns:system="clr-namespace:System;assembly=mscorlib">
4+
5+
<system:Double x:Key="DefaultFontSize">15</system:Double>
6+
<system:Double x:Key="DefaultRadius">7.5</system:Double>
7+
<CornerRadius x:Key="CornerRadius">7.5</CornerRadius>
8+
</ResourceDictionary>
+165
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
2+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
3+
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity">
4+
5+
<ControlTemplate x:Key="ComboBoxToggleButton" TargetType="{x:Type ToggleButton}">
6+
<Grid>
7+
<Grid.ColumnDefinitions>
8+
<ColumnDefinition />
9+
<ColumnDefinition Width="20" />
10+
</Grid.ColumnDefinitions>
11+
<Border Style="{StaticResource DefaultBorder}"
12+
x:Name="Border"
13+
Grid.ColumnSpan="2"
14+
Background="{StaticResource ControlLightBrush}"
15+
BorderBrush="{StaticResource AccentBrush}"
16+
BorderThickness="1" />
17+
<Border
18+
Grid.Column="0"
19+
CornerRadius="0"
20+
Margin="10,1,0,1"
21+
Background="{Binding ElementName=Border, Path=Background}"
22+
BorderBrush="{Binding ElementName=Border, Path=BorderBrush}"
23+
BorderThickness="0,0,1,0" />
24+
<Path
25+
x:Name="Arrow"
26+
Grid.Column="1"
27+
Fill="{StaticResource GlyphBrush}"
28+
HorizontalAlignment="Center"
29+
VerticalAlignment="Center"
30+
Data="M0,0 L0,2 L4,6 L8,2 L8,0 L4,4 z"
31+
/>
32+
</Grid>
33+
<ControlTemplate.Triggers>
34+
<Trigger Property="ToggleButton.IsMouseOver" Value="true">
35+
<Setter TargetName="Border" Property="Background" Value="{StaticResource MouseOverBrush}" />
36+
</Trigger>
37+
<Trigger Property="ToggleButton.IsChecked" Value="true">
38+
<Setter TargetName="Border" Property="Background" Value="{StaticResource AccentBrush}" />
39+
</Trigger>
40+
<Trigger Property="IsEnabled" Value="False">
41+
<Setter TargetName="Border" Property="Background" Value="{StaticResource DisabledAccentBrush}" />
42+
<Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledAccentBrush}" />
43+
<Setter Property="Foreground" Value="Black"/>
44+
<Setter TargetName="Arrow" Property="Fill" Value="{StaticResource GlyphBrush}" />
45+
</Trigger>
46+
</ControlTemplate.Triggers>
47+
</ControlTemplate>
48+
49+
<ControlTemplate x:Key="ComboBoxTextBox" TargetType="{x:Type TextBox}">
50+
<Border x:Name="PART_ContentHost" Focusable="False" Background="{TemplateBinding Background}" />
51+
</ControlTemplate>
52+
53+
<Style x:Key="StyledComboBox" TargetType="{x:Type ComboBox}">
54+
<Setter Property="SnapsToDevicePixels" Value="true"/>
55+
<Setter Property="OverridesDefaultStyle" Value="true"/>
56+
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
57+
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
58+
<Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
59+
<Setter Property="MinWidth" Value="120"/>
60+
<Setter Property="MinHeight" Value="20"/>
61+
<Setter Property="Foreground" Value="Black"/>
62+
<Setter Property="Template">
63+
<Setter.Value>
64+
<ControlTemplate TargetType="{x:Type ComboBox}">
65+
<Grid>
66+
<ToggleButton
67+
Name="ToggleButton"
68+
Template="{StaticResource ComboBoxToggleButton}"
69+
Grid.Column="2"
70+
Focusable="false"
71+
IsChecked="{Binding Path=IsDropDownOpen,Mode=TwoWay,RelativeSource={RelativeSource TemplatedParent}}"
72+
ClickMode="Press">
73+
</ToggleButton>
74+
<ContentPresenter Name="ContentSite" IsHitTestVisible="False" Content="{TemplateBinding SelectionBoxItem}"
75+
ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
76+
ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
77+
Margin="5,3,23,3"
78+
VerticalAlignment="Center"
79+
HorizontalAlignment="Left" />
80+
<TextBox x:Name="PART_EditableTextBox"
81+
Style="{x:Null}"
82+
Template="{StaticResource ComboBoxTextBox}"
83+
HorizontalAlignment="Left"
84+
VerticalAlignment="Center"
85+
Margin="5,5,23,3"
86+
Focusable="True"
87+
Background="{StaticResource ControlLightBrush}"
88+
Visibility="Hidden"
89+
IsReadOnly="{TemplateBinding IsReadOnly}"/>
90+
<Popup
91+
Name="Popup"
92+
Placement="Bottom"
93+
IsOpen="{TemplateBinding IsDropDownOpen}"
94+
AllowsTransparency="True"
95+
Focusable="False"
96+
PopupAnimation="Slide">
97+
98+
<Grid Name="DropDown"
99+
SnapsToDevicePixels="True"
100+
MinWidth="{TemplateBinding ActualWidth}"
101+
MaxHeight="{TemplateBinding MaxDropDownHeight}">
102+
<Border
103+
x:Name="DropDownBorder" Style="{StaticResource DefaultBorder}" CornerRadius="5"
104+
Background="{StaticResource ControlLightBrush}" BorderThickness="1,1,1,1"/>
105+
<ScrollViewer Margin="4,6,4,6" SnapsToDevicePixels="True">
106+
<StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained" />
107+
</ScrollViewer>
108+
</Grid>
109+
</Popup>
110+
</Grid>
111+
<ControlTemplate.Triggers>
112+
<Trigger Property="HasItems" Value="false">
113+
<Setter TargetName="DropDownBorder" Property="MinHeight" Value="95"/>
114+
</Trigger>
115+
<Trigger Property="IsEnabled" Value="false">
116+
<Setter Property="Foreground" Value="{StaticResource DisabledControlDarkColor}"/>
117+
</Trigger>
118+
<Trigger Property="IsGrouping" Value="true">
119+
<Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
120+
</Trigger>
121+
<Trigger SourceName="Popup" Property="Popup.AllowsTransparency" Value="true">
122+
<Setter TargetName="DropDownBorder" Property="CornerRadius" Value="0"/>
123+
<Setter TargetName="DropDownBorder" Property="Margin" Value="0,2,0,0"/>
124+
</Trigger>
125+
<Trigger Property="IsEditable" Value="true">
126+
<Setter Property="IsTabStop" Value="false"/>
127+
<Setter TargetName="PART_EditableTextBox" Property="Visibility" Value="Visible"/>
128+
<Setter TargetName="ContentSite" Property="Visibility" Value="Hidden"/>
129+
</Trigger>
130+
</ControlTemplate.Triggers>
131+
</ControlTemplate>
132+
</Setter.Value>
133+
</Setter>
134+
<Style.Triggers>
135+
</Style.Triggers>
136+
</Style>
137+
138+
<Style x:Key="{x:Type ComboBoxItem}" TargetType="{x:Type ComboBoxItem}">
139+
<Setter Property="SnapsToDevicePixels" Value="true"/>
140+
<Setter Property="Foreground" Value="Black"/>
141+
<Setter Property="OverridesDefaultStyle" Value="true"/>
142+
<Setter Property="Template">
143+
<Setter.Value>
144+
<ControlTemplate TargetType="{x:Type ComboBoxItem}">
145+
<Border Name="Border"
146+
Padding="2"
147+
SnapsToDevicePixels="true">
148+
<ContentPresenter />
149+
</Border>
150+
<ControlTemplate.Triggers>
151+
<Trigger Property="IsHighlighted" Value="true">
152+
<Setter TargetName="Border" Property="Background" Value="{StaticResource MouseOverBrush}"/>
153+
</Trigger>
154+
<Trigger Property="IsEnabled" Value="false">
155+
<Setter Property="Foreground" Value="{StaticResource DisabledControlDarkColor}"/>
156+
</Trigger>
157+
</ControlTemplate.Triggers>
158+
159+
</ControlTemplate>
160+
</Setter.Value>
161+
</Setter>
162+
</Style>
163+
<Style TargetType="ComboBox" BasedOn="{StaticResource StyledComboBox}"/>
164+
165+
</ResourceDictionary>
+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
2+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
3+
<Style x:Key="DefaultBorder" TargetType="Border">
4+
<Setter Property="CornerRadius" Value="{StaticResource CornerRadius}"/>
5+
<Setter Property="BorderBrush" Value="{StaticResource AccentBrush}"/>
6+
<Setter Property="BorderThickness" Value="1"/>
7+
<Setter Property="Height" Value="Auto"/>
8+
<Setter Property="Width" Value="Auto"/>
9+
<Setter Property="Background" Value="Transparent"/>
10+
<Setter Property="Effect">
11+
<Setter.Value>
12+
<DropShadowEffect BlurRadius="2.5" ShadowDepth="1" Opacity="0.2" Direction="260" />
13+
</Setter.Value>
14+
</Setter>
15+
16+
<Style.Triggers>
17+
<Trigger Property="IsEnabled" Value="false">
18+
<Setter Property="Background" Value="{StaticResource DisabledAccentBrush}" />
19+
<Setter Property="BorderBrush" Value="{StaticResource DisabledAccentBrush}" />
20+
</Trigger>
21+
</Style.Triggers>
22+
</Style>
23+
24+
</ResourceDictionary>

Source/AutoHDR/ProcessWatcher.cs

+2
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,8 @@ private void UpdateApplications()
197197
private bool IsFocusedApplication(Process process)
198198
{
199199
Process currentProcess = GetForegroundProcess();
200+
if (currentProcess == null)
201+
return false;
200202
return process.Id.Equals(currentProcess.Id);
201203
}
202204

Source/AutoHDR/Profiles/Actions/DisplayAction.cs

+2
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ public override string ActionDescription
104104
returnValue += $" {ProjectLocales.Resolution} {Resolution.Width}x{Resolution.Height}";
105105
if (SetRefreshRate)
106106
returnValue += $" {ProjectLocales.RefreshRate} {RefreshRate}Hz";
107+
if (SetColorDepth)
108+
returnValue += $" {ProjectLocales.ColorDepth} {ColorDepth}";
107109
return returnValue;
108110
}
109111
}

Source/AutoHDR/Properties/AssemblyInfo.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,5 @@
5252
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
5353
// indem Sie "*" wie unten gezeigt eingeben:
5454
// [assembly: AssemblyVersion("1.0.*")]
55-
[assembly: AssemblyVersion("1.7.22.0")]
56-
[assembly: AssemblyFileVersion("1.7.22.0")]
55+
[assembly: AssemblyVersion("1.8.0.0")]
56+
[assembly: AssemblyFileVersion("1.8.0.0")]

0 commit comments

Comments
 (0)