Skip to content

Commit 6016015

Browse files
committed
esc key to activate recent grid if empty search
1 parent 3632167 commit 6016015

File tree

2 files changed

+34
-11
lines changed

2 files changed

+34
-11
lines changed

UnityLauncherPro/MainWindow.xaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,9 @@
568568
<Button Style="{StaticResource CustomButton}" x:Name="btnOpenPlayerLogs" Margin="10,0,0,0" BorderBrush="{x:Null}" HorizontalAlignment="Left" VerticalAlignment="Top" Click="BtnOpenPlayerLogs_Click" ToolTip="Open Player logs folder in Explorer">
569569
<Label Content="_Player Logs" Foreground="{Binding Path=Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Control}}}" />
570570
</Button>
571+
<Button Style="{StaticResource CustomButton}" x:Name="btnAssetPackages" Margin="10,0,0,0" BorderBrush="{x:Null}" HorizontalAlignment="Left" VerticalAlignment="Top" ToolTip="Open assetstore downloads folder in Explorer" Click="BtnAssetPackages_Click">
572+
<Label Content="A_sset packages" Foreground="{Binding Path=Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Control}}}" />
573+
</Button>
571574
<Button Style="{StaticResource CustomButton}" x:Name="btnOpenADBLogCat" Margin="10,0,0,0" BorderBrush="{x:Null}" HorizontalAlignment="Left" VerticalAlignment="Top" Click="BtnOpenADBLogCat_Click" ToolTip="Start ADB logcat commandline">
572575
<Label Content="_ADB logcat" Foreground="{Binding Path=Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Control}}}" />
573576
</Button>

UnityLauncherPro/MainWindow.xaml.cs

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -367,17 +367,23 @@ async void CallGetUnityUpdates()
367367
//
368368
//
369369

370-
private void OnSearchPreviewKeyDown(object sender, KeyEventArgs e)
371-
{
372-
switch (e.Key)
373-
{
374-
case Key.Escape:
375-
((TextBox)sender).Text = "";
376-
break;
377-
default:
378-
break;
379-
}
380-
}
370+
//private void OnSearchPreviewKeyDown(object sender, KeyEventArgs e)
371+
//{
372+
// switch (e.Key)
373+
// {
374+
// case Key.Escape:
375+
// if (((TextBox)sender).Text == "")
376+
// {
377+
// Console.WriteLine(1);
378+
// Keyboard.Focus(gridRecent);
379+
// e.Handled = true;
380+
// }
381+
// ((TextBox)sender).Text = "";
382+
// break;
383+
// default:
384+
// break;
385+
// }
386+
//}
381387

382388
void NotifyIcon_MouseClick(object sender, System.Windows.Forms.MouseEventArgs e)
383389
{
@@ -489,6 +495,10 @@ private void OnWindowKeyDown(object sender, KeyEventArgs e)
489495
gridRecent.ItemsSource = projectsSource;
490496
break;
491497
case Key.Escape: // clear project search
498+
if (txtSearchBox.Text == "")
499+
{
500+
SetFocusToGrid(gridRecent);
501+
}
492502
txtSearchBox.Text = "";
493503
break;
494504
case Key.F2: // edit arguments
@@ -1075,5 +1085,15 @@ private void ChkAllowSingleInstanceOnly_CheckedChanged(object sender, RoutedEven
10751085
Properties.Settings.Default.AllowSingleInstanceOnly = (bool)chkAllowSingleInstanceOnly.IsChecked;
10761086
Properties.Settings.Default.Save();
10771087
}
1088+
1089+
private void BtnAssetPackages_Click(object sender, RoutedEventArgs e)
1090+
{
1091+
var folder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Unity", "Asset Store-5.x");
1092+
if (Directory.Exists(folder) == false) return;
1093+
if (Tools.LaunchExplorer(folder) == false)
1094+
{
1095+
Console.WriteLine("Cannot open folder.." + folder);
1096+
}
1097+
}
10781098
} // class
10791099
} //namespace

0 commit comments

Comments
 (0)