Cleanup previous PR
This commit is contained in:
parent
54a7841d18
commit
d114388553
3 changed files with 44 additions and 37 deletions
|
|
@ -9,6 +9,12 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||||
Recent major new features
|
Recent major new features
|
||||||
---------------------------
|
---------------------------
|
||||||
|
|
||||||
|
Vertical tabs [0.48]
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
kitty now has support for :pull:`vertical tabs <9855>` along the left or right edge of the OS
|
||||||
|
Window. Useful for people that have wide aspect ratio windows.
|
||||||
|
|
||||||
Drag and drop for terminal programs [0.47]
|
Drag and drop for terminal programs [0.47]
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
@ -173,9 +179,11 @@ consumption to do the same tasks.
|
||||||
Detailed list of changes
|
Detailed list of changes
|
||||||
-------------------------------------
|
-------------------------------------
|
||||||
|
|
||||||
0.50.0 [future]
|
0.48.0 [future]
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
- Implement vertical tabs by setting :opt:`tab_bar_edge` to ``left`` or ``right`` (:pull:`9855`)
|
||||||
|
|
||||||
- Graphics protocol: Add a new :ref:`transient usage hint <image_usage_hints>` that clients can send to terminals to indicate an image is meant for only short duration use (:pull:`10092`)
|
- Graphics protocol: Add a new :ref:`transient usage hint <image_usage_hints>` that clients can send to terminals to indicate an image is meant for only short duration use (:pull:`10092`)
|
||||||
|
|
||||||
- kitten @ get-text: Add support for :code:`alternate` and :code:`alternate_scrollback` extents to fetch text from the alternate screen buffer (:iss:`10165`)
|
- kitten @ get-text: Add support for :code:`alternate` and :code:`alternate_scrollback` extents to fetch text from the alternate screen buffer (:iss:`10165`)
|
||||||
|
|
|
||||||
|
|
@ -751,12 +751,15 @@ def tab_separator(x: str) -> str:
|
||||||
|
|
||||||
|
|
||||||
def tab_bar_edge(x: str) -> int:
|
def tab_bar_edge(x: str) -> int:
|
||||||
return {
|
match x.lower():
|
||||||
'left': defines.LEFT_EDGE,
|
case 'top':
|
||||||
'top': defines.TOP_EDGE,
|
return defines.TOP_EDGE
|
||||||
'right': defines.RIGHT_EDGE,
|
case 'left':
|
||||||
'bottom': defines.BOTTOM_EDGE,
|
return defines.LEFT_EDGE
|
||||||
}.get(x.lower(), defines.BOTTOM_EDGE)
|
case 'right':
|
||||||
|
return defines.RIGHT_EDGE
|
||||||
|
case _:
|
||||||
|
return defines.BOTTOM_EDGE
|
||||||
|
|
||||||
|
|
||||||
def tab_font_style(x: str) -> tuple[bool, bool]:
|
def tab_font_style(x: str) -> tuple[bool, bool]:
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
from string import Formatter as StringFormatter
|
from string import Formatter as StringFormatter
|
||||||
from typing import (
|
from typing import (
|
||||||
Any,
|
Any,
|
||||||
|
Literal,
|
||||||
NamedTuple,
|
NamedTuple,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -16,12 +17,12 @@
|
||||||
from .fast_data_types import (
|
from .fast_data_types import (
|
||||||
BOTTOM_EDGE,
|
BOTTOM_EDGE,
|
||||||
DECAWM,
|
DECAWM,
|
||||||
Color,
|
|
||||||
LEFT_EDGE,
|
LEFT_EDGE,
|
||||||
Region,
|
|
||||||
RIGHT_EDGE,
|
RIGHT_EDGE,
|
||||||
Screen,
|
|
||||||
TOP_EDGE,
|
TOP_EDGE,
|
||||||
|
Color,
|
||||||
|
Region,
|
||||||
|
Screen,
|
||||||
background_opacity_of,
|
background_opacity_of,
|
||||||
cell_size_for_window,
|
cell_size_for_window,
|
||||||
get_boss,
|
get_boss,
|
||||||
|
|
@ -112,21 +113,21 @@ def is_vertical_edge(edge: int) -> bool:
|
||||||
return edge in VERTICAL_EDGES
|
return edge in VERTICAL_EDGES
|
||||||
|
|
||||||
|
|
||||||
def edge_name(edge: int) -> EdgeLiteral:
|
edge_name_map: dict[int, EdgeLiteral] = {
|
||||||
return {
|
|
||||||
LEFT_EDGE: 'left',
|
LEFT_EDGE: 'left',
|
||||||
TOP_EDGE: 'top',
|
TOP_EDGE: 'top',
|
||||||
RIGHT_EDGE: 'right',
|
RIGHT_EDGE: 'right',
|
||||||
BOTTOM_EDGE: 'bottom',
|
BOTTOM_EDGE: 'bottom',
|
||||||
}.get(edge, 'bottom')
|
}
|
||||||
|
|
||||||
|
|
||||||
def normalized_tab_bar_align(align: str) -> str:
|
def normalized_tab_bar_align(align: str) -> Literal['start', 'end', 'center']:
|
||||||
if align == 'left':
|
match align:
|
||||||
|
case 'left' | 'start':
|
||||||
return 'start'
|
return 'start'
|
||||||
if align == 'right':
|
case 'right' | 'end':
|
||||||
return 'end'
|
return 'end'
|
||||||
return align
|
return 'center'
|
||||||
|
|
||||||
|
|
||||||
@lru_cache
|
@lru_cache
|
||||||
|
|
@ -656,7 +657,7 @@ def apply_options(self) -> None:
|
||||||
opts.active_tab_title_template,
|
opts.active_tab_title_template,
|
||||||
opts.tab_activity_symbol,
|
opts.tab_activity_symbol,
|
||||||
opts.tab_powerline_style,
|
opts.tab_powerline_style,
|
||||||
edge_name(opts.tab_bar_edge),
|
edge_name_map[opts.tab_bar_edge],
|
||||||
opts.tab_title_max_length, self.os_window_id,
|
opts.tab_title_max_length, self.os_window_id,
|
||||||
)
|
)
|
||||||
ts = opts.tab_bar_style
|
ts = opts.tab_bar_style
|
||||||
|
|
@ -671,17 +672,12 @@ def apply_options(self) -> None:
|
||||||
else:
|
else:
|
||||||
self.draw_func = draw_tab_with_fade
|
self.draw_func = draw_tab_with_fade
|
||||||
self.tab_bar_align = normalized_tab_bar_align(opts.tab_bar_align)
|
self.tab_bar_align = normalized_tab_bar_align(opts.tab_bar_align)
|
||||||
if self.tab_bar_align == 'center':
|
match self.tab_bar_align:
|
||||||
self.align_factor = 2
|
case 'center':
|
||||||
elif self.tab_bar_align == 'end':
|
|
||||||
self.align_factor = 1
|
|
||||||
else:
|
|
||||||
self.align_factor = 0
|
|
||||||
if self.tab_bar_align == 'center':
|
|
||||||
self.align: Callable[[], None] = partial(self.align_with_factor, 2)
|
self.align: Callable[[], None] = partial(self.align_with_factor, 2)
|
||||||
elif self.tab_bar_align == 'end':
|
case 'end':
|
||||||
self.align = self.align_with_factor
|
self.align = self.align_with_factor
|
||||||
else:
|
case 'start':
|
||||||
self.align = lambda: None
|
self.align = lambda: None
|
||||||
|
|
||||||
def patch_colors(self, spec: dict[str, int | None]) -> None:
|
def patch_colors(self, spec: dict[str, int | None]) -> None:
|
||||||
|
|
@ -946,7 +942,7 @@ def destroy(self) -> None:
|
||||||
self.screen.reset_callbacks()
|
self.screen.reset_callbacks()
|
||||||
del self.screen
|
del self.screen
|
||||||
|
|
||||||
def tab_id_at(self, x: int, y: int = 0) -> int:
|
def tab_id_at(self, x: int, y: int) -> int:
|
||||||
if self.laid_out_once:
|
if self.laid_out_once:
|
||||||
g = self.window_geometry
|
g = self.window_geometry
|
||||||
if not (g.left <= x < g.right and g.top <= y < g.bottom):
|
if not (g.left <= x < g.right and g.top <= y < g.bottom):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue