From 9db0c7cc7d8287ad83ed8a90a4608317a07ab402 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sun, 25 Nov 2001 16:35:11 +0000 Subject: [PATCH] --more-- statusbar item didn't work properly with split windows. Also changed it's settings in non-active window to be the same as in active window (right aligned) git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2147 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- irssi.conf | 2 +- src/fe-text/statusbar-items.c | 20 +++++++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/irssi.conf b/irssi.conf index e0b74108..33afafcb 100644 --- a/irssi.conf +++ b/irssi.conf @@ -137,7 +137,7 @@ statusbar = { barstart = { priority = "100"; }; window = { }; window_empty = { }; - more = { }; + more = { priority = "-1"; alignment = "right"; }; barend = { priority = "100"; alignment = "right"; }; }; }; diff --git a/src/fe-text/statusbar-items.c b/src/fe-text/statusbar-items.c index 5aefcfc1..2f9a43fc 100644 --- a/src/fe-text/statusbar-items.c +++ b/src/fe-text/statusbar-items.c @@ -31,7 +31,7 @@ #define LAG_REFRESH_TIME 10 static GList *activity_list; -static int more_visible; +static GSList *more_visible; /* list of MAIN_WINDOW_RECs which have --more-- */ static GHashTable *input_entries; static int last_lag, last_lag_unknown, lag_timeout_tag; @@ -218,19 +218,28 @@ static void sig_statusbar_activity_updated(void) static void item_more(SBAR_ITEM_REC *item, int get_size_only) { - more_visible = WINDOW_GUI(active_win)->view->more_text; - if (!more_visible) { + MAIN_WINDOW_REC *mainwin; + int visible; + + mainwin = WINDOW_MAIN(active_win); + visible = WINDOW_GUI(active_win)->view->more_text; + if (!visible) { + more_visible = g_slist_remove(more_visible, mainwin); if (get_size_only) item->min_size = item->max_size = 0; return; } + more_visible = g_slist_prepend(more_visible, mainwin); statusbar_item_default_handler(item, get_size_only, NULL, "", FALSE); } static void sig_statusbar_more_updated(void) { - if (WINDOW_GUI(active_win)->view->more_text != more_visible) + int visible; + + visible = g_slist_find(more_visible, WINDOW_MAIN(active_win)) != NULL; + if (WINDOW_GUI(active_win)->view->more_text != visible) statusbar_items_redraw("more"); } @@ -378,7 +387,7 @@ void statusbar_items_init(void) signal_add("window refnum changed", (SIGNAL_FUNC) sig_statusbar_activity_updated); /* more */ - more_visible = FALSE; + more_visible = NULL; signal_add("gui page scrolled", (SIGNAL_FUNC) sig_statusbar_more_updated); signal_add("window changed", (SIGNAL_FUNC) sig_statusbar_more_updated); signal_add_last("gui print text finished", (SIGNAL_FUNC) sig_statusbar_more_updated); @@ -408,6 +417,7 @@ void statusbar_items_deinit(void) activity_list = NULL; /* more */ + g_slist_free(more_visible); signal_remove("gui page scrolled", (SIGNAL_FUNC) sig_statusbar_more_updated); signal_remove("window changed", (SIGNAL_FUNC) sig_statusbar_more_updated); signal_remove("gui print text finished", (SIGNAL_FUNC) sig_statusbar_more_updated);