Skip to content

Commit aa5ea42

Browse files
committed
Merged two ifs.
1 parent ad47e52 commit aa5ea42

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/Files.App/Views/LayoutModes/StandardLayoutMode.cs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -213,20 +213,19 @@ protected void RenameTextBox_KeyDown(object sender, KeyRoutedEventArgs e)
213213

214214
protected override void Page_CharacterReceived(UIElement sender, CharacterReceivedRoutedEventArgs args)
215215
{
216-
if (ParentShellPageInstance is null)
217-
return;
218-
219-
if (ParentShellPageInstance.CurrentPageType != this.GetType() || IsRenamingItem)
216+
if (ParentShellPageInstance is null ||
217+
ParentShellPageInstance.CurrentPageType != this.GetType() ||
218+
IsRenamingItem)
220219
return;
221220

222221
// Don't block the various uses of enter key (key 13)
223222
var focusedElement = (FrameworkElement)FocusManager.GetFocusedElement(XamlRoot);
224223
var isHeaderFocused = DependencyObjectHelpers.FindParent<DataGridHeader>(focusedElement) is not null;
225-
if (InputKeyboardSource.GetKeyStateForCurrentThread(VirtualKey.Enter) == CoreVirtualKeyStates.Down
226-
|| (focusedElement is Button && !isHeaderFocused) // Allow jumpstring when header is focused
227-
|| focusedElement is TextBox
228-
|| focusedElement is PasswordBox
229-
|| DependencyObjectHelpers.FindParent<ContentDialog>(focusedElement) is not null)
224+
if (InputKeyboardSource.GetKeyStateForCurrentThread(VirtualKey.Enter) == CoreVirtualKeyStates.Down ||
225+
(focusedElement is Button && !isHeaderFocused) || // Allow jumpstring when header is focused
226+
focusedElement is TextBox ||
227+
focusedElement is PasswordBox ||
228+
DependencyObjectHelpers.FindParent<ContentDialog>(focusedElement) is not null)
230229
return;
231230

232231
base.Page_CharacterReceived(sender, args);

0 commit comments

Comments
 (0)