Skip to content

Commit df3f82d

Browse files
committed
1.9.0
[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.
1 parent 7c19d81 commit df3f82d

23 files changed

+731
-397
lines changed

Source/AutoHDR.ProjectResources/ProjectLocales.Designer.cs

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Source/AutoHDR.ProjectResources/ProjectLocales.de.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@
120120
<data name="Actions" xml:space="preserve">
121121
<value>Aktionen</value>
122122
</data>
123+
<data name="ActionShortcuts" xml:space="preserve">
124+
<value>Schnellaktionen</value>
125+
</data>
123126
<data name="ActionType" xml:space="preserve">
124127
<value>Typ</value>
125128
</data>

Source/AutoHDR.ProjectResources/ProjectLocales.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@
123123
<data name="Actions" xml:space="preserve">
124124
<value>Actions</value>
125125
</data>
126+
<data name="ActionShortcuts" xml:space="preserve">
127+
<value>Action shortcuts</value>
128+
</data>
126129
<data name="ActionType" xml:space="preserve">
127130
<value>Type</value>
128131
</data>

Source/AutoHDR/App.xaml

Lines changed: 30 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
xmlns:tb="http://www.hardcodet.net/taskbar"
1111
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
1212
xmlns:system="clr-namespace:System;assembly=mscorlib"
13+
xmlns:pres="clr-namespace:AutoHDR.ProjectResources;assembly=AutoHDR.ProjectResources"
14+
1315
xmlns:corewpf="clr-namespace:CodectoryCore.UI.Wpf;assembly=CodectoryCore.UI.Wpf"
1416
StartupUri="Views\AutoHDRMainView.xaml">
1517

@@ -230,85 +232,36 @@
230232
</Setter>
231233
</Style>
232234

233-
<Style TargetType="{x:Type ToggleButton}">
234-
<Setter Property="Template">
235-
<Setter.Value>
236-
<ControlTemplate TargetType="{x:Type ToggleButton}">
237-
<Viewbox HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}">
238-
<Grid>
239-
<Border x:Name="Border" Style="{StaticResource DefaultBorder}"
240-
Width="40" Height="20">
241-
<VisualStateManager.VisualStateGroups>
242-
<VisualStateGroup x:Name="CommonStates">
243-
<VisualState x:Name="Normal"></VisualState>
244-
<VisualState x:Name="Disabled">
245-
<Storyboard>
246-
<ColorAnimationUsingKeyFrames Storyboard.TargetName="Border"
247-
Storyboard.TargetProperty="(BorderBrush).(SolidColorBrush.Color)">
248-
<EasingColorKeyFrame KeyTime="0" Value="{StaticResource DisabledBorderColor}" />
249-
</ColorAnimationUsingKeyFrames>
250-
</Storyboard>
251-
</VisualState>
252-
<VisualState x:Name="MouseOver"></VisualState>
253-
</VisualStateGroup>
254-
</VisualStateManager.VisualStateGroups>
255-
</Border>
256-
<Ellipse x:Name="Ellipse" Fill="#FFFFFFFF" Stretch="Uniform"
257-
Margin="3 2 3 2"
258-
Stroke="Gray" StrokeThickness="0.2"
259-
HorizontalAlignment="Stretch">
260-
<Ellipse.Effect>
261-
<DropShadowEffect BlurRadius="{StaticResource DefaultRadius}" ShadowDepth="1" Opacity="0." Direction="260" />
262-
</Ellipse.Effect>
263-
</Ellipse>
264-
</Grid>
265-
</Viewbox>
266235

