Re: [Evolution-hackers] hiding the sidebar



William Jon McCann wrote:
...
Personally, I disable the component buttons altogether. I prefer to invoke the apps separately (a la http://lists.ximian.com/archives/public/evolution-patches/2004-April/005011.html). Since the buttons have other issues like http://bugzilla.ximian.com/show_bug.cgi?id=57783, I'll just ignore them for now.

In case anyone is wondering, I've attached my crude hack for this.

The part in e-sidebar.c is probably worth adding in any case. It prevents a divide by zero error.

Jon
Index: e-shell-window.c
===================================================================
RCS file: /cvs/gnome/evolution/shell/e-shell-window.c,v
retrieving revision 1.21
diff -p -u -r1.21 e-shell-window.c
--- e-shell-window.c	28 Apr 2004 02:02:36 -0000	1.21
+++ e-shell-window.c	28 Apr 2004 19:02:29 -0000
@@ -568,7 +568,7 @@ setup_widgets (EShellWindow *window)
 	priv->sidebar = e_sidebar_new ();
 	g_signal_connect (priv->sidebar, "button_selected",
 			  G_CALLBACK (sidebar_button_selected_callback), window);
-	gtk_paned_pack1 (GTK_PANED (priv->paned), priv->sidebar, FALSE, FALSE);
+	gtk_paned_pack1 (GTK_PANED (priv->paned), priv->sidebar, TRUE, TRUE);
 
 	priv->sidebar_notebook = gtk_notebook_new ();
 	gtk_notebook_set_show_tabs (GTK_NOTEBOOK (priv->sidebar_notebook), FALSE);
@@ -589,7 +589,7 @@ setup_widgets (EShellWindow *window)
 		ComponentView *view = component_view_new (info->id, info->alias, button_id);
 
 		window->priv->component_views = g_slist_prepend (window->priv->component_views, view);
-		e_sidebar_add_button (E_SIDEBAR (priv->sidebar), info->button_label, info->button_icon, button_id);
+		/*e_sidebar_add_button (E_SIDEBAR (priv->sidebar), info->button_label, info->button_icon, button_id);*/
 
 		button_id ++;
 	}
Index: e-sidebar.c
===================================================================
RCS file: /cvs/gnome/evolution/shell/e-sidebar.c,v
retrieving revision 1.7
diff -p -u -r1.7 e-sidebar.c
--- e-sidebar.c	22 Apr 2004 13:53:28 -0000	1.7
+++ e-sidebar.c	28 Apr 2004 19:02:29 -0000
@@ -215,6 +215,9 @@ do_layout_text_buttons (ESidebar *sideba
 		y -= max_btn_height;
 		x = H_PADDING + allocation->x;
 		len = g_slist_length (rows[i]);
+		if (len < 1)
+			continue;
+
 		extra_width = (allocation->width - (len * max_btn_width ) - (len * H_PADDING)) / len;
 		for (p = rows [i]; p != NULL; p = p->next) {
 			GtkAllocation child_allocation;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]