Skip to content

Commit

Permalink
1.8.0
Browse files Browse the repository at this point in the history
[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
  • Loading branch information
Codectory committed Dec 21, 2021
1 parent 0227c25 commit 7b4a42d
Show file tree
Hide file tree
Showing 17 changed files with 327 additions and 409 deletions.
2 changes: 1 addition & 1 deletion Source/AutoHDR.Displays/DisplayManagerNvidia.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public override void SetColorDepth(Display display, ColorDepth colorDepth)
{
DisplayDevice nvidiaDisplay = new DisplayDevice((uint)display.Tag);
NvAPIWrapper.Native.Display.ColorDataDepth nvColorDepth = colorDepth.ConvertNvidiaColorDepth();
ColorData colorData = new ColorData(nvidiaDisplay.CurrentColorData.ColorFormat, nvidiaDisplay.CurrentColorData.Colorimetry, nvidiaDisplay.CurrentColorData.DynamicRange, NvAPIWrapper.Native.Display.ColorDataDepth.BPC8, nvidiaDisplay.CurrentColorData.SelectionPolicy, nvidiaDisplay.CurrentColorData.DesktopColorDepth);
ColorData colorData = new ColorData(nvidiaDisplay.CurrentColorData.ColorFormat, nvidiaDisplay.CurrentColorData.Colorimetry, nvidiaDisplay.CurrentColorData.DynamicRange, nvColorDepth, nvidiaDisplay.CurrentColorData.SelectionPolicy, nvidiaDisplay.CurrentColorData.DesktopColorDepth);
nvidiaDisplay.SetColorData(colorData);
}

Expand Down
6 changes: 3 additions & 3 deletions Source/AutoHDR.ProjectResources/ProjectLocales.Designer.cs

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

4 changes: 2 additions & 2 deletions Source/AutoHDR.ProjectResources/ProjectLocales.de.resx
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@
<data name="IsPrimaryMonitor" xml:space="preserve">
<value>Hauptmonitor</value>
</data>
<data name="LastAction" xml:space="preserve">
<value>Letzte Aktion</value>
<data name="LastActions" xml:space="preserve">
<value>Letzte Aktionen</value>
</data>
<data name="LaunchApplication" xml:space="preserve">
<value>Starte Anwendung</value>
Expand Down
4 changes: 2 additions & 2 deletions Source/AutoHDR.ProjectResources/ProjectLocales.resx
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,8 @@
<data name="IsPrimaryMonitor" xml:space="preserve">
<value>Primary</value>
</data>
<data name="LastAction" xml:space="preserve">
<value>Last action</value>
<data name="LastActions" xml:space="preserve">
<value>Last actions</value>
</data>
<data name="LaunchApplication" xml:space="preserve">
<value>Launch application</value>
Expand Down
424 changes: 41 additions & 383 deletions Source/AutoHDR/App.xaml

Large diffs are not rendered by default.

17 changes: 16 additions & 1 deletion Source/AutoHDR/AutoHDR.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,22 @@
<Compile Include="UWP\AppxManifest.cs" />
<Compile Include="UWP\UWPAppsManager.cs" />
<Compile Include="UWP\UWPApp.cs" />
<Page Include="Controls\Colors.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Controls\ControlProperties.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Controls\CustomComboBox.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Controls\DefaultBorder.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Theming\LightColors.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
Expand Down Expand Up @@ -385,7 +401,6 @@
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<Folder Include="Displays\" />
<Folder Include="Plugins\" />
</ItemGroup>
<ItemGroup>
Expand Down
37 changes: 37 additions & 0 deletions Source/AutoHDR/Controls/Colors.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/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="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="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"/>


</ResourceDictionary>
8 changes: 8 additions & 0 deletions Source/AutoHDR/Controls/ControlProperties.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib">

<system:Double x:Key="DefaultFontSize">15</system:Double>
<system:Double x:Key="DefaultRadius">7.5</system:Double>
<CornerRadius x:Key="CornerRadius">7.5</CornerRadius>
</ResourceDictionary>
165 changes: 165 additions & 0 deletions Source/AutoHDR/Controls/CustomComboBox.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity">

<ControlTemplate x:Key="ComboBoxToggleButton" TargetType="{x:Type ToggleButton}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="20" />
</Grid.ColumnDefinitions>
<Border Style="{StaticResource DefaultBorder}"
x:Name="Border"
Grid.ColumnSpan="2"
Background="{StaticResource ControlLightBrush}"
BorderBrush="{StaticResource AccentBrush}"
BorderThickness="1" />
<Border
Grid.Column="0"
CornerRadius="0"
Margin="10,1,0,1"
Background="{Binding ElementName=Border, Path=Background}"
BorderBrush="{Binding ElementName=Border, Path=BorderBrush}"
BorderThickness="0,0,1,0" />
<Path
x:Name="Arrow"
Grid.Column="1"
Fill="{StaticResource GlyphBrush}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Data="M0,0 L0,2 L4,6 L8,2 L8,0 L4,4 z"
/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="ToggleButton.IsMouseOver" Value="true">
<Setter TargetName="Border" Property="Background" Value="{StaticResource MouseOverBrush}" />
</Trigger>
<Trigger Property="ToggleButton.IsChecked" Value="true">
<Setter TargetName="Border" Property="Background" Value="{StaticResource AccentBrush}" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="Border" Property="Background" Value="{StaticResource DisabledAccentBrush}" />
<Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledAccentBrush}" />
<Setter Property="Foreground" Value="Black"/>
<Setter TargetName="Arrow" Property="Fill" Value="{StaticResource GlyphBrush}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>