267-
<ControlTemplate.Triggers>
268-
<EventTrigger RoutedEvent="Checked">
269-
<BeginStoryboard>
270-
<Storyboard>
271-
<ColorAnimation Storyboard.TargetName="Border"
272-
Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)"
273-
To="{StaticResource ActiveColor}"
274-
Duration="0:0:0.1" />
275-
<ThicknessAnimation Storyboard.TargetName="Ellipse"
276-
Storyboard.TargetProperty="Margin"
277-
To="20 1 2 1"
278-
Duration="0:0:0.1" />
279-
</Storyboard>
280-
</BeginStoryboard>
281-
</EventTrigger>
282-
<EventTrigger RoutedEvent="Unchecked">
283-
<BeginStoryboard>
284-
<Storyboard>
285-
<ColorAnimation Storyboard.TargetName="Border"
286-
Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)"
287-
To="White"
288-
Duration="0:0:0.1" />
289-
<ThicknessAnimation Storyboard.TargetName="Ellipse"
290-
Storyboard.TargetProperty="Margin"
291-
To="2 1 2 1"
292-
Duration="0:0:0.1" />
293-
</Storyboard>
294-
</BeginStoryboard>
295-
</EventTrigger>
296-
</ControlTemplate.Triggers>
297-
</ControlTemplate>
298-
</Setter.Value>
299-
</Setter>
300-
<Style.Triggers>
301236

302-
<Trigger Property="IsEnabled" Value="False">
303-
<Setter Property="Border.Background" Value="{StaticResource DisabledAccentBrush}"/>
304-
</Trigger>
305-
</Style.Triggers>
306-
</Style>
307237

308238

239+
<ItemsPanelTemplate x:Key="StackPanelTemplate">
240+
<StackPanel Orientation="Horizontal"/>
241+
</ItemsPanelTemplate>
242+
<ItemsPanelTemplate x:Key="WrapPanelTemplate">
243+
<WrapPanel Orientation="Horizontal"/>
244+
</ItemsPanelTemplate>
245+
<ItemsPanelTemplate x:Key="StackVerticalPanelTemplate">
246+
<StackPanel Orientation="Vertical"/>
247+
</ItemsPanelTemplate>
248+
<ItemsPanelTemplate x:Key="WrapVerticalPanelTemplate">
249+
<WrapPanel Orientation="Vertical"/>
250+
</ItemsPanelTemplate>
309251

310252

311253

254+
<Style x:Key="AddActionButton" TargetType="Button" BasedOn="{StaticResource DefaultButton}">
255+
<Style.Setters>
256+
<Setter Property="FontSize" Value="20"/>
257+
<Setter Property="Background" Value="{StaticResource ActiveBrush}"/>
258+
<Setter Property="VerticalAlignment" Value="Stretch"/>
259+
<Setter Property="HorizontalAlignment" Value="Left"/>
260+
<Setter Property="Height" Value="Auto"/>
261+
<Setter Property="Margin" Value="5"/>
262+
<Setter Property="Content" Value="+"/>
263+
</Style.Setters>
264+
</Style>
312265

313266

314267

@@ -318,7 +271,10 @@
318271

319272

320273

321-
<corewpf:EnumLocaleConverter x:Key="EnumLocaleConverter"/>
274+
275+
276+
277+
<corewpf:EnumLocaleConverter x:Key="EnumLocaleConverter"/>
322278
<corewpf:DialogService x:Key="DialogService" />
323279
<corewpf:DialogService x:Key="ProfileDialogService" />
324280
<corewpf:BitmapToBitmapImageConverter x:Key="BitmapToBitmapImageConverter"/>
@@ -343,6 +299,7 @@
343299
<corewpf:VisibilityBooleanConverter />
344300
</corewpf:ConverterChain>
345301
<corewpf:TupleConverter x:Key="TupleConverter"/>
302+
346303
<DataTemplate DataType="{x:Type local:ApplicationAdder}">
347304
<views:ApplicationAdderView></views:ApplicationAdderView>
348305
</DataTemplate>

Source/AutoHDR/AutoHDR.csproj

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,19 @@
114114
<Reference Include="CodectoryCore.Windows.FileSystem">
115115
<HintPath>..\Externals\CodectoryCore.Windows.FileSystem.dll</HintPath>
116116
</Reference>
117+
<Reference Include="ControlzEx, Version=4.0.0.0, Culture=neutral, PublicKeyToken=69f1c32f803d307e, processorArchitecture=MSIL">
118+
<HintPath>..\packages\ControlzEx.4.4.0\lib\net462\ControlzEx.dll</HintPath>
119+
</Reference>
117120
<Reference Include="Costura, Version=4.1.0.0, Culture=neutral, PublicKeyToken=9919ef960d84173d, processorArchitecture=MSIL">
118121
<HintPath>..\packages\Costura.Fody.4.1.0\lib\net40\Costura.dll</HintPath>
119122
</Reference>
120123
<Reference Include="Hardcodet.Wpf.TaskbarNotification, Version=1.0.5.0, Culture=neutral, processorArchitecture=MSIL">
121124
<HintPath>..\packages\Hardcodet.NotifyIcon.Wpf.1.0.8\lib\net451\Hardcodet.Wpf.TaskbarNotification.dll</HintPath>
122125
<EmbedInteropTypes>False</EmbedInteropTypes>
123126
</Reference>
127+
<Reference Include="Microsoft.Xaml.Behaviors, Version=1.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
128+
<HintPath>..\packages\Microsoft.Xaml.Behaviors.Wpf.1.1.19\lib\net45\Microsoft.Xaml.Behaviors.dll</HintPath>
129+
</Reference>
124130
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
125131
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
126132
</Reference>
@@ -130,6 +136,8 @@
130136
<Reference Include="PresentationCore" />
131137
<Reference Include="System" />
132138
<Reference Include="System.ComponentModel.Composition" />
139+
<Reference Include="System.ComponentModel.DataAnnotations" />
140+
<Reference Include="System.Configuration" />
133141
<Reference Include="System.Data" />
134142
<Reference Include="System.Drawing" />
135143
<Reference Include="System.Drawing.Common, Version=4.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
@@ -151,6 +159,7 @@
151159
</Reference>
152160
<Reference Include="System.ServiceModel" />
153161
<Reference Include="System.Web" />
162+
<Reference Include="System.Web.Extensions" />
154163
<Reference Include="System.Windows.Forms" />
155164
<Reference Include="System.Windows.Interactivity">
156165
<HintPath>..\Externals\System.Windows.Interactivity.dll</HintPath>
@@ -173,18 +182,25 @@
173182
<ItemGroup>
174183
<Compile Include="Globals.cs" />
175184
<Compile Include="LoopManager.cs" />
185+
<Compile Include="ProfileActionShortcut.cs" />
176186
<Compile Include="Profiles\Actions\CloseProgramAction.cs" />
177187
<Compile Include="Profiles\Actions\ReferenceProfileAction.cs" />
178188
<Compile Include="Theming\ThemeResourceDirectory.cs" />
179189
<Compile Include="Theming\Theme.cs" />
180190
<Compile Include="UserAppSettings.cs" />
181191
<Compile Include="UWP\WWAHostHandler.cs" />
192+
<Compile Include="Views\StatusView.xaml.cs">
193+
<DependentUpon>StatusView.xaml</DependentUpon>
194+
</Compile>
182195
<Compile Include="Views\CloseProgramActionView.xaml.cs">
183196
<DependentUpon>CloseProgramActionView.xaml</DependentUpon>
184197
</Compile>
185198
<Compile Include="Views\ReferenceProfileActionView.xaml.cs">
186199
<DependentUpon>ReferenceProfileActionView.xaml</DependentUpon>
187200
</Compile>
201+
<Compile Include="Views\ActionShortcutManagerView.xaml.cs">
202+
<DependentUpon>ActionShortcutManagerView.xaml</DependentUpon>
203+
</Compile>
188204
<Compile Include="WinAPIFunctions.cs" />
189205
<Compile Include="Windows\UI.cs" />
190206
<Page Include="App.xaml">
@@ -271,6 +287,10 @@
271287
<SubType>Designer</SubType>
272288
<Generator>MSBuild:Compile</Generator>
273289
</Page>
290+
<Page Include="Views\StatusView.xaml">
291+
<Generator>MSBuild:Compile</Generator>
292+
<SubType>Designer</SubType>
293+
</Page>
274294
<Page Include="Views\AudioActionView.xaml">
275295
<Generator>MSBuild:Compile</Generator>
276296
<SubType>Designer</SubType>
@@ -315,6 +335,10 @@
315335
<Generator>MSBuild:Compile</Generator>
316336
<SubType>Designer</SubType>
317337
</Page>
338+
<Page Include="Views\ActionShortcutManagerView.xaml">
339+
<Generator>MSBuild:Compile</Generator>
340+
<SubType>Designer</SubType>
341+
</Page>
318342
<Page Include="Views\UWPApplicationDialogView.xaml">
319343
<Generator>MSBuild:Compile</Generator>
320344
<SubType>Designer</SubType>

Source/AutoHDR/AutoHDRDaemon.cs

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ public class AutoHDRDaemon : BaseViewModel
6363
public RelayCommand ShowLogsCommand { get; private set; }
6464
public RelayCommand ShowLicenseCommand { get; private set; }
6565

66-
6766
public RelayCommand LoadingCommand { get; private set; }
6867
public RelayCommand ClosingCommand { get; private set; }
6968
public RelayCommand ShutdownCommand { get; private set; }
@@ -285,6 +284,7 @@ private void CreateRelayCommands()
285284
AddProfileCommand = new RelayCommand(AddProfile);
286285
RemoveProfileCommand = new RelayCommand<Profile>(RemoveProfile);
287286

287+
288288
ClosingCommand = new RelayCommand(Closing);
289289
ShutdownCommand = new RelayCommand(Shutdown);
290290
StartApplicationCommand = new RelayCommand<ApplicationProfileAssignment>(LaunchApplication);
@@ -296,6 +296,9 @@ private void CreateRelayCommands()
296296
}
297297

298298

299+
300+
301+
299302

300303

301304
#endregion Initialization
@@ -325,6 +328,7 @@ private void LoadSettings()
325328
Settings.ApplicationProfileAssignments.Sort(a => a.Position, ListSortDirection.Ascending);
326329
Settings.ApplicationProfileAssignments.CollectionChanged += ApplicationProfileAssigments_CollectionChanged;
327330
Settings.ApplicationProfiles.CollectionChanged += ApplicationProfiles_CollectionChanged;
331+
Settings.ActionShortcuts.CollectionChanged += ActionShortcuts_CollectionChanged;
328332
Settings.Displays.CollectionChanged += Monitors_CollectionChanged;
329333

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

348+
344349
private void FixAssignments()
345350
{
346351
int count = Settings.ApplicationProfileAssignments.Count;
@@ -630,6 +635,31 @@ private void ApplicationProfiles_CollectionChanged(object sender, NotifyCollecti
630635

631636
}
632637

638+
private void ActionShortcuts_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
639+
{
640+
switch (e.Action)
641+
{
642+
643+
case NotifyCollectionChangedAction.Add:
644+
foreach (ProfileActionShortcut shortcut in e.NewItems)
645+
{
646+
Globals.Logs.Add($"Action shortcut added: {shortcut.ShortcutName}", false);
647+
shortcut.PropertyChanged += SaveSettingsOnPropertyChanged;
648+
((BaseViewModel)shortcut.Action).PropertyChanged += SaveSettingsOnPropertyChanged;
649+
}
650+
break;
651+
case NotifyCollectionChangedAction.Remove:
652+
foreach (ProfileActionShortcut shortcut in e.OldItems)
653+
{
654+
Globals.Logs.Add($"Action shortcut removefd: {shortcut.ShortcutName}", false);
655+
shortcut.PropertyChanged -= SaveSettingsOnPropertyChanged;
656+
((BaseViewModel)shortcut.Action).PropertyChanged -= SaveSettingsOnPropertyChanged;
657+
}
658+
break;
659+
}
660+
Globals.Instance.SaveSettings();
661+
}
662+
633663

634664
private void ProfileActions_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
635665
{
@@ -723,8 +753,6 @@ private void SaveSettingsOnPropertyChanged(object sender, PropertyChangedEventAr
723753
Globals.Instance.SaveSettings();
724754
}
725755

726-
727-
728756
private void ShowInfo()
729757
{
730758
ShowInfo(null);

Source/AutoHDR/Controls/2_DefaultControls.xaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,5 +312,4 @@
312312
</Setter>
313313
</Style>
314314
<Style TargetType="CheckBox" BasedOn="{StaticResource DefaultCheckBox}"/>
315-
316315
</ResourceDictionary>

0 commit comments

Comments
 (0)