Skip to content

Commit

Permalink
close popovers with backdrop (#2110)
Browse files Browse the repository at this point in the history
  • Loading branch information
UnchartedBull committed Jul 29, 2021
1 parent 48cfecb commit 6b54702
Show file tree
Hide file tree
Showing 12 changed files with 36 additions and 80 deletions.
7 changes: 6 additions & 1 deletion angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,15 @@
]
},
"development": {
"buildOptimizer": false,
"optimization": false,
"vendorChunk": true,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
}
}
},
"defaultConfiguration": "development"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
Expand Down
25 changes: 1 addition & 24 deletions src/app/control/control.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,10 @@
<td class="top-bar__center">
<img src="assets/control.svg" class="top-bar__center-icon" />
</td>
<td class="top-bar__next" (click)="showHelp = true">
<span matRipple [matRippleUnbounded]="false" [matRippleCentered]="true">
<img src="assets/help.svg" class="top-bar__next-icon" />
</span>
</td>
<td class="top-bar__next"></td>
</tr>
</table>

<div class="help" *ngIf="showHelp">
<div class="help__card">
<img src="assets/error.svg" class="help__close" (click)="showHelp = false" />
<span class="help__heading">Control Screen</span>
<span class="help__text">
<ng-container i18n="@@help-adjust-speed">
You can adjust the printhead speed in the settings (default 150mm/s for XY - 5mm/s for Z).
</ng-container>
<br />
<span i18n="@@help-custom-actions-message">
You can customize the 6 icons on the right. They can either send GCode Commands to the printer or call a few
predefined actions (like rebooting the Pi). Please visit the GitHub Wiki to get further information.
</span>
<br />
<ng-container i18n="@@help-custom-actions"> Wiki page is called "CustomActions". </ng-container>
</span>
</div>
</div>

