diagram zoom

This commit is contained in:
Jan Prochazka
2022-01-20 15:37:29 +01:00
parent 0f56efea2d
commit f1ba04cf6b
4 changed files with 40 additions and 6 deletions

View File

@@ -717,7 +717,7 @@
function createMenu() { function createMenu() {
return [ return [
menu, menu,
settings?.chooseColumnProperties && [ settings?.customizeStyle && [
{ divider: true }, { divider: true },
{ {
text: 'Column properties', text: 'Column properties',
@@ -755,7 +755,39 @@
text: 'Keys And Not Null', text: 'Keys And Not Null',
onClick: changeStyleFunc('filterColumns', 'keysAndNotNull'), onClick: changeStyleFunc('filterColumns', 'keysAndNotNull'),
}, },
],
},
{
text: `Zoom - ${(value?.style?.zoomKoef || 1) * 100}%`,
submenu: [
{
text: `10 %`,
onClick: changeStyleFunc('zoomKoef', 0.1),
},
{
text: `15 %`,
onClick: changeStyleFunc('zoomKoef', 0.15),
},
{
text: `20 %`,
onClick: changeStyleFunc('zoomKoef', 0.2),
},
{
text: `40 %`,
onClick: changeStyleFunc('zoomKoef', 0.4),
},
{
text: `60 %`,
onClick: changeStyleFunc('zoomKoef', 0.6),
},
{
text: `80 %`,
onClick: changeStyleFunc('zoomKoef', 0.8),
},
{
text: `100 %`,
onClick: changeStyleFunc('zoomKoef', 1),
},
], ],
}, },
], ],
@@ -773,7 +805,9 @@
bind:this={domCanvas} bind:this={domCanvas}
on:dragover={e => e.preventDefault()} on:dragover={e => e.preventDefault()}
on:drop={handleDrop} on:drop={handleDrop}
style={`width:${canvasWidth}px;height:${canvasHeight}px;`} style={`width:${canvasWidth}px;height:${canvasHeight}px;
${settings?.customizeStyle && value?.style?.zoomKoef ? `zoom:${value?.style?.zoomKoef};` : ''}
`}
on:mousedown={e => { on:mousedown={e => {
if (e.button == 0 && settings?.canSelectTables) { if (e.button == 0 && settings?.canSelectTables) {
callChange( callChange(

View File

@@ -85,7 +85,7 @@
} }
function shouldShowColumn(table, column, style) { function shouldShowColumn(table, column, style) {
if (!settings?.chooseColumnProperties) { if (!settings?.customizeStyle) {
return true; return true;
} }
switch (style?.filterColumns || 'all') { switch (style?.filterColumns || 'all') {

View File

@@ -20,7 +20,7 @@
canSelectTables: true, canSelectTables: true,
allowChangeColor: true, allowChangeColor: true,
appendTableSystemMenu: true, appendTableSystemMenu: true,
chooseColumnProperties: true, customizeStyle: true,
}} }}
referenceComponent={DiagramDesignerReference} referenceComponent={DiagramDesignerReference}
/> />

View File

@@ -20,7 +20,7 @@
canSelectTables: false, canSelectTables: false,
allowChangeColor: false, allowChangeColor: false,
appendTableSystemMenu: false, appendTableSystemMenu: false,
chooseColumnProperties: false, customizeStyle: false,
}} }}
referenceComponent={QueryDesignerReference} referenceComponent={QueryDesignerReference}
/> />