Skip to content

Commit

Permalink
v3.0.0.43 - Fix paste not being detected in Tag TextBox and Tag Warni…
Browse files Browse the repository at this point in the history
…ng label in grid.
  • Loading branch information
Anonymous authored and Anonymous committed Nov 9, 2024
1 parent 0a3a69e commit 88ddef5
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 34 deletions.
70 changes: 37 additions & 33 deletions e621 ReBot v3/Windows/Window_Tagger.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,36 @@ private void Tags_TextBox_KeyDown(object sender, KeyEventArgs e)
e.Handled = true;
return;
}
case Key.V:
}
}

private void Tags_TextBox_PreviewKeyDown(object sender, KeyEventArgs e)
{
switch (e.Key)
{
case Key.Space:
{
if (Tags_TextBox.Text.Substring(Tags_TextBox.SelectionStart - 1, 1).Equals(" "))
{
e.Handled = true;
break;
}
if (Tags_TextBox.SelectionStart + 1 <= Tags_TextBox.Text.Length && Tags_TextBox.Text.Substring(Tags_TextBox.SelectionStart, 1).Equals(" "))
{
e.Handled = true;
break;
}
Dispatcher.BeginInvoke(CountTags);
break;
}
case Key.Back:
case Key.Delete:
{
Dispatcher.BeginInvoke(CountTags);
break;
}

case Key.V: //Doesn't work in KeyDown
{
if (Keyboard.Modifiers.HasFlag(ModifierKeys.Control))
{
Expand All @@ -255,7 +284,7 @@ private void Tags_TextBox_KeyDown(object sender, KeyEventArgs e)
}
}
SortTags.AddRange(PasteTags);
Tags_TextBox.Text += $"{string.Join(' ', SortTags)} ";
Tags_TextBox.Text = $"{string.Join(' ', SortTags)} ";
}
Tags_TextBox.SelectionStart = Tags_TextBox.Text.Length;
CountTags();
Expand All @@ -267,34 +296,6 @@ private void Tags_TextBox_KeyDown(object sender, KeyEventArgs e)
}
}

private void Tags_TextBox_PreviewKeyDown(object sender, KeyEventArgs e)
{
switch (e.Key)
{
case Key.Space:
{
if (Tags_TextBox.Text.Substring(Tags_TextBox.SelectionStart - 1, 1).Equals(" "))
{
e.Handled = true;
break;
}
if (Tags_TextBox.SelectionStart + 1 <= Tags_TextBox.Text.Length && Tags_TextBox.Text.Substring(Tags_TextBox.SelectionStart, 1).Equals(" "))
{
e.Handled = true;
break;
}
Dispatcher.BeginInvoke(CountTags);
break;
}
case Key.Back:
case Key.Delete:
{
Dispatcher.BeginInvoke(CountTags);
break;
}
}
}

private void Tags_TextBox_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
CursorClickChange = true;
Expand Down Expand Up @@ -326,9 +327,12 @@ private void AddTags()
Tags_TextBox.Text = string.Join(' ', SortTags).ToLower();

if (ReferenceEquals(Owner, Window_Preview._RefHolder)) Window_Preview._RefHolder.Tags_TextBlock.Text = Tags_TextBox.Text;
GridVE GridVETemp = Module_Grabber.IsVisibleInGrid(MediaItemHolder);
if (GridVETemp != null) GridVETemp.cTagWarning_TextBlock.Visibility = SortTags.Count < 8 ? Visibility.Visible : Visibility.Hidden;
TagsAdded = true;
if (MediaItemHolder.UP_UploadedID == null)
{
GridVE GridVETemp = Module_Grabber.IsVisibleInGrid(MediaItemHolder);
if (GridVETemp != null) GridVETemp.cTagWarning_TextBlock.Visibility = SortTags.Count < 16 ? Visibility.Visible : Visibility.Hidden;
TagsAdded = true;
}
}

private void TB_Description_Click(object sender, RoutedEventArgs e)
Expand Down
2 changes: 1 addition & 1 deletion e621 ReBot v3/e621 ReBot v3.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<ApplicationIcon>Resources\ReBot_Icon.ico</ApplicationIcon>
<Platforms>x64</Platforms>
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
<FileVersion>3.0.0.42</FileVersion>
<FileVersion>3.0.0.43</FileVersion>
<StartupObject>e621_ReBot_v3.App</StartupObject>
<IsPublishable>False</IsPublishable>
<RepositoryUrl>https://github.com/e621-ReBot/e621-ReBot-v3</RepositoryUrl>
Expand Down

0 comments on commit 88ddef5

Please sign in to comment.