Pārlūkot izejas kodu

shortcuts: colorpicker "C", curve move point "Z", curve insert point "I"

Johann 6 gadi atpakaļ
vecāks
revīzija
3e7e406078
3 mainītis faili ar 21 papildinājumiem un 3 dzēšanām
  1. 1 0
      lazpaint/lazpaintmainform.pas
  2. 19 2
      lazpaint/tools/utoolpolygon.pas
  3. 1 1
      lazpaint/umenu.pas

+ 1 - 0
lazpaint/lazpaintmainform.pas

@@ -2055,6 +2055,7 @@ begin
     if toolProcessKey and ToolManager.ToolKeyPress(UTF8Key) then
     begin
       DelayedPaintPicture := true;
+      UpdateToolbar;
     end else
     if UTF8Key <> '' then
     begin

+ 19 - 2
lazpaint/tools/utoolpolygon.pas

@@ -152,9 +152,26 @@ begin
 end;
 
 function TToolSpline.ToolKeyPress(var key: TUTF8Char): TRect;
+var keyCode: Word;
 begin
-  Result:=inherited ToolKeyPress(key);
-  if Key='x' then Key := #0;
+  if (Key='z') or (Key = 'Z') then
+  begin
+    CurrentMode:= tsmMovePoint;
+    result := OnlyRenderChange;
+    Key := #0;
+  end else
+  if (Key='i') or (Key='I') then
+  begin
+    keyCode := VK_INSERT;
+    ToolKeyDown(keyCode);
+    keyCode := VK_INSERT;
+    ToolKeyUp(keyCode);
+    result := EmptyRect;
+  end else
+  begin
+    Result:=inherited ToolKeyPress(key);
+    if Key='x' then Key := #0;
+  end;
 end;
 
 function TToolSpline.GetContextualToolbars: TContextualToolbars;

+ 1 - 1
lazpaint/umenu.pas

@@ -512,7 +512,7 @@ begin
   ActionShortcut('ToolHotSpot','H');
   ActionShortcut('ToolPen','P');
   ActionShortcut('ToolBrush','B');
-  ActionShortcut('ToolColorPicker','I');
+  ActionShortcut('ToolColorPicker','C');
   ActionShortcut('ToolEraser','E');
   ActionShortcut('ToolEditShape','J');
   ActionShortcut('ToolRect','U');