<ControlTemplate x:Key="ComboBoxTextBox" TargetType="{x:Type TextBox}">
<Border x:Name="PART_ContentHost" Focusable="False" Background="{TemplateBinding Background}" />
</ControlTemplate>

<Style x:Key="StyledComboBox" TargetType="{x:Type ComboBox}">
<Setter Property="SnapsToDevicePixels" Value="true"/>
<Setter Property="OverridesDefaultStyle" Value="true"/>
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
<Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
<Setter Property="MinWidth" Value="120"/>
<Setter Property="MinHeight" Value="20"/>
<Setter Property="Foreground" Value="Black"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ComboBox}">
<Grid>
<ToggleButton
Name="ToggleButton"
Template="{StaticResource ComboBoxToggleButton}"
Grid.Column="2"
Focusable="false"
IsChecked="{Binding Path=IsDropDownOpen,Mode=TwoWay,RelativeSource={RelativeSource TemplatedParent}}"
ClickMode="Press">
</ToggleButton>
<ContentPresenter Name="ContentSite" IsHitTestVisible="False" Content="{TemplateBinding SelectionBoxItem}"
ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
Margin="5,3,23,3"
VerticalAlignment="Center"
HorizontalAlignment="Left" />
<TextBox x:Name="PART_EditableTextBox"
Style="{x:Null}"
Template="{StaticResource ComboBoxTextBox}"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Margin="5,5,23,3"
Focusable="True"
Background="{StaticResource ControlLightBrush}"
Visibility="Hidden"
IsReadOnly="{TemplateBinding IsReadOnly}"/>
<Popup
Name="Popup"
Placement="Bottom"
IsOpen="{TemplateBinding IsDropDownOpen}"
AllowsTransparency="True"
Focusable="False"
PopupAnimation="Slide">

