add (hardcoded) 'up' command with XButton1 ('back' mouse button)

This commit is contained in:
Michael Becker 2021-02-20 22:20:35 -05:00
parent be0c98c8ac
commit 686a47e426
No known key found for this signature in database
GPG Key ID: 98C333A81F18C22C

View File

@ -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)
{