Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable modifier keys for docs and rename actions #1061

Merged
merged 2 commits into from
Sep 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions Bonsai.Editor/EditorForm.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
Expand Down Expand Up @@ -2016,6 +2016,11 @@ private void replaceToolStripMenuItem_Click(object sender, EventArgs e)

private void renameSubjectToolStripMenuItem_Click(object sender, EventArgs e)
{
if (ModifierKeys != Keys.None)
{
return;
}

if (!toolboxTreeView.Focused)
{
var model = selectionModel.SelectedView;
Expand Down Expand Up @@ -2276,13 +2281,21 @@ private async Task OpenDocumentationAsync(string assemblyName, string uid)

private async void docsToolStripMenuItem_Click(object sender, EventArgs e)
{
if (ModifierKeys != Keys.None)
{
return;
}

if (toolboxTreeView.Focused || searchTextBox.Focused)
{
var typeNode = toolboxTreeView.SelectedNode;
if (typeNode != null && typeNode.Tag != null)
{
var type = Type.GetType(typeNode.Name);
await OpenDocumentationAsync(type);
if (type != null)
{
await OpenDocumentationAsync(type);
}
return;
}
}
Expand Down