From 015d87579c79d42f0593c57dd4d5cb1388ffa3c3 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Fri, 22 Feb 2002 13:12:33 +0000 Subject: [PATCH] Show window's scroll state with /WINDOW. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2526 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-text/mainwindows.c | 20 ++++++++++++++++---- src/fe-text/module-formats.c | 1 + src/fe-text/module-formats.h | 3 ++- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/fe-text/mainwindows.c b/src/fe-text/mainwindows.c index 7fcd9103..03a82705 100644 --- a/src/fe-text/mainwindows.c +++ b/src/fe-text/mainwindows.c @@ -1035,14 +1035,17 @@ static void cmd_window_move_down(void) window_reparent(active_win, rec); } -static void windows_print_sticky(MAIN_WINDOW_REC *win) +static void windows_print_sticky(WINDOW_REC *win) { + MAIN_WINDOW_REC *mainwin; GSList *tmp, *list; GString *str; + mainwin = WINDOW_MAIN(win); + /* convert to string */ str = g_string_new(NULL); - list = get_sticky_windows_sorted(win); + list = get_sticky_windows_sorted(mainwin); for (tmp = list; tmp != NULL; tmp = tmp->next) { WINDOW_REC *rec = tmp->data; @@ -1051,15 +1054,24 @@ static void windows_print_sticky(MAIN_WINDOW_REC *win) g_string_truncate(str, str->len-2); g_slist_free(list); - printformat_window(win->active, MSGLEVEL_CLIENTCRAP, + printformat_window(win, MSGLEVEL_CLIENTCRAP, TXT_WINDOW_INFO_STICKY, str->str); g_string_free(str, TRUE); } static void sig_window_print_info(WINDOW_REC *win) { + GUI_WINDOW_REC *gui; + + gui = WINDOW_GUI(win); + if (gui->use_scroll) { + printformat_window(win, MSGLEVEL_CLIENTCRAP, + TXT_WINDOW_INFO_SCROLL, + gui->scroll ? "yes" : "no"); + } + if (WINDOW_MAIN(win)->sticky_windows) - windows_print_sticky(WINDOW_MAIN(win)); + windows_print_sticky(win); } void mainwindows_init(void) diff --git a/src/fe-text/module-formats.c b/src/fe-text/module-formats.c index 7584a8c0..f236d900 100644 --- a/src/fe-text/module-formats.c +++ b/src/fe-text/module-formats.c @@ -46,6 +46,7 @@ FORMAT_REC gui_text_formats[] = { "window_set_sticky", "Window set sticky", 0 }, { "window_unset_sticky", "Window is not sticky anymore", 0 }, { "window_info_sticky", "Sticky : $0", 1, { 0 } }, + { "window_info_scroll", "Scroll : $0", 1, { 0 } }, { "window_scroll", "Window scroll mode is now $0", 1, { 0 } }, { "window_scroll_unknown", "Unknown scroll mode $0, must be ON, OFF or DEFAULT", 1, { 0 } }, diff --git a/src/fe-text/module-formats.h b/src/fe-text/module-formats.h index 88c67000..c3607311 100644 --- a/src/fe-text/module-formats.h +++ b/src/fe-text/module-formats.h @@ -21,7 +21,8 @@ enum { TXT_WINDOW_NOT_STICKY, TXT_WINDOW_SET_STICKY, TXT_WINDOW_UNSET_STICKY, - TXT_WINDOW_INFO_STICKY, + TXT_WINDOW_INFO_STICKY, + TXT_WINDOW_INFO_SCROLL, TXT_WINDOW_SCROLL, TXT_WINDOW_SCROLL_UNKNOWN,