mirror of
https://github.com/weechat/weechat.git
synced 2026-07-10 03:33:12 +02:00
core: add option weechat.look.window_auto_zoom, disable automatic zoom by default when terminal becomes too small for windows
This commit is contained in:
@@ -167,6 +167,7 @@ struct t_config_option *config_look_search_text_not_found_alert;
|
||||
struct t_config_option *config_look_separator_horizontal;
|
||||
struct t_config_option *config_look_separator_vertical;
|
||||
struct t_config_option *config_look_time_format;
|
||||
struct t_config_option *config_look_window_auto_zoom;
|
||||
struct t_config_option *config_look_window_separator_horizontal;
|
||||
struct t_config_option *config_look_window_separator_vertical;
|
||||
struct t_config_option *config_look_window_title;
|
||||
@@ -2593,6 +2594,13 @@ config_weechat_init_options ()
|
||||
N_("time format for dates converted to strings and displayed in "
|
||||
"messages (see man strftime for date/time specifiers)"),
|
||||
NULL, 0, 0, "%a, %d %b %Y %T", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
config_look_window_auto_zoom = config_file_new_option (
|
||||
weechat_config_file, ptr_section,
|
||||
"window_auto_zoom", "boolean",
|
||||
N_("automatically zoom on current window if the terminal becomes too "
|
||||
"small to display all windows (use alt-z to unzoom windows when the "
|
||||
"terminal is big enough)"),
|
||||
NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
config_look_window_separator_horizontal = config_file_new_option (
|
||||
weechat_config_file, ptr_section,
|
||||
"window_separator_horizontal", "boolean",
|
||||
|
||||
@@ -197,6 +197,7 @@ extern struct t_config_option *config_look_search_text_not_found_alert;
|
||||
extern struct t_config_option *config_look_separator_horizontal;
|
||||
extern struct t_config_option *config_look_separator_vertical;
|
||||
extern struct t_config_option *config_look_time_format;
|
||||
extern struct t_config_option *config_look_window_auto_zoom;
|
||||
extern struct t_config_option *config_look_window_separator_horizontal;
|
||||
extern struct t_config_option *config_look_window_separator_vertical;
|
||||
extern struct t_config_option *config_look_window_title;
|
||||
|
||||
@@ -1722,13 +1722,16 @@ gui_window_refresh_windows ()
|
||||
gui_window_get_height () - add_top - add_bottom,
|
||||
0) < 0)
|
||||
{
|
||||
ptr_layout = gui_layout_search (GUI_LAYOUT_ZOOM);
|
||||
if (ptr_layout)
|
||||
if (CONFIG_BOOLEAN(config_look_window_auto_zoom))
|
||||
{
|
||||
/* remove zoom saved, to force a new zoom */
|
||||
gui_layout_remove (ptr_layout);
|
||||
ptr_layout = gui_layout_search (GUI_LAYOUT_ZOOM);
|
||||
if (ptr_layout)
|
||||
{
|
||||
/* remove zoom saved, to force a new zoom */
|
||||
gui_layout_remove (ptr_layout);
|
||||
}
|
||||
gui_window_zoom (gui_current_window);
|
||||
}
|
||||
gui_window_zoom (gui_current_window);
|
||||
}
|
||||
|
||||
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
|
||||
|
||||
Reference in New Issue
Block a user