mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-02 18:26:27 +13:00
Added move shape top (home), bottom (end), up (page up), down (page down) hotkeys
This commit is contained in:
parent
aceb7c9fd3
commit
c4d7098751
1 changed files with 92 additions and 0 deletions
|
@ -427,6 +427,18 @@ private void form_KeyDown(object sender, KeyEventArgs e)
|
|||
case Keys.Control | Keys.V:
|
||||
PasteFromClipboard();
|
||||
break;
|
||||
case Keys.Home:
|
||||
MoveCurrentShapeTop();
|
||||
break;
|
||||
case Keys.End:
|
||||
MoveCurrentShapeBottom();
|
||||
break;
|
||||
case Keys.PageUp:
|
||||
MoveCurrentShapeUp();
|
||||
break;
|
||||
case Keys.PageDown:
|
||||
MoveCurrentShapeDown();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1006,6 +1018,86 @@ public void UndoShape()
|
|||
}
|
||||
}
|
||||
|
||||
public void MoveShapeBottom(BaseShape shape)
|
||||
{
|
||||
if (shape != null)
|
||||
{
|
||||
for (int i = 0; i < Shapes.Count; i++)
|
||||
{
|
||||
if (Shapes[i] == shape)
|
||||
{
|
||||
Shapes.Move(i, 0);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void MoveCurrentShapeBottom()
|
||||
{
|
||||
MoveShapeBottom(CurrentShape);
|
||||
}
|
||||
|
||||
public void MoveShapeTop(BaseShape shape)
|
||||
{
|
||||
if (shape != null)
|
||||
{
|
||||
for (int i = 0; i < Shapes.Count; i++)
|
||||
{
|
||||
if (Shapes[i] == shape)
|
||||
{
|
||||
Shapes.Move(i, Shapes.Count - 1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void MoveCurrentShapeTop()
|
||||
{
|
||||
MoveShapeTop(CurrentShape);
|
||||
}
|
||||
|
||||
public void MoveShapeDown(BaseShape shape)
|
||||
{
|
||||
if (shape != null)
|
||||
{
|
||||
for (int i = 1; i < Shapes.Count; i++)
|
||||
{
|
||||
if (Shapes[i] == shape)
|
||||
{
|
||||
Shapes.Move(i, --i);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void MoveCurrentShapeDown()
|
||||
{
|
||||
MoveShapeDown(CurrentShape);
|
||||
}
|
||||
|
||||
public void MoveShapeUp(BaseShape shape)
|
||||
{
|
||||
if (shape != null)
|
||||
{
|
||||
for (int i = 0; i < Shapes.Count - 1; i++)
|
||||
{
|
||||
if (Shapes[i] == shape)
|
||||
{
|
||||
Shapes.Move(i, ++i);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void MoveCurrentShapeUp()
|
||||
{
|
||||
MoveShapeUp(CurrentShape);
|
||||
}
|
||||
|
||||
private bool IsShapeTypeRegion(ShapeType shapeType)
|
||||
{
|
||||
switch (shapeType)
|
||||
|
|
Loading…
Reference in a new issue