mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-04-21 00:48:36 +03:00

Finishes #378 Supercedes #4159 This adds a new enum value for `macos-non-native-fullscreen`: `padded-notch`. This value will add padding to the top of the window to account for the notch on applicable devices while still hiding the menu. This value is preferred over "visible-menu" by some people because for screens without a notch, the window will take up the full height. The plan in the future is that we may color the padded area when a notch is present. In this commit it appears as transparent.
24 lines
581 B
Swift
24 lines
581 B
Swift
import GhosttyKit
|
|
|
|
extension FullscreenMode {
|
|
/// Initialize from a Ghostty fullscreen action.
|
|
static func from(ghostty: ghostty_action_fullscreen_e) -> Self? {
|
|
return switch ghostty {
|
|
case GHOSTTY_FULLSCREEN_NATIVE:
|
|
.native
|
|
|
|
case GHOSTTY_FULLSCREEN_NON_NATIVE:
|
|
.nonNative
|
|
|
|
case GHOSTTY_FULLSCREEN_NON_NATIVE_VISIBLE_MENU:
|
|
.nonNativeVisibleMenu
|
|
|
|
case GHOSTTY_FULLSCREEN_NON_NATIVE_PADDED_NOTCH:
|
|
.nonNativePaddedNotch
|
|
|
|
default:
|
|
nil
|
|
}
|
|
}
|
|
}
|