mirror of
https://github.com/WowUp/WowUp.git
synced 2026-05-24 22:46:45 -04:00
Merge pull request #118 from mrchops1024/feat/mac-dblclick-maximize
feat(electron): add dblclick maximize for mac
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<div class="titlebar bg-purple-1 text-light" [ngClass]="{'titlebar-mac': isMac, 'titlebar-windows': isWindows }">
|
||||
<div class="titlebar-drag-region"></div>
|
||||
<div class="titlebar-drag-region" (dblclick)="onDblClick()"></div>
|
||||
<div class="window-logo-container" *ngIf="electronService.isWin">
|
||||
<img src="assets/wowup_logo_512np.png" />
|
||||
</div>
|
||||
|
||||
@@ -52,4 +52,21 @@ export class TitlebarComponent implements OnInit, OnDestroy {
|
||||
onClickDebug() {
|
||||
this.electronService.remote.getCurrentWebContents().openDevTools();
|
||||
}
|
||||
|
||||
onDblClick() {
|
||||
const win = this.electronService.remote.getCurrentWindow();
|
||||
|
||||
if (this.isMac) {
|
||||
const action = this.electronService.remote.systemPreferences.getUserDefault('AppleActionOnDoubleClick', 'string');
|
||||
if (action === 'Maximize') {
|
||||
if (win.isMaximized()) {
|
||||
win.unmaximize();
|
||||
} else {
|
||||
win.maximize();
|
||||
}
|
||||
} else if (action === 'Minimize') {
|
||||
win.minimize();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user