kitty @ ls: Also report layout options
This commit is contained in:
parent
6546c1da9b
commit
4fd76b09d9
@ -28,6 +28,9 @@ class LayoutOpts:
|
||||
def __init__(self, data: Dict[str, str]):
|
||||
pass
|
||||
|
||||
def serialized(self) -> Dict[str, Any]:
|
||||
return {}
|
||||
|
||||
|
||||
class LayoutData(NamedTuple):
|
||||
content_pos: int = 0
|
||||
|
||||
@ -388,6 +388,9 @@ class SplitsLayoutOpts(LayoutOpts):
|
||||
def __init__(self, data: Dict[str, str]):
|
||||
self.default_axis_is_horizontal = data.get('split_axis', 'horizontal') == 'horizontal'
|
||||
|
||||
def serialized(self) -> Dict[str, Any]:
|
||||
return {'default_axis_is_horizontal': self.default_axis_is_horizontal}
|
||||
|
||||
|
||||
class Splits(Layout):
|
||||
name = 'splits'
|
||||
|
||||
@ -72,6 +72,9 @@ class TallLayoutOpts(LayoutOpts):
|
||||
self.bias = tuple(repeat(b / fs, fs)) + (1.0 - b,)
|
||||
self.mirrored = to_bool(data.get('mirrored', 'false'))
|
||||
|
||||
def serialized(self) -> Dict[str, Any]:
|
||||
return {'full_size': self.full_size, 'bias': self.bias, 'mirrored': self.mirrored}
|
||||
|
||||
|
||||
class Tall(Layout):
|
||||
|
||||
|
||||
@ -38,6 +38,7 @@ class TabDict(TypedDict):
|
||||
title: str
|
||||
layout: str
|
||||
layout_state: Dict[str, Any]
|
||||
layout_opts: Dict[str, Any]
|
||||
windows: List[WindowDict]
|
||||
active_window_history: List[int]
|
||||
|
||||
@ -169,6 +170,8 @@ class Tab: # {{{
|
||||
'window_list': self.windows.serialize_state(),
|
||||
'current_layout': self._current_layout_name,
|
||||
'last_used_layout': self._last_used_layout,
|
||||
'layout_opts': self.current_layout.layout_opts,
|
||||
'layout_state': self.current_layout.layout_state,
|
||||
'name': self.name,
|
||||
}
|
||||
|
||||
@ -813,6 +816,7 @@ class TabManager: # {{{
|
||||
'title': tab.name or tab.title,
|
||||
'layout': str(tab.current_layout.name),
|
||||
'layout_state': tab.current_layout.layout_state(),
|
||||
'layout_opts': tab.current_layout.layout_opts.serialized(),
|
||||
'windows': list(tab.list_windows(active_window, self_window)),
|
||||
'active_window_history': list(tab.windows.active_window_history),
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user