diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2008-03-29 22:27:30 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2008-03-29 22:27:30 +0100 |
commit | 032353ce29ba4b1fdc9fcc624f204cafb1e955b7 (patch) | |
tree | 7d7172bc0d231cd106d3c6d1b1ad3f93d0639248 /src/gui/curses/gui-curses-bar.c | |
parent | 4b2e8b37f73f4c09a5e9e31a48a1245a7eedda45 (diff) | |
download | weechat-032353ce29ba4b1fdc9fcc624f204cafb1e955b7.zip |
Fixed bug with creation of bar window
Diffstat (limited to 'src/gui/curses/gui-curses-bar.c')
-rw-r--r-- | src/gui/curses/gui-curses-bar.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/gui/curses/gui-curses-bar.c b/src/gui/curses/gui-curses-bar.c index 1b81a9e10..567413651 100644 --- a/src/gui/curses/gui-curses-bar.c +++ b/src/gui/curses/gui-curses-bar.c @@ -152,38 +152,46 @@ void gui_bar_window_create_win (struct t_gui_bar_window *bar_window) { if (bar_window->win_bar) + { delwin (bar_window->win_bar); + bar_window->win_bar = NULL; + } + if (bar_window->win_separator) + { + delwin (bar_window->win_separator); + bar_window->win_separator = NULL; + } bar_window->win_bar = newwin (bar_window->height, bar_window->width, bar_window->y, bar_window->x); - bar_window->win_separator = NULL; + if (bar_window->bar->separator) { switch (bar_window->bar->position) { case GUI_BAR_POSITION_BOTTOM: - bar_window->win_separator = newwin (bar_window->height, + bar_window->win_separator = newwin (1, bar_window->width, bar_window->y - 1, bar_window->x); break; case GUI_BAR_POSITION_TOP: - bar_window->win_separator = newwin (bar_window->height, + bar_window->win_separator = newwin (1, bar_window->width, bar_window->y + bar_window->height, bar_window->x); break; case GUI_BAR_POSITION_LEFT: bar_window->win_separator = newwin (bar_window->height, - bar_window->width, + 1, bar_window->y, bar_window->x + bar_window->width); break; case GUI_BAR_POSITION_RIGHT: bar_window->win_separator = newwin (bar_window->height, - bar_window->width, + 1, bar_window->y, bar_window->x - 1); break; @@ -220,6 +228,8 @@ gui_bar_window_new (struct t_gui_bar *bar, struct t_gui_window *window) bar->bar_window = new_bar_window; new_bar_window->next_bar_window = NULL; } + new_bar_window->win_bar = NULL; + new_bar_window->win_separator = NULL; gui_bar_window_calculate_pos_size (new_bar_window, window); gui_bar_window_create_win (new_bar_window); |