Skip to content

Commit

Permalink
Ctrl Space for next set
Browse files Browse the repository at this point in the history
  • Loading branch information
ImoutoChan committed Sep 6, 2024
1 parent 20f69cd commit a114e2b
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public App() => Startup += async (_, _) =>
catch (Exception e)
{
Log.Error(e, "Error during application startup");
Application.Current.Shutdown();
}
};

Expand All @@ -39,7 +40,7 @@ protected override void OnStartup(StartupEventArgs startupEventArgs)
{
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Debug()
.WriteTo.Console()
.WriteTo.Console()
.WriteTo.File("logs/log.txt", rollingInterval: RollingInterval.Day, retainedFileCountLimit: 10)
.Enrich.WithThreadId()
.Enrich.WithThreadName()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Text.Json;
using System.Windows;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using ImoutoRebirth.Common;
using ImoutoRebirth.Navigator.Services.Tags.Model;

Expand Down Expand Up @@ -53,15 +54,12 @@ private void Load()

foreach (var set in savedSets)
Sets.Add(set);
}

//foreach (var savedSet in savedSets.Where(x => x.Packs.Any(y => y.Any())))
//{
// var set = new TagsPacksSetVM();
// set.
// foreach (var pack in savedSet.Packs.Where(x => x.Any()))
// set.AddNext(pack);

// Sets.Add(set);
//}
[RelayCommand]
private void SelectNext()
{
var index = Sets.IndexOf(Selected);
Selected = index == Sets.Count - 1 ? Sets.First() : Sets[index + 1];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,16 @@
</ItemsControl.ItemContainerStyle>
</ItemsControl>

<TextBlock Grid.Row="2" Height="65">
<TextBlock Grid.Row="2" Height="85">
<Run Text="CTRL + ↵ | Apply Selected" />
<LineBreak />
<Run Text="CTRL + → | Create pack" />
<LineBreak />
<Run Text="CTRL + X | Clear selected" />
<LineBreak />
<Run Text="CTRL + SHIFT + X | Clear quick apply" />
<LineBreak />
<Run Text="CTRL + SPACE | Next set" />
</TextBlock>
</Grid>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@ private async void QuickTaggingView_OnPreviewKeyDown(object sender, KeyEventArgs
e.Handled = true;
}

// select next pack set
if (e.Key is Key.Space && Keyboard.Modifiers.HasFlag(ModifierKeys.Control))
{
DataContextVM.AvailableTagPacksSets.SelectNextCommand.Execute(null);
e.Handled = true;
}

// apply packs
if (Keyboard.Modifiers.HasFlag(ModifierKeys.Control))
{
Expand Down

0 comments on commit a114e2b

Please sign in to comment.