Option to auto-hide menu toolbar on the left side

This commit is contained in:
piotrpekala7 2020-05-07 18:09:43 +02:00
parent 81b388a7fe
commit 82891b248f
3 changed files with 10 additions and 3 deletions

View File

@ -11,6 +11,7 @@
<mat-list-item> ctrl + + to zoom in </mat-list-item>
<mat-list-item> ctrl + - to zoom out </mat-list-item>
<mat-list-item> ctrl + 0 to reset zoom </mat-list-item>
<mat-list-item> ctrl + h to hide toolbar </mat-list-item>
<mat-list-item> ctrl + a to select all items on map </mat-list-item>
<mat-list-item> ctrl + shift + a to deselect all items on map </mat-list-item>
<mat-list-item> ctrl + shift + s to go to preferences </mat-list-item>

View File

@ -32,7 +32,7 @@
[readonly]="inReadOnlyMode"
></app-experimental-map>
<div class="project-toolbar">
<div *ngIf="toolbarVisibility" class="project-toolbar">
<mat-toolbar color="primary" class="project-toolbar" [ngClass]="{lightTheme: isLightThemeEnabled}">
<mat-toolbar-row *ngIf="!isLightThemeEnabled">
<button matTooltip="Open menu" mat-icon-button [matMenuTriggerFor]="mainMenu"><mat-icon svgIcon="gns3"></mat-icon></button>
@ -163,11 +163,11 @@
</mat-toolbar>
</div>
<div id="show-menu-wrapper" [ngClass]="{lightTheme: isLightThemeEnabled, shadowed: !isProjectMapMenuVisible }" *ngIf="!readonly">
<div *ngIf="toolbarVisibility" id="show-menu-wrapper" [ngClass]="{lightTheme: isLightThemeEnabled, shadowed: !isProjectMapMenuVisible }">
<button [ngClass]="{lightTheme: isLightThemeEnabled}" class="arrow-button" mat-icon-button (click)="showMenu()"><mat-icon class="unmarked">keyboard_arrow_right</mat-icon></button>
</div>
<div id="menu-wrapper" [ngClass]="{lightTheme: isLightThemeEnabled, extended: isProjectMapMenuVisible }">
<div *ngIf="toolbarVisibility" id="menu-wrapper" [ngClass]="{lightTheme: isLightThemeEnabled, extended: isProjectMapMenuVisible }">
<app-nodes-menu [server]="server" [project]="project"></app-nodes-menu>
<mat-divider class="divider" [vertical]="true"></mat-divider>
<app-project-map-menu [server]="server" [project]="project"></app-project-map-menu>

View File

@ -91,6 +91,7 @@ export class ProjectMapComponent implements OnInit, OnDestroy {
public notificationsVisibility: boolean = false;
public layersVisibility: boolean = false;
public gridVisibility: boolean = false;
public toolbarVisibility: boolean = true;
tools = {
selection: true,
@ -294,6 +295,11 @@ export class ProjectMapComponent implements OnInit, OnDestroy {
this.selectionManager.setSelected(allNodes.concat(allDrawings).concat(allLinks).concat(allSymbols));
});
Mousetrap.bind('ctrl+h', (event: Event) => {
event.preventDefault();
this.toolbarVisibility = !this.toolbarVisibility;
});
Mousetrap.bind('ctrl+shift+a', (event: Event) => {
event.preventDefault();
this.selectionManager.setSelected([]);