Skip to content

Commit

Permalink
1.9.0
Browse files Browse the repository at this point in the history
[New]
- New status view
- Action shortcuts: Create actions an run them in the new status view or in tray menu.
- Start applications in new status view or in tray menu.
  • Loading branch information
Codectory committed Dec 30, 2021
1 parent 7c19d81 commit df3f82d
Show file tree
Hide file tree
Showing 23 changed files with 731 additions and 397 deletions.
9 changes: 9 additions & 0 deletions Source/AutoHDR.ProjectResources/ProjectLocales.Designer.cs

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

3 changes: 3 additions & 0 deletions Source/AutoHDR.ProjectResources/ProjectLocales.de.resx
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@
<data name="Actions" xml:space="preserve">
<value>Aktionen</value>
</data>
<data name="ActionShortcuts" xml:space="preserve">
<value>Schnellaktionen</value>
</data>
<data name="ActionType" xml:space="preserve">
<value>Typ</value>
</data>
Expand Down
3 changes: 3 additions & 0 deletions Source/AutoHDR.ProjectResources/ProjectLocales.resx
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@
<data name="Actions" xml:space="preserve">
<value>Actions</value>
</data>
<data name="ActionShortcuts" xml:space="preserve">
<value>Action shortcuts</value>
</data>
<data name="ActionType" xml:space="preserve">
<value>Type</value>
</data>
Expand Down
103 changes: 30 additions & 73 deletions Source/AutoHDR/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
xmlns:tb="http://www.hardcodet.net/taskbar"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:system="clr-namespace:System;assembly=mscorlib"
xmlns:pres="clr-namespace:AutoHDR.ProjectResources;assembly=AutoHDR.ProjectResources"

xmlns:corewpf="clr-namespace:CodectoryCore.UI.Wpf;assembly=CodectoryCore.UI.Wpf"
StartupUri="Views\AutoHDRMainView.xaml">

Expand Down Expand Up @@ -230,85 +232,36 @@
</Setter>
</Style>

<Style TargetType="{x:Type ToggleButton}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ToggleButton}">
<Viewbox HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}">
<Grid>
<Border x:Name="Border" Style="{StaticResource DefaultBorder}"
Width="40" Height="20">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal"></VisualState>
<VisualState x:Name="Disabled">
<Storyboard>
<ColorAnimationUsingKeyFrames Storyboard.TargetName="Border"
Storyboard.TargetProperty="(BorderBrush).(SolidColorBrush.Color)">
<EasingColorKeyFrame KeyTime="0" Value="{StaticResource DisabledBorderColor}" />
</ColorAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="MouseOver"></VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
</Border>
<Ellipse x:Name="Ellipse" Fill="#FFFFFFFF" Stretch="Uniform"
Margin="3 2 3 2"
Stroke="Gray" StrokeThickness="0.2"
HorizontalAlignment="Stretch">
<Ellipse.Effect>
<DropShadowEffect BlurRadius="{StaticResource DefaultRadius}" ShadowDepth="1" Opacity="0." Direction="260" />
</Ellipse.Effect>
</Ellipse>
</Grid>
</Viewbox>

<ControlTemplate.Triggers>
<EventTrigger RoutedEvent="Checked">
<BeginStoryboard>
<Storyboard>
<ColorAnimation Storyboard.TargetName="Border"
Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)"
To="{StaticResource ActiveColor}"
Duration="0:0:0.1" />
<ThicknessAnimation Storyboard.TargetName="Ellipse"
Storyboard.TargetProperty="Margin"
To="20 1 2 1"
Duration="0:0:0.1" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
<EventTrigger RoutedEvent="Unchecked">
<BeginStoryboard>
<Storyboard>
<ColorAnimation Storyboard.TargetName="Border"
Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)"
To="White"
Duration="0:0:0.1" />
<ThicknessAnimation Storyboard.TargetName="Ellipse"
Storyboard.TargetProperty="Margin"
To="2 1 2 1"
Duration="0:0:0.1" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>

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


<ItemsPanelTemplate x:Key="StackPanelTemplate">
<StackPanel Orientation="Horizontal"/>
</ItemsPanelTemplate>
<ItemsPanelTemplate x:Key="WrapPanelTemplate">
<WrapPanel Orientation="Horizontal"/>
</ItemsPanelTemplate>
<ItemsPanelTemplate x:Key="StackVerticalPanelTemplate">
<StackPanel Orientation="Vertical"/>
</ItemsPanelTemplate>
<ItemsPanelTemplate x:Key="WrapVerticalPanelTemplate">
<WrapPanel Orientation="Vertical"/>
</ItemsPanelTemplate>



