diff options
-rw-r--r-- | shell/ChangeLog | 6 | ||||
-rw-r--r-- | shell/e-sidebar.c | 11 |
2 files changed, 11 insertions, 6 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog index 03c0f9df39..abbfbddcab 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,3 +1,9 @@ +2004-06-04 JP Rosevear <jpr@novell.com> + + Fixes #59361 + + * e-sidebar.c (layout_buttons): handle 0 and 1 buttons properly + 2004-06-01 William Jon McCann <mccann@jhu.edu> * e-shell-window-commands.c (e_shell_window_commands_setup): diff --git a/shell/e-sidebar.c b/shell/e-sidebar.c index 40a45b5581..e412736b0a 100644 --- a/shell/e-sidebar.c +++ b/shell/e-sidebar.c @@ -167,10 +167,10 @@ layout_buttons (ESidebar *sidebar) int x, y; int i; - /* (Yes, this code calls gtk_widget_size_request() an ungodly - * number of times, but it's not like we care about - * performance here, and this makes the code simpler.) - */ + y = allocation->y + allocation->height - V_PADDING - 1; + + if (num_btns == 0) + return y; /* Figure out the max width and height */ for (p = sidebar->priv->buttons; p != NULL; p = p->next) { @@ -202,7 +202,7 @@ layout_buttons (ESidebar *sidebar) rows [0] = g_slist_append (rows [0], button->button_widget); p = sidebar->priv->buttons->next; - row_number = 1; + row_number = p ? 1 : 0; } else { p = sidebar->priv->buttons; row_number = 0; @@ -220,7 +220,6 @@ layout_buttons (ESidebar *sidebar) row_last = row_number; /* Layout the buttons. */ - y = allocation->y + allocation->height - V_PADDING - 1; for (i = row_last; i >= 0; i --) { int len, extra_width; |