<div class="control">
<div class="control__XY">
<div class="control__XY-wrapper">
Expand Down
1 change: 0 additions & 1 deletion src/app/control/control.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export class ControlComponent {
public printerProfile: OctoprintPrinterProfile;

public jogDistance = 10;
public showHelp = false;

public constructor(private printerService: PrinterService, private notificationService: NotificationService) {
this.printerService.getActiveProfile().subscribe(
Expand Down
8 changes: 4 additions & 4 deletions src/app/files/files.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@
<div class="scroll__thumb-inactive" *ngIf="directory"></div>
</div>

<div class="file" id="fileDetailView">
<div class="file__wrapper" *ngIf="fileDetail && fileDetail.name !== 'error'">
<div class="file" id="fileDetailView" (click)="closeDetails()">
<div class="file__wrapper" *ngIf="fileDetail && fileDetail.name !== 'error'" (click)="stopPropagation($event)">
<img src="assets/error.svg" class="file__close" (click)="closeDetails()" />
<span class="file__name">{{ fileDetail.name }}</span>
<span class="file__directory">{{ fileDetail.path }}</span>
Expand Down Expand Up @@ -137,8 +137,8 @@
</div>
</div>

<div class="sorting" id="sortingView" *ngIf="showSorting">
<div class="sorting-wrapper">
<div class="sorting" id="sortingView" *ngIf="showSorting" (click)="closeSorting()">
<div class="sorting-wrapper" (click)="stopPropagation($event)">
<img src="assets/error.svg" class="sorting-close" (click)="closeSorting()" />
<span class="sorting-heading" i18n="@@files-sort">sort files</span>
<table class="sorting-selection">
Expand Down
1 change: 0 additions & 1 deletion src/app/files/files.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@
width: 100vw;
height: 100vh;
background-color: rgba(0, 0, 0, 0.85);
// backdrop-filter: blur(8px);
transition: opacity 0.4s ease-in-out;
z-index: 5;

Expand Down
4 changes: 4 additions & 0 deletions src/app/files/files.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ export class FilesComponent {
}, 500);
}

public stopPropagation(event: Event): void {
event.stopPropagation();
}

public openSorting(): void {
this.showSorting = true;
setTimeout((): void => {
Expand Down
16 changes: 11 additions & 5 deletions src/app/printer-status/printer-status.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
/{{ printerStatus.tool0.set }}<span class="unit">°C</span>
</span>
</td>

<td
class="printer-status__value printer-status__value-2"
[ngClass]="{ 'printer-status__no-set-value': printerStatus.bed.set === 0 }"
Expand All @@ -30,6 +31,7 @@
/{{ printerStatus.bed.set }}<span class="unit">°C</span>
</span>
</td>

<td
class="printer-status__value printer-status__value-3 printer-status__no-set-value"
(click)="showQuickControlFan()"
Expand All @@ -43,12 +45,12 @@
</td>
</tr>
</table>
<div class="quick-control" *ngIf="view !== QuickControlView.NONE" id="quickControl">
<table class="top-bar" (click)="hideQuickControl()">

<div class="quick-control" *ngIf="view !== QuickControlView.NONE" id="quickControl" (click)="hideQuickControl()">
<table class="top-bar">
<tr>
<td class="top-bar__back">
<img src="assets/back.svg" class="top-bar__back-icon" matRipple [matRippleUnbounded]="false" />
<ng-container i18n="@@quick-back">back</ng-container>
</td>
<td class="top-bar__center">
<img
Expand All @@ -63,10 +65,11 @@
class="top-bar__center-icon"
/>
</td>
<td class="top-bar__back"></td>
<td class="top-bar__next"></td>
</tr>
</table>
<div class="quick-control__controller">

<div class="quick-control__controller" (click)="stopPropagation($event)">
<div class="quick-control__controller-row">
<div
class="quick-control__controller-increase"
Expand All @@ -85,6 +88,7 @@
+10
</div>
</div>

<div
class="quick-control__controller-value"
colspan="2"
Expand Down Expand Up @@ -116,6 +120,7 @@
{{ this.fanTarget }}
<span class="quick-control__controller-value-unit">%</span>
</div>

<div class="quick-control__controller-row">
<div
class="quick-control__controller-decrease"
Expand All @@ -134,6 +139,7 @@
-10
</div>
</div>

<div class="quick-control__controller-row">
<div
class="quick-control__controller-set"
Expand Down
1 change: 0 additions & 1 deletion src/app/printer-status/printer-status.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.85);
// backdrop-filter: blur(8px);
transition: opacity 0.4s ease-in-out;
z-index: 10;
opacity: 0;
Expand Down
4 changes: 4 additions & 0 deletions src/app/printer-status/printer-status.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ export class PrinterStatusComponent implements OnInit, OnDestroy {
}, 500);
}

public stopPropagation(event: Event): void {
event.stopPropagation();
}

public quickControlChangeValue(value: number): void {
switch (this.view) {
case QuickControlView.HOTEND:
Expand Down
4 changes: 2 additions & 2 deletions src/app/settings/settings.component.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="settings">
<div class="settings-wrapper" [ngClass]="{ 'settings-wrapper-fadeout': fadeOutAnimation }">
<div class="settings-container">
<div class="settings-wrapper" [ngClass]="{ 'settings-wrapper-fadeout': fadeOutAnimation }" (click)="hideSettings()">
<div class="settings-container" (click)="stopPropagation($event)">
<img src="assets/error.svg" class="settings__close" (click)="hideSettings()" />
<div class="settings__content" #settingsMain>
<span class="settings__heading" i18n="@@settings">settings</span>
Expand Down
4 changes: 4 additions & 0 deletions src/app/settings/settings.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ export class SettingsComponent implements OnInit, OnDestroy {
}
}

public stopPropagation(event: Event): void {
event.stopPropagation();
}

public changePage(page: number, current: number, direction: 'forward' | 'backward'): void {
this.pages[current].classList.add('settings__content-slideout-' + direction);
this.pages[page].classList.remove('settings__content-inactive');
Expand Down
41 changes: 0 additions & 41 deletions src/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -117,47 +117,6 @@ app-root {
}
}

.help {
position: fixed;
left: 0;
top: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.85);
// backdrop-filter: blur(8px);
z-index: 1000;

&__card {
display: block;
position: fixed;
left: 7vw;
right: 7vw;
bottom: 7vh;
top: 7vh;
background-color: #353b48;
padding: 3.5vh 2vw;
}

&__close {
display: block;
width: 6vw;
position: absolute;
right: 2vw;
top: 3vh;
}

&__heading {
display: block;
padding-bottom: 2vh;
font-weight: 500;
}

&__text {
text-align: justify;
font-size: 3vw;
}
}

.splash-screen {
&__icon {
height: 50vh;
Expand Down

0 comments on commit 6b54702

Please sign in to comment.