From 16e11ef25ea13eeb77d5ebaf6df83a06bfc09afc Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Thu, 24 Apr 2008 15:39:34 +0200 Subject: Fixed bug with bar auto-sizing in windows --- src/gui/gtk/gui-gtk-bar.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'src/gui/gtk/gui-gtk-bar.c') diff --git a/src/gui/gtk/gui-gtk-bar.c b/src/gui/gtk/gui-gtk-bar.c index 7425401a9..d4853d97d 100644 --- a/src/gui/gtk/gui-gtk-bar.c +++ b/src/gui/gtk/gui-gtk-bar.c @@ -55,6 +55,43 @@ gui_bar_window_search_bar (struct t_gui_window *window, struct t_gui_bar *bar) return NULL; } +/* + * gui_bar_window_get_current_size: get current size of bar window + * return width or height, depending on bar + * position + */ + +int +gui_bar_window_get_current_size (struct t_gui_bar_window *bar_window) +{ + return bar_window->current_size; +} + +/* + * gui_bar_window_set_current_size: set current size of all bar windows for a bar + */ + +void +gui_bar_window_set_current_size (struct t_gui_bar *bar, int size) +{ + struct t_gui_window *ptr_win; + struct t_gui_bar_window *ptr_bar_win; + + if (CONFIG_INTEGER(bar->type) == GUI_BAR_TYPE_ROOT) + bar->bar_window->current_size = (size == 0) ? 1 : size; + else + { + for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window) + { + for (ptr_bar_win = GUI_GTK(ptr_win)->bar_windows; + ptr_bar_win; ptr_bar_win = ptr_bar_win->next_bar_window) + { + ptr_bar_win->current_size = (size == 0) ? 1 : size; + } + } + } +} + /* * gui_bar_window_get_size: get total bar size (window bars) for a position * bar is optional, if not NULL, size is computed -- cgit v1.2.3