From 401d3ed12f3fd55ff0c2f32c0d53f6763f6ebdec Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Thu, 18 Dec 2008 13:47:26 +0100 Subject: [PATCH] Fix refresh of bar when changing items inside --- src/gui/gui-bar.c | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/src/gui/gui-bar.c b/src/gui/gui-bar.c index 2bb6f6877..2ae816dee 100644 --- a/src/gui/gui-bar.c +++ b/src/gui/gui-bar.c @@ -492,6 +492,38 @@ gui_bar_search_with_option_name (const char *option_name) return ptr_bar; } +/* + * gui_bar_content_build_bar_windows: rebuild content of bar windows for a bar + */ + +void +gui_bar_content_build_bar_windows (struct t_gui_bar *bar) +{ + struct t_gui_window *ptr_window; + struct t_gui_bar_window *ptr_bar_window; + + if (!bar) + return; + + if (bar->bar_window) + { + gui_bar_window_content_build (bar->bar_window, NULL); + } + else + { + for (ptr_window = gui_windows; ptr_window; + ptr_window = ptr_window->next_window) + { + for (ptr_bar_window = ptr_window->bar_windows; ptr_bar_window; + ptr_bar_window = ptr_bar_window->next_bar_window) + { + if (ptr_bar_window->bar == bar) + gui_bar_window_content_build (ptr_bar_window, ptr_window); + } + } + } +} + /* * gui_bar_ask_refresh: ask refresh for bar */ @@ -912,7 +944,10 @@ gui_bar_config_change_items (void *data, struct t_config_option *option) } if (!CONFIG_BOOLEAN(ptr_bar->hidden)) - gui_bar_draw (ptr_bar); + { + gui_bar_content_build_bar_windows (ptr_bar); + gui_bar_ask_refresh (ptr_bar); + } } }