-
Notifications
You must be signed in to change notification settings - Fork 327
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add undo/redo buttons to the top bar (#11433)
Closes #11222 https://github.com/user-attachments/assets/66f8dfd1-a7c4-497a-8ff6-a22f56dbb1dd
- Loading branch information
Showing
7 changed files
with
123 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<template> | ||
<div class="ControlButtons"> | ||
<div class="control left-end"> | ||
<slot name="left"></slot> | ||
</div> | ||
<div class="control right-end"> | ||
<slot name="right"></slot> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<style scoped> | ||
.ControlButtons { | ||
user-select: none; | ||
display: flex; | ||
place-items: center; | ||
gap: 1px; | ||
} | ||
.control { | ||
background: var(--color-frame-bg); | ||
backdrop-filter: var(--blur-app-bg); | ||
padding: 4px 4px; | ||
width: 32px; | ||
} | ||
.left-end { | ||
border-radius: var(--radius-full) 0 0 var(--radius-full); | ||
> * { | ||
margin: 0 0 0 auto; | ||
} | ||
} | ||
.right-end { | ||
border-radius: 0 var(--radius-full) var(--radius-full) 0; | ||
> * { | ||
margin: 0 auto 0 0; | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<script setup lang="ts"> | ||
import SvgButton from '@/components/SvgButton.vue' | ||
import { useGraphStore } from '@/stores/graph' | ||
import ControlButtons from './ControlButtons.vue' | ||
const graphStore = useGraphStore() | ||
</script> | ||
|
||
<template> | ||
<ControlButtons class="UndoRedoButtons"> | ||
<template #left> | ||
<SvgButton | ||
title="Undo" | ||
class="iconButton" | ||
name="undo" | ||
draggable="false" | ||
:disabled="!graphStore.undoManager.canUndo.value" | ||
@click.stop="graphStore.undoManager.undo" | ||
/> | ||
</template> | ||
<template #right> | ||
<SvgButton | ||
title="Redo" | ||
class="iconButton" | ||
name="redo" | ||
draggable="false" | ||
:disabled="!graphStore.undoManager.canRedo.value" | ||
@click.stop="graphStore.undoManager.redo" | ||
/> | ||
</template> | ||
</ControlButtons> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters