Skip to content

Commit cdbc430

Browse files
committed
feat: 增加紧密堆积
1 parent ef4e337 commit cdbc430

File tree

1 file changed

+54
-27
lines changed

1 file changed

+54
-27
lines changed

app/src/components/context-menu-content.tsx

Lines changed: 54 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,26 @@ export default function MyContextMenuContent() {
173173
<AlignEndHorizontal />
174174
</Button>
175175
</KeyTooltip>
176+
<KeyTooltip keyId="layoutToSquare">
177+
<Button
178+
variant="ghost"
179+
size="icon"
180+
className="size-6"
181+
onClick={() => p.layoutManager.layoutToTightSquare(p.stageManager.getSelectedEntities())}
182+
>
183+
<Grip />
184+
</Button>
185+
</KeyTooltip>
186+
<KeyTooltip keyId="layoutToSquare">
187+
<Button
188+
variant="ghost"
189+
size="icon"
190+
className="size-6"
191+
onClick={() => p.layoutManager.layoutBySelected(p.layoutManager.layoutToTightSquare, true)}
192+
>
193+
<Grip />
194+
</Button>
195+
</KeyTooltip>
176196
</div>
177197
)}
178198
{p.stageManager.getSelectedEntities().length >= 2 && (
@@ -677,33 +697,40 @@ export default function MyContextMenuContent() {
677697

678698
{/* 鼠标模式 */}
679699
<Item className="bg-transparent! gap-0 p-0">
680-
<Button
681-
variant="ghost"
682-
size="icon"
683-
onClick={() => {
684-
Settings.mouseLeftMode = "selectAndMove";
685-
}}
686-
>
687-
<MousePointer />
688-
</Button>
689-
<Button
690-
variant="ghost"
691-
size="icon"
692-
onClick={() => {
693-
Settings.mouseLeftMode = "draw";
694-
}}
695-
>
696-
<Pencil />
697-
</Button>
698-
<Button
699-
variant="ghost"
700-
size="icon"
701-
onClick={() => {
702-
Settings.mouseLeftMode = "connectAndCut";
703-
}}
704-
>
705-
<Waypoints />
706-
</Button>
700+
<KeyTooltip keyId="checkoutLeftMouseToSelectAndMove">
701+
<Button
702+
variant="ghost"
703+
size="icon"
704+
onClick={() => {
705+
Settings.mouseLeftMode = "selectAndMove";
706+
}}
707+
>
708+
<MousePointer />
709+
</Button>
710+
</KeyTooltip>
711+
712+
<KeyTooltip keyId="checkoutLeftMouseToDrawing">
713+
<Button
714+
variant="ghost"
715+
size="icon"
716+
onClick={() => {
717+
Settings.mouseLeftMode = "draw";
718+
}}
719+
>
720+
<Pencil />
721+
</Button>
722+
</KeyTooltip>
723+
<KeyTooltip keyId="checkoutLeftMouseToConnectAndCutting">
724+
<Button
725+
variant="ghost"
726+
size="icon"
727+
onClick={() => {
728+
Settings.mouseLeftMode = "connectAndCut";
729+
}}
730+
>
731+
<Waypoints />
732+
</Button>
733+
</KeyTooltip>
707734
</Item>
708735
</Content>
709736
);

0 commit comments

Comments
 (0)