From 686a47e426963ba082f11928275f662ca462feac Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Sat, 20 Feb 2021 22:20:35 -0500 Subject: [PATCH] add (hardcoded) 'up' command with XButton1 ('back' mouse button) --- .../Editors/FileSystem/FileSystemEditor.cs | 32 ++++++++++++++----- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/Libraries/UniversalEditor.UserInterface/Editors/FileSystem/FileSystemEditor.cs b/Libraries/UniversalEditor.UserInterface/Editors/FileSystem/FileSystemEditor.cs index 57ae95e7..339b405b 100644 --- a/Libraries/UniversalEditor.UserInterface/Editors/FileSystem/FileSystemEditor.cs +++ b/Libraries/UniversalEditor.UserInterface/Editors/FileSystem/FileSystemEditor.cs @@ -188,6 +188,16 @@ namespace UniversalEditor.Editors.FileSystem txtPath.Text = GetPath(CurrentFolder); } + protected override void OnMouseDown(MouseEventArgs e) + { + base.OnMouseDown(e); + + if (e.Buttons == MouseButtons.XButton1) + { + GoUp(); + } + } + private void tv_DragDropDataRequest(object sender, DragDropDataRequestEventArgs e) { if (tv.SelectedRows.Count == 0) return; @@ -1004,17 +1014,23 @@ namespace UniversalEditor.Editors.FileSystem { if (e.Key == KeyboardKey.Back) { - if (CurrentFolder == null) - { - (Application.Instance as UIApplication).PlaySystemSound(SystemSound.Beep); - return; - } - - Folder parent = (CurrentFolder.Parent as Folder); - CurrentFolder = parent; + // FIXME: this should be a keyboard key binding in UWT Settings + GoUp(); } } + private void GoUp() + { + if (CurrentFolder == null) + { + (Application.Instance as UIApplication).PlaySystemSound(SystemSound.Beep); + return; + } + + Folder parent = (CurrentFolder.Parent as Folder); + CurrentFolder = parent; + } + [EventHandler(nameof(tv), nameof(ListViewControl.BeforeContextMenu))] private void tv_BeforeContextMenu(object sender, EventArgs e) {