This commit is contained in:
Kovid Goyal 2020-05-24 12:40:54 +05:30
parent b9d74e2012
commit d8896eb210
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
3 changed files with 20 additions and 1 deletions

View File

@ -12,6 +12,9 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
- Tall and Fat layouts: Add a ``mirrored`` option to put the full size window
on the opposite edge of the screen (:iss:`2654`)
- Tall and Fat layouts: Add mappable actions to increase or decrease the number
of full size windows (:iss:`2688`)
- Add an option :opt:`confirm_os_window_close` to ask for confirmation
when closing an OS window with multiple kitty windows.

View File

@ -67,6 +67,13 @@ for the options is shown below::
│ │ │
└──────────────┴───────────────┘
In addition, you can map keys to increase or decrease the number of full size
windows, for example::
map ctrl+[ layout_action decrease_num_full_size_windows
map ctrl+] layout_action increase_num_full_size_windows
The Fat Layout
----------------

View File

@ -3,7 +3,7 @@
# License: GPLv3 Copyright: 2020, Kovid Goyal <kovid at kovidgoyal.net>
from itertools import islice, repeat
from typing import Dict, Generator, List, Tuple
from typing import Dict, Generator, List, Optional, Sequence, Tuple
from kitty.conf.utils import to_bool
from kitty.typing import EdgeLiteral, WindowType
@ -209,6 +209,15 @@ class Tall(Layout):
else:
yield self.only_between_border
def layout_action(self, action_name: str, args: Sequence[str], all_windows: WindowList) -> Optional[bool]:
if action_name == 'increase_num_full_size_windows':
self.layout_opts.full_size += 1
return True
if action_name == 'decrease_num_full_size_windows':
if self.layout_opts.full_size > 1:
self.layout_opts.full_size -= 1
return True
class Fat(Tall):