refactor(macos): do nothing if `background-opacity >= 1`
parent
4c6d3f8ed2
commit
ded3dd4cbc
|
|
@ -818,17 +818,14 @@ class BaseTerminalController: NSWindowController,
|
||||||
// MARK: Background Opacity
|
// MARK: Background Opacity
|
||||||
|
|
||||||
/// Toggle the background opacity between transparent and opaque states.
|
/// Toggle the background opacity between transparent and opaque states.
|
||||||
/// If the configured background-opacity is already opaque (>= 1), this resets
|
/// Do nothing if the configured background-opacity is >= 1 (already opaque).
|
||||||
/// the override flag to false so that future config changes take effect.
|
/// Subclasses should override this to add platform-specific checks and sync appearance.
|
||||||
/// Subclasses should override this to sync their appearance after toggling.
|
|
||||||
func toggleBackgroundOpacity() {
|
func toggleBackgroundOpacity() {
|
||||||
// If config is already opaque, just ensure override is disabled
|
// Do nothing if config is already fully opaque
|
||||||
if ghostty.config.backgroundOpacity >= 1 {
|
guard ghostty.config.backgroundOpacity < 1 else { return }
|
||||||
isBackgroundOpaque = false
|
|
||||||
} else {
|
// Toggle between transparent and opaque
|
||||||
// Otherwise toggle between transparent and opaque
|
isBackgroundOpaque.toggle()
|
||||||
isBackgroundOpaque.toggle()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: Fullscreen
|
// MARK: Fullscreen
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue