Fix window opacity in fullscreen mode

This commit is contained in:
1024jp 2021-06-09 23:39:52 +09:00
parent 8b1e45c0b6
commit 162901b3af
2 changed files with 10 additions and 2 deletions

View File

@ -10,6 +10,11 @@ Change Log
- Minimize scrolling when focusing a text such as in text search and outline selection.
### Fixes
- Fix an issue that the navigation bar tinted wrongly when the document window is in fullscreen and the editor is non-opaque.
4.0.5 (463)
--------------------------

View File

@ -8,7 +8,7 @@
//
// ---------------------------------------------------------------------------
//
// © 2014-2020 1024jp
// © 2014-2021 1024jp
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -46,8 +46,9 @@ final class DocumentWindow: NSWindow {
didSet {
backgroundAlpha = backgroundAlpha.clamped(to: 0.2...1.0)
guard !self.styleMask.contains(.fullScreen) else { return }
self.isOpaque = (backgroundAlpha == 1.0)
self.backgroundColor = self.isOpaque ? nil : self.contentBackgroundColor.withAlphaComponent(backgroundAlpha)
self.invalidateShadow()
self.contentView?.needsDisplay = true
@ -85,6 +86,8 @@ final class DocumentWindow: NSWindow {
guard isOpaque != oldValue else { return }
self.backgroundColor = isOpaque ? nil : self.contentBackgroundColor.withAlphaComponent(self.backgroundAlpha)
self.invalidateTitlebarOpacity()
if isOpaque {