Skip to content

Commit

Permalink
Disabled and hid zoom functions, snap-to-grid, and hide data nodes, s…
Browse files Browse the repository at this point in the history
…ince none of those features work in the current build
  • Loading branch information
james-strauss-uwa committed Jan 11, 2024
1 parent eb104a5 commit 60e7ecf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/KeyboardShortcut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,11 @@ export class KeyboardShortcut {
new KeyboardShortcut("modify_selected_edge","Modify Selected Edge", ["m"], "keydown", KeyboardShortcut.Modifier.None, KeyboardShortcut.true, ['edit'], KeyboardShortcut.allowGraphEditing, function(){return KeyboardShortcut.edgeIsSelected && Setting.findValue(Setting.ALLOW_GRAPH_EDITING)}, (eagle): void => {eagle.editSelectedEdge();}),
new KeyboardShortcut("center_graph", "Center graph", ["c"], "keydown", KeyboardShortcut.Modifier.None, KeyboardShortcut.true, ['canvas','reset','controls'], KeyboardShortcut.true, KeyboardShortcut.true, (eagle): void => {eagle.centerGraph();}),
// NB: we need two entries for zoom_in here, the first handles '+' without shift (as found on the numpad), the second handles '+' with shift (as found sharing the '=' key)
/*
new KeyboardShortcut("zoom_in", "Zoom In", ["+"], "keydown", KeyboardShortcut.Modifier.None, KeyboardShortcut.true, ['controls','canvas'], KeyboardShortcut.true, KeyboardShortcut.true, (eagle): void => {eagle.zoomIn();}),
new KeyboardShortcut("zoom_in", "Zoom In", ["+"], "keydown", KeyboardShortcut.Modifier.Shift, KeyboardShortcut.false, ['controls','canvas'], KeyboardShortcut.false, KeyboardShortcut.true, (eagle): void => {eagle.zoomIn();}),
new KeyboardShortcut("zoom_out", "Zoom Out", ["-"], "keydown", KeyboardShortcut.Modifier.None, KeyboardShortcut.true, ['controls','canvas'], KeyboardShortcut.true, KeyboardShortcut.true, (eagle): void => {eagle.zoomOut();}),
*/
new KeyboardShortcut("toggle_left_window", "Toggle left window", ["l"], "keydown", KeyboardShortcut.Modifier.None, KeyboardShortcut.true, ['close','open'], KeyboardShortcut.allowPaletteEditing, function(){return Setting.findValue(Setting.ALLOW_PALETTE_EDITING) || Setting.findValue(Setting.ALLOW_GRAPH_EDITING)}, (eagle): void => {eagle.leftWindow().toggleShown();}),
new KeyboardShortcut("toggle_right_window", "Toggle right window", ["r"], "keydown", KeyboardShortcut.Modifier.None, KeyboardShortcut.true, ['close','open'], KeyboardShortcut.true, KeyboardShortcut.true, (eagle): void => {eagle.rightWindow().toggleShown();}),
new KeyboardShortcut("toggle_both_window", "Toggle both windows", ["b"], "keydown", KeyboardShortcut.Modifier.None, KeyboardShortcut.true, ['close','open'], function(){return Setting.findValue(Setting.ALLOW_PALETTE_EDITING) || Setting.findValue(Setting.ALLOW_GRAPH_EDITING)}, function(){return Setting.findValue(Setting.ALLOW_PALETTE_EDITING) || Setting.findValue(Setting.ALLOW_GRAPH_EDITING)}, (eagle): void => {eagle.toggleWindows();}),
Expand All @@ -214,8 +216,10 @@ export class KeyboardShortcut {
new KeyboardShortcut("open_translation", "Open Translation", ["4"], "keydown", KeyboardShortcut.Modifier.None, KeyboardShortcut.true, ['tab','tabs','window','menu','right'], function(){return Setting.findValue(Setting.USER_TRANSLATOR_MODE) != Setting.TranslatorMode.Minimal}, function(){return Setting.findValue(Setting.USER_TRANSLATOR_MODE) != Setting.TranslatorMode.Minimal}, (eagle): void => { eagle.rightWindow().shown(true).mode(Eagle.RightWindowMode.TranslationMenu)}),
new KeyboardShortcut("open_inspector", "Open Inspector", ["3"], "keydown", KeyboardShortcut.Modifier.None, KeyboardShortcut.true, ['tab','tabs','window','menu','right'], KeyboardShortcut.true, KeyboardShortcut.somethingIsSelected, (eagle): void => { eagle.rightWindow().shown(true).mode(Eagle.RightWindowMode.Inspector)}),
new KeyboardShortcut("open_hierarchy", "Open Hierarchy", ["2"], "keydown", KeyboardShortcut.Modifier.None, KeyboardShortcut.true, ['tab','tabs','window','menu','right'], KeyboardShortcut.true, KeyboardShortcut.true, (eagle): void => { eagle.rightWindow().shown(true).mode(Eagle.RightWindowMode.Hierarchy)}),
/*
new KeyboardShortcut("toggle_show_data_nodes", "Toggle Show Data Nodes", ["j"], "keydown", KeyboardShortcut.Modifier.None, KeyboardShortcut.true, ['hide','node','canvas'], KeyboardShortcut.true, KeyboardShortcut.true, (eagle): void => { eagle.toggleShowDataNodes(); }),
new KeyboardShortcut("toggle_snap_to_grid", "Toggle Snap to Grid", ["y"], "keydown", KeyboardShortcut.Modifier.None, KeyboardShortcut.true, ['canvas'], KeyboardShortcut.allowGraphEditing, KeyboardShortcut.allowGraphEditing, (eagle): void => { eagle.toggleSnapToGrid(); }),
*/
new KeyboardShortcut("check_for_component_updates", "Check for Component Updates", ["q"], "keydown", KeyboardShortcut.Modifier.None, KeyboardShortcut.true, ['nodes'], KeyboardShortcut.allowGraphEditing, function(){return KeyboardShortcut.graphNotEmpty && Setting.findValue(Setting.ALLOW_GRAPH_EDITING)}, (eagle): void => { eagle.checkForComponentUpdates(); }),
new KeyboardShortcut("copy_from_graph_without_children", "Copy from graph without children", ["c"], "keydown", KeyboardShortcut.Modifier.Shift, KeyboardShortcut.true, [''], KeyboardShortcut.allowGraphEditing, KeyboardShortcut.allowGraphEditing, (eagle): void => { eagle.copySelectionToClipboard(false); }),
new KeyboardShortcut("copy_from_graph", "Copy from graph", ["c"], "keydown", KeyboardShortcut.Modifier.Ctrl, KeyboardShortcut.true, [''], KeyboardShortcut.allowGraphEditing, KeyboardShortcut.allowGraphEditing, (eagle): void => { eagle.copySelectionToClipboard(true); }),
Expand Down
6 changes: 6 additions & 0 deletions templates/navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,20 @@
<button id="centerGraph" class="btn btn-outline-secondary navbar-btn" type="button" data-bs-placement="bottom" data-bind="click: centerGraph, , eagleTooltip: 'Center Graph ' + Utils.getKeyboardShortcutTextByKey('center_graph', true)" >
<i class="material-icons md-18">filter_center_focus</i>
</button>
<!--
<button id="zoomOut" class="btn btn-outline-secondary navbar-btn" type="button" data-bs-placement="bottom" data-bind="click: zoomOut, eagleTooltip: 'Zoom Out ' + Utils.getKeyboardShortcutTextByKey('zoom_out', true)" >
<i class="material-icons md-18">zoom_out</i>
</button>
<button id="zoomIn" class="btn btn-outline-secondary navbar-btn" type="button" data-bs-placement="bottom" data-bind="click: zoomIn, eagleTooltip: 'Zoom In ' + Utils.getKeyboardShortcutTextByKey('zoom_in', true)" >
<i class="material-icons md-18">zoom_in</i>
</button>
-->
<span class="navBarToolBarTitle">View</span>
<!--
<button id="toggleDataNodes" class="btn btn-outline-secondary navbar-btn" type="button" data-bs-placement="bottom" data-bind="click: toggleShowDataNodes, eagleTooltip: 'Toggle Display of Data Nodes ' + Utils.getKeyboardShortcutTextByKey('toggle_show_data_nodes', true), css: { 'navbar-btn-active': showDataNodes() === false }">
<i class="md-18 icon-hideDataNode"></i>
</button>
-->
<button id="toggleCollapseAllGroups" class="btn btn-outline-secondary navbar-btn" type="button" data-bs-placement="bottom" data-bind="click: toggleCollapseAllGroups, eagleTooltip: 'Collapse/Expand All Groups'" >
<i class="material-icons md-18">tab_unselected</i>
</button>
Expand All @@ -59,9 +63,11 @@
<div class="btn-group ms-4 navbarGroup" role="group" aria-label="Basic example">
<span class="navBarToolBarTitle">Editing</span>
<!-- ko if: Setting.findValue(Setting.ALLOW_GRAPH_EDITING) -->
<!--
<button id="toggleSnapToGrid" class="btn btn-outline-secondary navbar-btn" type="button" data-bs-placement="bottom" data-bind="click: toggleSnapToGrid, eagleTooltip: 'Toggle Snap-to-Grid ' + Utils.getKeyboardShortcutTextByKey('toggle_snap_to_grid', true), css: { 'navbar-btn-active': snapToGrid() }" >
<i class="md-18 icon-snapToGrid"></i>
</button>
-->
<!-- /ko -->
<!-- ko if: Setting.findValue(Setting.ALLOW_PALETTE_EDITING) -->
<button id="addGraphNodesToPalette" class="btn btn-outline-secondary navbar-btn" type="button" data-bs-placement="bottom" data-bind="click: addGraphNodesToPalette, eagleTooltip: 'Add Graph Nodes to Palette ' + Utils.getKeyboardShortcutTextByKey('add_graph_nodes_to_palette', true)" >
Expand Down

0 comments on commit 60e7ecf

Please sign in to comment.