macOS: Add a new value titlebar-and-corners for :opt:hide_window_decorations that emulates the behavior of hide_window_decorations yes in older versions of kitty

This commit is contained in:
Kovid Goyal
2023-07-11 22:27:47 +05:30
parent a00b6bd497
commit 5f8610f7bc
4 changed files with 16 additions and 11 deletions

View File

@@ -1026,12 +1026,12 @@ opt('hide_window_decorations', 'no',
option_type='hide_window_decorations', ctype='uint',
long_text='''
Hide the window decorations (title-bar and window borders) with :code:`yes`. On
macOS, :code:`titlebar-only` can be used to only hide the titlebar. Whether this
works and exactly what effect it has depends on the window manager/operating
macOS, :code:`titlebar-only` and :code:`titlebar-and-corners` can be used to only hide the titlebar and the rounded corners.
Whether this works and exactly what effect it has depends on the window manager/operating
system. Note that the effects of changing this option when reloading config
are undefined. When using :code:`titlebar-only`, it is useful to also set
:opt:`window_margin_width` and :opt:`placement_strategy` to prevent the rounded
corners from clipping text.
corners from clipping text. Or use :code:`titlebar-and-corners`.
'''
)

View File

@@ -594,6 +594,8 @@ def optional_edge_width(x: str) -> FloatEdges:
def hide_window_decorations(x: str) -> int:
if x == 'titlebar-only':
return 0b10
if x == 'titlebar-and-corners':
return 0b100
if to_bool(x):
return 0b01
return 0b00