diff --git a/native/app/Source/AppDelegate.swift b/native/app/Source/AppDelegate.swift index 69393a01..dc194d51 100644 --- a/native/app/Source/AppDelegate.swift +++ b/native/app/Source/AppDelegate.swift @@ -57,7 +57,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, SUUpdaterDelegate { } func applicationWillTerminate(_ aNotification: Notification) { - Application.quit() + Application.handleTermination() } func applicationShouldHandleReopen(_ sender: NSApplication, hasVisibleWindows flag: Bool) -> Bool { diff --git a/native/app/Source/Application.swift b/native/app/Source/Application.swift index a9565735..ecddd921 100644 --- a/native/app/Source/Application.swift +++ b/native/app/Source/Application.swift @@ -486,9 +486,13 @@ class Application { if (globalGain < 0) { if (device.canSetVirtualMasterVolume(direction: .playback)) { - var decibels = device.virtualMasterVolumeInDecibels(direction: .playback)! + var decibels = + device.volumeInDecibels(channel: 0, direction: .playback) + ?? device.volumeInDecibels(channel: 1, direction: .playback) + ?? 0.5 decibels = decibels + Float(globalGain) - device.setVirtualMasterVolume(device.decibelsToScalar(volume: decibels, channel: 1, direction: .playback)!, direction: .playback) + let newVolume = device.decibelsToScalar(volume: decibels, channel: 0, direction: .playback) ?? device.decibelsToScalar(volume: decibels, channel: 1, direction: .playback) ?? 0.1 + device.setVirtualMasterVolume(newVolume, direction: .playback) } else if (device.canSetVolume(channel: 1, direction: .playback)) { var decibels = device.volumeInDecibels(channel: 1, direction: .playback)! decibels = decibels + Float(globalGain) @@ -576,13 +580,16 @@ class Application { } } - static func quit (_ completion: (() -> Void)? = nil) { + static func quit () { + NSApp.terminate(nil) + } + + static func handleTermination (_ completion: (() -> Void)? = nil) { stopSave { Driver.hidden = true if completion != nil { completion!() } - NSApp.terminate(nil) } } diff --git a/native/app/Source/ApplicationDataBus.swift b/native/app/Source/ApplicationDataBus.swift index 00a88a46..999eb4e9 100644 --- a/native/app/Source/ApplicationDataBus.swift +++ b/native/app/Source/ApplicationDataBus.swift @@ -19,9 +19,7 @@ class ApplicationDataBus: DataBus { super.init(route: route, bridge: bridge) self.on(.GET, "/quit") { _, res in - Application.quit { - res.send(JSON("Application Quit")) - } + Application.quit() return nil } diff --git a/ui/src/app/app.component.ts b/ui/src/app/app.component.ts index a32e995f..9e92a5f2 100644 --- a/ui/src/app/app.component.ts +++ b/ui/src/app/app.component.ts @@ -55,7 +55,7 @@ export class AppComponent implements OnInit, AfterContentInit { const cdkOverlays = document.getElementsByClassName('cdk-overlay-pane') for (let i = 0; i < cdkOverlays.length; i++) { - cdkOverlays[i].setAttribute('style', `transform: scale(${this.ui.scale.toFixed(2)}); max-width: ${Math.round(90 / this.ui.scale)}vw`) + cdkOverlays[i].setAttribute('style', `transform: scale(${this.ui.scale.toFixed(2)}); width: ${Math.round(90 / this.ui.scale)}vw`) } return style } diff --git a/ui/src/app/app.module.ts b/ui/src/app/app.module.ts index 75ae38a1..58a9c61c 100644 --- a/ui/src/app/app.module.ts +++ b/ui/src/app/app.module.ts @@ -121,8 +121,7 @@ import { UIService } from './services/ui.service' useValue: { ...new MatDialogConfig(), hasBackdrop: true, - maxWidth: 10, - width: '10px' + disableClose: false } as MatDialogConfig } ], diff --git a/ui/src/app/sections/effects/equalizers/equalizers.component.ts b/ui/src/app/sections/effects/equalizers/equalizers.component.ts index 085fc022..4ea80bb2 100644 --- a/ui/src/app/sections/effects/equalizers/equalizers.component.ts +++ b/ui/src/app/sections/effects/equalizers/equalizers.component.ts @@ -156,13 +156,7 @@ export class EqualizersComponent implements OnInit, OnDestroy { if (!this.app.enabled || !this.enabled) { return this.clicked() } - const width = '90vw' this.settingsDialog = this.dialog.open(OptionsDialogComponent, { - hasBackdrop: true, - disableClose: false, - width: width, - maxWidth: width, - panelClass: 'options-dialog-container', data: { options: this.activeEqualizer.settings, title: `${this.type} Equalizer Settings`