Make F2 do rename

This commit is contained in:
LarsBrubaker 2021-06-04 07:38:19 -07:00
parent e9d9fdf987
commit 4b440577b7

View file

@ -417,6 +417,31 @@ namespace MatterHackers.MatterControl
}
}
keyEvent.Handled = true;
keyEvent.SuppressKeyPress = true;
break;
case Keys.F2:
if (view3D.Printer == null
|| (view3D.Printer != null && view3D.Printer.ViewState.ViewMode == PartViewMode.Model))
{
if (view3D.sceneContext.Scene.SelectedItem is IObject3D object3D)
{
DialogWindow.Show(
new InputBoxPage(
"Rename Item".Localize(),
"Name".Localize(),
object3D.Name,
"Enter New Name Here".Localize(),
"Rename".Localize(),
(newName) =>
{
// TODO: add undo data to this operation
object3D.Name = newName;
}));
}
}
keyEvent.Handled = true;
keyEvent.SuppressKeyPress = true;
break;