@@ -4,27 +4,36 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
44-->
55<script >
66 import IconButton from " ../components/IconButton.svelte" ;
7+ import LabelButton from " ../components/LabelButton.svelte" ;
8+ import { generate } from " ./generate" ;
79 import { cursorTools , zoomTools } from " ./tools/more-tools" ;
810 import { undoRedoTools } from " ./tools/tool-undo-redo" ;
911
1012 export let activeTool = " cursor" ;
1113 export let canvas;
1214 export let instance;
1315 export let iconSize;
16+
17+ const generateCloze = () => {
18+ const cloze = generate ();
19+ console .log (cloze);
20+ };
1421 </script >
1522
1623<div class =" top-tool-bar-container" >
17- {#each undoRedoTools as undoRedoTool }
18- <IconButton
19- class =" top-tool-icon-button"
20- {iconSize }
21- on:click ={() => {
22- undoRedoTool .action (canvas );
23- }}
24- >
25- {@html undoRedoTool .icon }
26- </IconButton >
27- {/each }
24+ <div class =" undo-redo-button" >
25+ {#each undoRedoTools as undoRedoTool }
26+ <IconButton
27+ class =" top-tool-icon-button"
28+ {iconSize }
29+ on:click ={() => {
30+ undoRedoTool .action (canvas );
31+ }}
32+ >
33+ {@html undoRedoTool .icon }
34+ </IconButton >
35+ {/each }
36+ </div >
2837
2938 {#each zoomTools as zoomBottomTool }
3039 <IconButton
@@ -51,18 +60,27 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
5160 </IconButton >
5261 {/each }
5362 {/if }
63+
64+ <LabelButton
65+ class =" generate-button"
66+ on:click ={() => generateCloze ()}
67+ --border-left-radius =" 5px"
68+ --border-right-radius =" 5px" >Generate</LabelButton
69+ >
5470</div >
5571
5672<style >
5773 .top-tool-bar-container {
74+ display : flex ;
5875 position : fixed ;
59- top : 42px ;
60- left : 36px ;
61- width : 100% ;
62- border-right : 1px solid #e3e3e3 ;
76+ top : 46px ;
77+ width : 98% ;
6378 overflow-y : auto ;
6479 z-index : 99 ;
65- background : white ;
80+ }
81+
82+ .undo-redo-button {
83+ margin-left : 36px ;
6684 }
6785
6886 :global(.top-tool-icon-button ) {
@@ -73,4 +91,11 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
7391 margin : unset ;
7492 padding : 6px !important ;
7593 }
94+
95+ :global(.generate-button ) {
96+ position : absolute ;
97+ right : 4px ;
98+ padding : 4px !important ;
99+ top : 3px ;
100+ }
76101 </style >
0 commit comments