Skip to content

Commit

Permalink
Fix add time shortcut handling
Browse files Browse the repository at this point in the history
  • Loading branch information
DominicSaladin committed Mar 4, 2024
1 parent 1c1651b commit ddd4687
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
5 changes: 0 additions & 5 deletions speed-time/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@
</Style.Triggers>
</Style>
</potato:DSWindow.Resources>
<behaviors:Interaction.Triggers>
<behaviors:KeyTrigger Modifiers="{Binding RegisteredHotKey.RegisteredModifierKeys}" Key="{Binding RegisteredHotKey.RegisteredKey}" FiredOn="KeyDown">
<behaviors:InvokeCommandAction Command="{Binding AddTrackingCommand}" />
</behaviors:KeyTrigger>
</behaviors:Interaction.Triggers>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="50" />
Expand Down
6 changes: 6 additions & 0 deletions speed-time/ViewModel/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,12 @@ public override void WindowLoaded(object sender, RoutedEventArgs eventArgs)
TrackedTimes = App.dbContext.TrackedTimes.Local.ToObservableCollection();
App.dbContext.SavedChanges += (s, e) => UpdateView();

((DSWindow)sender).PreviewKeyDown += (s, e) =>
{
if (e.Key == RegisteredHotKey.RegisteredKey && Keyboard.Modifiers == RegisteredHotKey.RegisteredModifierKeys)
AddTrackingCommand.Execute(null);
};

UpdateView();
}

Expand Down
4 changes: 2 additions & 2 deletions speed-time/speed-time.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<PackageReadmeFile>README.md</PackageReadmeFile>
<ApplicationIcon>Icon.ico</ApplicationIcon>
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
<Version>0.16</Version>
<Version>0.16.1</Version>
<SignAssembly>True</SignAssembly>
<AssemblyOriginatorKeyFile></AssemblyOriginatorKeyFile>
</PropertyGroup>
Expand All @@ -44,7 +44,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="DSaladin.FancyPotato" Version="0.5.4" />
<PackageReference Include="DSaladin.FancyPotato" Version="0.5.6" />
<PackageReference Include="DSaladin.FontAwesome.WPF" Version="6.3.0" />
<PackageReference Include="GlobalHotKey" Version="1.1.0" />
<PackageReference Include="LiveChartsCore.SkiaSharpView.WPF" Version="2.0.0-rc1.2" />
Expand Down

0 comments on commit ddd4687

Please sign in to comment.