<Style x:Key="AddActionButton" TargetType="Button" BasedOn="{StaticResource DefaultButton}">
<Style.Setters>
<Setter Property="FontSize" Value="20"/>
<Setter Property="Background" Value="{StaticResource ActiveBrush}"/>
<Setter Property="VerticalAlignment" Value="Stretch"/>
<Setter Property="HorizontalAlignment" Value="Left"/>
<Setter Property="Height" Value="Auto"/>
<Setter Property="Margin" Value="5"/>
<Setter Property="Content" Value="+"/>
</Style.Setters>
</Style>



Expand All @@ -318,7 +271,10 @@



<corewpf:EnumLocaleConverter x:Key="EnumLocaleConverter"/>



<corewpf:EnumLocaleConverter x:Key="EnumLocaleConverter"/>
<corewpf:DialogService x:Key="DialogService" />
<corewpf:DialogService x:Key="ProfileDialogService" />
<corewpf:BitmapToBitmapImageConverter x:Key="BitmapToBitmapImageConverter"/>
Expand All @@ -343,6 +299,7 @@
<corewpf:VisibilityBooleanConverter />
</corewpf:ConverterChain>
<corewpf:TupleConverter x:Key="TupleConverter"/>

<DataTemplate DataType="{x:Type local:ApplicationAdder}">
<views:ApplicationAdderView></views:ApplicationAdderView>
</DataTemplate>
Expand Down
24 changes: 24 additions & 0 deletions Source/AutoHDR/AutoHDR.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,19 @@
<Reference Include="CodectoryCore.Windows.FileSystem">
<HintPath>..\Externals\CodectoryCore.Windows.FileSystem.dll</HintPath>
</Reference>
<Reference Include="ControlzEx, Version=4.0.0.0, Culture=neutral, PublicKeyToken=69f1c32f803d307e, processorArchitecture=MSIL">
<HintPath>..\packages\ControlzEx.4.4.0\lib\net462\ControlzEx.dll</HintPath>
</Reference>
<Reference Include="Costura, Version=4.1.0.0, Culture=neutral, PublicKeyToken=9919ef960d84173d, processorArchitecture=MSIL">
<HintPath>..\packages\Costura.Fody.4.1.0\lib\net40\Costura.dll</HintPath>
</Reference>
<Reference Include="Hardcodet.Wpf.TaskbarNotification, Version=1.0.5.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Hardcodet.NotifyIcon.Wpf.1.0.8\lib\net451\Hardcodet.Wpf.TaskbarNotification.dll</HintPath>
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference>
<Reference Include="Microsoft.Xaml.Behaviors, Version=1.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Xaml.Behaviors.Wpf.1.1.19\lib\net45\Microsoft.Xaml.Behaviors.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
Expand All @@ -130,6 +136,8 @@
<Reference Include="PresentationCore" />
<Reference Include="System" />
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Configuration" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Drawing.Common, Version=4.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
Expand All @@ -151,6 +159,7 @@
</Reference>
<Reference Include="System.ServiceModel" />
<Reference Include="System.Web" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Windows.Interactivity">
<HintPath>..\Externals\System.Windows.Interactivity.dll</HintPath>
Expand All @@ -173,18 +182,25 @@
<ItemGroup>
<Compile Include="Globals.cs" />
<Compile Include="LoopManager.cs" />
<Compile Include="ProfileActionShortcut.cs" />
<Compile Include="Profiles\Actions\CloseProgramAction.cs" />
<Compile Include="Profiles\Actions\ReferenceProfileAction.cs" />
<Compile Include="Theming\ThemeResourceDirectory.cs" />
<Compile Include="Theming\Theme.cs" />
<Compile Include="UserAppSettings.cs" />
<Compile Include="UWP\WWAHostHandler.cs" />
<Compile Include="Views\StatusView.xaml.cs">
<DependentUpon>StatusView.xaml</DependentUpon>
</Compile>
<Compile Include="Views\CloseProgramActionView.xaml.cs">
<DependentUpon>CloseProgramActionView.xaml</DependentUpon>
</Compile>
<Compile Include="Views\ReferenceProfileActionView.xaml.cs">
<DependentUpon>ReferenceProfileActionView.xaml</DependentUpon>
</Compile>
<Compile Include="Views\ActionShortcutManagerView.xaml.cs">
<DependentUpon>ActionShortcutManagerView.xaml</DependentUpon>
</Compile>
<Compile Include="WinAPIFunctions.cs" />
<Compile Include="Windows\UI.cs" />
<Page Include="App.xaml">
Expand Down Expand Up @@ -271,6 +287,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\StatusView.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Views\AudioActionView.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
Expand Down Expand Up @@ -315,6 +335,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Views\ActionShortcutManagerView.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Views\UWPApplicationDialogView.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
Expand Down
34 changes: 31 additions & 3 deletions Source/AutoHDR/AutoHDRDaemon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ public class AutoHDRDaemon : BaseViewModel
public RelayCommand ShowLogsCommand { get; private set; }
public RelayCommand ShowLicenseCommand { get; private set; }


