1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00

Merge pull request #941 from dwfreed/window_default_hidelevel

Add window_default_hidelevel setting
This commit is contained in:
ailin-nemui 2018-09-23 11:22:46 +02:00 committed by GitHub
commit cdfd75da98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -53,7 +53,7 @@ static GUI_WINDOW_REC *gui_window_init(WINDOW_REC *window,
get_default_indent_func());
textbuffer_view_set_break_wide(gui->view, settings_get_bool("break_wide"));
wcwidth_impl = settings_get_choice("wcwidth_implementation");
textbuffer_view_set_hidden_level(gui->view, MSGLEVEL_HIDDEN);
textbuffer_view_set_hidden_level(gui->view, settings_get_level("window_default_hidelevel"));
if (parent->active == window)
textbuffer_view_set_window(gui->view, parent->screen_win);
return gui;
@ -303,6 +303,7 @@ void gui_windows_init(void)
settings_add_bool("lookandfeel", "indent_always", FALSE);
settings_add_bool("lookandfeel", "break_wide", FALSE);
settings_add_bool("lookandfeel", "scroll", TRUE);
settings_add_level("lookandfeel", "window_default_hidelevel", "HIDDEN");
window_create_override = MAIN_WINDOW_TYPE_NONE;

View File

@ -42,7 +42,7 @@ static void sig_layout_window_save(WINDOW_REC *window, CONFIG_NODE *node)
iconfig_node_set_int(node, "parent", active->refnum);
}
if (gui->view->hidden_level != MSGLEVEL_HIDDEN) {
if (gui->view->hidden_level != settings_get_level("window_default_hidelevel")) {
char *level = bits2level(gui->view->hidden_level);
iconfig_node_set_str(node, "hidelevel", level);
g_free(level);
@ -56,6 +56,7 @@ static void sig_layout_window_restore(WINDOW_REC *window, CONFIG_NODE *node)
{
WINDOW_REC *parent;
GUI_WINDOW_REC *gui;
const char *default_hidelevel = settings_get_str("window_default_hidelevel");
gui = WINDOW_GUI(window);
@ -66,7 +67,7 @@ static void sig_layout_window_restore(WINDOW_REC *window, CONFIG_NODE *node)
if (config_node_get_bool(node, "sticky", FALSE))
gui_window_set_sticky(window);
textbuffer_view_set_hidden_level(gui->view, level2bits(config_node_get_str(node, "hidelevel", "HIDDEN"), NULL));
textbuffer_view_set_hidden_level(gui->view, level2bits(config_node_get_str(node, "hidelevel", default_hidelevel), NULL));
if (config_node_get_str(node, "scroll", NULL) != NULL) {
gui->use_scroll = TRUE;