<Grid Name="DropDown"
SnapsToDevicePixels="True"
MinWidth="{TemplateBinding ActualWidth}"
MaxHeight="{TemplateBinding MaxDropDownHeight}">
<Border
x:Name="DropDownBorder" Style="{StaticResource DefaultBorder}" CornerRadius="5"
Background="{StaticResource ControlLightBrush}" BorderThickness="1,1,1,1"/>
<ScrollViewer Margin="4,6,4,6" SnapsToDevicePixels="True">
<StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained" />
</ScrollViewer>
</Grid>
</Popup>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="HasItems" Value="false">
<Setter TargetName="DropDownBorder" Property="MinHeight" Value="95"/>
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground" Value="{StaticResource DisabledControlDarkColor}"/>
</Trigger>
<Trigger Property="IsGrouping" Value="true">
<Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
</Trigger>
<Trigger SourceName="Popup" Property="Popup.AllowsTransparency" Value="true">
<Setter TargetName="DropDownBorder" Property="CornerRadius" Value="0"/>
<Setter TargetName="DropDownBorder" Property="Margin" Value="0,2,0,0"/>
</Trigger>
<Trigger Property="IsEditable" Value="true">
<Setter Property="IsTabStop" Value="false"/>
<Setter TargetName="PART_EditableTextBox" Property="Visibility" Value="Visible"/>
<Setter TargetName="ContentSite" Property="Visibility" Value="Hidden"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
</Style.Triggers>
</Style>

<Style x:Key="{x:Type ComboBoxItem}" TargetType="{x:Type ComboBoxItem}">
<Setter Property="SnapsToDevicePixels" Value="true"/>
<Setter Property="Foreground" Value="Black"/>
<Setter Property="OverridesDefaultStyle" Value="true"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ComboBoxItem}">
<Border Name="Border"
Padding="2"
SnapsToDevicePixels="true">
<ContentPresenter />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsHighlighted" Value="true">
<Setter TargetName="Border" Property="Background" Value="{StaticResource MouseOverBrush}"/>
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground" Value="{StaticResource DisabledControlDarkColor}"/>
</Trigger>
</ControlTemplate.Triggers>

</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="ComboBox" BasedOn="{StaticResource StyledComboBox}"/>

</ResourceDictionary>
24 changes: 24 additions & 0 deletions Source/AutoHDR/Controls/DefaultBorder.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style x:Key="DefaultBorder" TargetType="Border">
<Setter Property="CornerRadius" Value="{StaticResource CornerRadius}"/>
<Setter Property="BorderBrush" Value="{StaticResource AccentBrush}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Height" Value="Auto"/>
<Setter Property="Width" Value="Auto"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Effect">
<Setter.Value>
<DropShadowEffect BlurRadius="2.5" ShadowDepth="1" Opacity="0.2" Direction="260" />
</Setter.Value>
</Setter>

<Style.Triggers>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Background" Value="{StaticResource DisabledAccentBrush}" />
<Setter Property="BorderBrush" Value="{StaticResource DisabledAccentBrush}" />
</Trigger>
</Style.Triggers>
</Style>

</ResourceDictionary>
2 changes: 2 additions & 0 deletions Source/AutoHDR/ProcessWatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ private void UpdateApplications()
private bool IsFocusedApplication(Process process)
{
Process currentProcess = GetForegroundProcess();
if (currentProcess == null)
return false;
return process.Id.Equals(currentProcess.Id);
}

Expand Down
2 changes: 2 additions & 0 deletions Source/AutoHDR/Profiles/Actions/DisplayAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ public override string ActionDescription
returnValue += $" {ProjectLocales.Resolution} {Resolution.Width}x{Resolution.Height}";
if (SetRefreshRate)
returnValue += $" {ProjectLocales.RefreshRate} {RefreshRate}Hz";
if (SetColorDepth)
returnValue += $" {ProjectLocales.ColorDepth} {ColorDepth}";
return returnValue;
}
}
Expand Down
4 changes: 2 additions & 2 deletions Source/AutoHDR/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
// indem Sie "*" wie unten gezeigt eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.7.22.0")]
[assembly: AssemblyFileVersion("1.7.22.0")]
[assembly: AssemblyVersion("1.8.0.0")]
[assembly: AssemblyFileVersion("1.8.0.0")]
Loading

0 comments on commit 7b4a42d

Please sign in to comment.