summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2008-03-29 15:07:52 +0100
committerSebastien Helleu <flashcode@flashtux.org>2008-03-29 15:07:52 +0100
commitf1db462136800702cf48214b687b0a07c3634f4e (patch)
treeea48b33e2d871a7c33d6111bc65cfc0f63f8852c /src/gui
parent7a1a79424e40bf906a300d33704200fbb61f1bb0 (diff)
downloadweechat-f1db462136800702cf48214b687b0a07c3634f4e.zip
Fixed bug with bars refresh
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/curses/gui-curses-bar.c83
-rw-r--r--src/gui/curses/gui-curses-window.c1
-rw-r--r--src/gui/curses/gui-curses.h1
3 files changed, 50 insertions, 35 deletions
diff --git a/src/gui/curses/gui-curses-bar.c b/src/gui/curses/gui-curses-bar.c
index eddfb3704..1b81a9e10 100644
--- a/src/gui/curses/gui-curses-bar.c
+++ b/src/gui/curses/gui-curses-bar.c
@@ -145,6 +145,53 @@ gui_bar_window_calculate_pos_size (struct t_gui_bar_window *bar_window,
}
/*
+ * gui_bar_window_create_win: create curses window for bar
+ */
+
+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 = 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->width,
+ bar_window->y - 1,
+ bar_window->x);
+ break;
+ case GUI_BAR_POSITION_TOP:
+ bar_window->win_separator = newwin (bar_window->height,
+ 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,
+ 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,
+ bar_window->y,
+ bar_window->x - 1);
+ break;
+ }
+ }
+}
+
+/*
* gui_bar_window_new: create a new "window bar" for a bar, in screen or a window
* if window is not NULL, bar window will be in this window
* return 1 if ok, 0 if error
@@ -175,42 +222,8 @@ gui_bar_window_new (struct t_gui_bar *bar, struct t_gui_window *window)
}
gui_bar_window_calculate_pos_size (new_bar_window, window);
+ gui_bar_window_create_win (new_bar_window);
- new_bar_window->win_bar = newwin (new_bar_window->height,
- new_bar_window->width,
- new_bar_window->y,
- new_bar_window->x);
- new_bar_window->win_separator = NULL;
- if (new_bar_window->bar->separator)
- {
- switch (bar->position)
- {
- case GUI_BAR_POSITION_BOTTOM:
- new_bar_window->win_separator = newwin (1,
- new_bar_window->width,
- new_bar_window->y - 1,
- new_bar_window->x);
- break;
- case GUI_BAR_POSITION_TOP:
- new_bar_window->win_separator = newwin (1,
- new_bar_window->width,
- new_bar_window->y + new_bar_window->height,
- new_bar_window->x);
- break;
- case GUI_BAR_POSITION_LEFT:
- new_bar_window->win_separator = newwin (new_bar_window->height,
- 1,
- new_bar_window->y,
- new_bar_window->x + new_bar_window->width);
- break;
- case GUI_BAR_POSITION_RIGHT:
- new_bar_window->win_separator = newwin (new_bar_window->height,
- 1,
- new_bar_window->y,
- new_bar_window->x - 1);
- break;
- }
- }
return 1;
}
diff --git a/src/gui/curses/gui-curses-window.c b/src/gui/curses/gui-curses-window.c
index 953ef7882..9a356150e 100644
--- a/src/gui/curses/gui-curses-window.c
+++ b/src/gui/curses/gui-curses-window.c
@@ -972,6 +972,7 @@ gui_window_refresh_windows ()
if (ptr_bar->type == GUI_BAR_TYPE_ROOT)
{
gui_bar_window_calculate_pos_size (ptr_bar->bar_window, NULL);
+ gui_bar_window_create_win (ptr_bar->bar_window);
gui_bar_draw (ptr_bar);
}
}
diff --git a/src/gui/curses/gui-curses.h b/src/gui/curses/gui-curses.h
index aa1bb107e..d42cbe9da 100644
--- a/src/gui/curses/gui-curses.h
+++ b/src/gui/curses/gui-curses.h
@@ -73,6 +73,7 @@ extern void gui_color_end ();
/* bar functions */
extern void gui_bar_window_calculate_pos_size (struct t_gui_bar_window *bar_window,
struct t_gui_window *window);
+extern void gui_bar_window_create_win (struct t_gui_bar_window *bar_window);
/* chat functions */
extern void gui_chat_calculate_line_diff (struct t_gui_window *window,