Remove the resize_draw_strategy option

Use scale + size as the fixed strategy. This is because static looks
bad with translucent windows (the cell area ends up a different opacity
than the newly exposed window area).
This commit is contained in:
Kovid Goyal
2023-06-07 15:36:05 +05:30
parent 89875af5e6
commit cd56597e7e
9 changed files with 45 additions and 71 deletions

View File

@@ -1080,17 +1080,6 @@ resizing, while not also continuously redrawing, to save energy.
'''
)
opt('resize_draw_strategy', 'static',
option_type='resize_draw_strategy', ctype='int',
long_text='''
Choose how kitty draws a window while a resize is in progress. A value of
:code:`static` means draw the current window contents, mostly unchanged. A value
of :code:`scale` means draw the current window contents scaled. A value of
:code:`blank` means draw a blank window. A value of :code:`size` means show the
window size in cells.
'''
)
opt('resize_in_steps', 'no',
option_type='to_bool', ctype='bool',
long_text='''

13
kitty/options/parse.py generated
View File

@@ -14,11 +14,11 @@ from kitty.options.utils import (
deprecated_send_text, disable_ligatures, edge_width, env, font_features, hide_window_decorations,
macos_option_as_alt, macos_titlebar_color, modify_font, narrow_symbols, optional_edge_width,
parse_map, parse_mouse_map, paste_actions, remote_control_password, resize_debounce_time,
resize_draw_strategy, scrollback_lines, scrollback_pager_history_size, shell_integration,
store_multiple, symbol_map, tab_activity_symbol, tab_bar_edge, tab_bar_margin_height,
tab_bar_min_tabs, tab_fade, tab_font_style, tab_separator, tab_title_template, titlebar_color,
to_cursor_shape, to_font_size, to_layout_names, to_modifiers, url_prefixes, url_style,
visual_window_select_characters, window_border_width, window_size
scrollback_lines, scrollback_pager_history_size, shell_integration, store_multiple, symbol_map,
tab_activity_symbol, tab_bar_edge, tab_bar_margin_height, tab_bar_min_tabs, tab_fade,
tab_font_style, tab_separator, tab_title_template, titlebar_color, to_cursor_shape, to_font_size,
to_layout_names, to_modifiers, url_prefixes, url_style, visual_window_select_characters,
window_border_width, window_size
)
@@ -1153,9 +1153,6 @@ class Parser:
def resize_debounce_time(self, val: str, ans: typing.Dict[str, typing.Any]) -> None:
ans['resize_debounce_time'] = resize_debounce_time(val)
def resize_draw_strategy(self, val: str, ans: typing.Dict[str, typing.Any]) -> None:
ans['resize_draw_strategy'] = resize_draw_strategy(val)
def resize_in_steps(self, val: str, ans: typing.Dict[str, typing.Any]) -> None:
ans['resize_in_steps'] = to_bool(val)

View File

@@ -603,19 +603,6 @@ convert_from_opts_resize_debounce_time(PyObject *py_opts, Options *opts) {
Py_DECREF(ret);
}
static void
convert_from_python_resize_draw_strategy(PyObject *val, Options *opts) {
opts->resize_draw_strategy = PyLong_AsLong(val);
}
static void
convert_from_opts_resize_draw_strategy(PyObject *py_opts, Options *opts) {
PyObject *ret = PyObject_GetAttrString(py_opts, "resize_draw_strategy");
if (ret == NULL) return;
convert_from_python_resize_draw_strategy(ret, opts);
Py_DECREF(ret);
}
static void
convert_from_python_resize_in_steps(PyObject *val, Options *opts) {
opts->resize_in_steps = PyObject_IsTrue(val);
@@ -1152,8 +1139,6 @@ convert_opts_from_python_opts(PyObject *py_opts, Options *opts) {
if (PyErr_Occurred()) return false;
convert_from_opts_resize_debounce_time(py_opts, opts);
if (PyErr_Occurred()) return false;
convert_from_opts_resize_draw_strategy(py_opts, opts);
if (PyErr_Occurred()) return false;
convert_from_opts_resize_in_steps(py_opts, opts);
if (PyErr_Occurred()) return false;
convert_from_opts_tab_bar_edge(py_opts, opts);

View File

@@ -410,7 +410,6 @@ option_names = ( # {{{
'remote_control_password',
'repaint_delay',
'resize_debounce_time',
'resize_draw_strategy',
'resize_in_steps',
'scrollback_fill_enlarged_window',
'scrollback_lines',
@@ -565,7 +564,6 @@ class Options:
remember_window_size: bool = True
repaint_delay: int = 10
resize_debounce_time: typing.Tuple[float, float] = (0.1, 0.5)
resize_draw_strategy: int = 0
resize_in_steps: bool = False
scrollback_fill_enlarged_window: bool = False
scrollback_lines: int = 2000