|
4 | 4 | using CommunityToolkit.WinUI.Helpers;
|
5 | 5 | using CommunityToolkit.WinUI.UI;
|
6 | 6 | using CommunityToolkit.WinUI.UI.Controls;
|
7 |
| -using Files.App.Data.Items; |
8 |
| -using Files.App.Data.Models; |
9 |
| -using Files.App.UserControls; |
10 | 7 | using Files.App.UserControls.MultitaskingControl;
|
11 |
| -using Files.Core.Extensions; |
12 | 8 | using Microsoft.Extensions.Logging;
|
13 | 9 | using Microsoft.UI.Input;
|
14 | 10 | using Microsoft.UI.Xaml;
|
15 | 11 | using Microsoft.UI.Xaml.Controls;
|
16 | 12 | using Microsoft.UI.Xaml.Input;
|
17 | 13 | using Microsoft.UI.Xaml.Navigation;
|
18 |
| -using Microsoft.Windows.ApplicationModel.Resources; |
19 | 14 | using System.Runtime.CompilerServices;
|
20 | 15 | using Windows.ApplicationModel;
|
21 | 16 | using Windows.Services.Store;
|
@@ -220,14 +215,8 @@ protected override async void OnPreviewKeyDown(KeyRoutedEventArgs e)
|
220 | 215 | HotKey hotKey = new((Keys)e.Key, currentModifiers);
|
221 | 216 |
|
222 | 217 | // A textbox takes precedence over certain hotkeys.
|
223 |
| - bool isTextBox = e.OriginalSource is DependencyObject source && source.FindAscendantOrSelf<TextBox>() is not null; |
224 |
| - if (isTextBox) |
225 |
| - { |
226 |
| - if (hotKey.IsTextBoxHotKey()) |
227 |
| - break; |
228 |
| - if (currentModifiers is KeyModifiers.None && !hotKey.Key.IsGlobalKey()) |
229 |
| - break; |
230 |
| - } |
| 218 | + if (e.OriginalSource is DependencyObject source && source.FindAscendantOrSelf<TextBox>() is not null) |
| 219 | + break; |
231 | 220 |
|
232 | 221 | // Execute command for hotkey
|
233 | 222 | var command = Commands[hotKey];
|
@@ -273,7 +262,7 @@ private async void SidebarControl_SidebarItemDropped(object sender, SidebarItemD
|
273 | 262 | e.SignalEvent?.Set();
|
274 | 263 | }
|
275 | 264 |
|
276 |
| - private async void SidebarControl_SidebarItemPropertiesInvoked(object sender, SidebarItemPropertiesInvokedEventArgs e) |
| 265 | + private void SidebarControl_SidebarItemPropertiesInvoked(object sender, SidebarItemPropertiesInvokedEventArgs e) |
277 | 266 | {
|
278 | 267 | if (e.InvokedItemDataContext is DriveItem)
|
279 | 268 | FilePropertiesHelpers.OpenPropertiesWindow(e.InvokedItemDataContext, SidebarAdaptiveViewModel.PaneHolder.ActivePane);
|
|
0 commit comments