Better window size controls

This commit is contained in:
Geomitron
2020-03-05 17:45:44 -05:00
parent 80c467ed7e
commit 5ac5214a73
6 changed files with 73 additions and 88 deletions

View File

@@ -32,7 +32,7 @@
<div *ngIf="settingsService.rateLimitDelay < 30" class="ui warning message">
<i class="exclamation circle icon"></i>
<b>Warning:</b> downloading files from Google with a delay less than about 30 seconds will eventually cause Google to
refuse download requests from this program for a few hours. If you can find a way around this limitation, contact the devs.
refuse download requests from this program for a few hours. If you can find a way around this limitation, contact Geo#8488 on discord.
</div>
<h3 class="ui header">Theme</h3>

View File

@@ -6,7 +6,7 @@
<div class="right menu">
<a class="item traffic-light" (click)="minimize()"><i class="minus icon"></i></a>
<a class="item traffic-light" (click)="maximize()"><i class="plus icon"></i></a>
<a class="item traffic-light" (click)="maximize()"><i class="icon window" [ngClass]="isMaximized ? 'restore' : 'maximize'"></i></a>
<a class="item traffic-light" (click)="close()"><i class="x icon"></i></a>
</div>
</div>

View File

@@ -1,4 +1,4 @@
import { Component } from '@angular/core'
import { Component, OnInit } from '@angular/core'
import { ElectronService } from '../../core/services/electron.service'
@Component({
@@ -6,16 +6,27 @@ import { ElectronService } from '../../core/services/electron.service'
templateUrl: './toolbar.component.html',
styleUrls: ['./toolbar.component.scss']
})
export class ToolbarComponent {
export class ToolbarComponent implements OnInit {
isMaximized: boolean
constructor(private electronService: ElectronService) { }
ngOnInit() {
this.isMaximized = this.electronService.currentWindow.isMaximized()
}
minimize() {
this.electronService.currentWindow.minimize()
}
maximize() {
this.electronService.currentWindow.maximize()
if (this.isMaximized) {
this.electronService.currentWindow.restore()
} else {
this.electronService.currentWindow.maximize()
}
this.isMaximized = !this.isMaximized
}
close() {