public RelayCommand LoadingCommand { get; private set; }
public RelayCommand ClosingCommand { get; private set; }
public RelayCommand ShutdownCommand { get; private set; }
Expand Down Expand Up @@ -285,6 +284,7 @@ private void CreateRelayCommands()
AddProfileCommand = new RelayCommand(AddProfile);
RemoveProfileCommand = new RelayCommand<Profile>(RemoveProfile);


ClosingCommand = new RelayCommand(Closing);
ShutdownCommand = new RelayCommand(Shutdown);
StartApplicationCommand = new RelayCommand<ApplicationProfileAssignment>(LaunchApplication);
Expand All @@ -296,6 +296,9 @@ private void CreateRelayCommands()
}







#endregion Initialization
Expand Down Expand Up @@ -325,6 +328,7 @@ private void LoadSettings()
Settings.ApplicationProfileAssignments.Sort(a => a.Position, ListSortDirection.Ascending);
Settings.ApplicationProfileAssignments.CollectionChanged += ApplicationProfileAssigments_CollectionChanged;
Settings.ApplicationProfiles.CollectionChanged += ApplicationProfiles_CollectionChanged;
Settings.ActionShortcuts.CollectionChanged += ActionShortcuts_CollectionChanged;
Settings.Displays.CollectionChanged += Monitors_CollectionChanged;

Settings.PropertyChanged += Settings_PropertyChanged;
Expand All @@ -341,6 +345,7 @@ private void LoadSettings()
Globals.Logs.Add("Iniialized settings", false);
}


private void FixAssignments()
{
int count = Settings.ApplicationProfileAssignments.Count;
Expand Down Expand Up @@ -630,6 +635,31 @@ private void ApplicationProfiles_CollectionChanged(object sender, NotifyCollecti

}

private void ActionShortcuts_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
{
switch (e.Action)
{

case NotifyCollectionChangedAction.Add:
foreach (ProfileActionShortcut shortcut in e.NewItems)
{
Globals.Logs.Add($"Action shortcut added: {shortcut.ShortcutName}", false);
shortcut.PropertyChanged += SaveSettingsOnPropertyChanged;
((BaseViewModel)shortcut.Action).PropertyChanged += SaveSettingsOnPropertyChanged;
}
break;
case NotifyCollectionChangedAction.Remove:
foreach (ProfileActionShortcut shortcut in e.OldItems)
{
Globals.Logs.Add($"Action shortcut removefd: {shortcut.ShortcutName}", false);
shortcut.PropertyChanged -= SaveSettingsOnPropertyChanged;
((BaseViewModel)shortcut.Action).PropertyChanged -= SaveSettingsOnPropertyChanged;
}
break;
}
Globals.Instance.SaveSettings();
}


private void ProfileActions_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
{
Expand Down Expand Up @@ -723,8 +753,6 @@ private void SaveSettingsOnPropertyChanged(object sender, PropertyChangedEventAr
Globals.Instance.SaveSettings();
}



private void ShowInfo()
{
ShowInfo(null);
Expand Down
1 change: 0 additions & 1 deletion Source/AutoHDR/Controls/2_DefaultControls.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -312,5 +312,4 @@
</Setter>
</Style>
<Style TargetType="CheckBox" BasedOn="{StaticResource DefaultCheckBox}"/>

</ResourceDictionary>
Loading

0 comments on commit df3f82d

Please sign in to comment.