From af3c0ca93922eccab25da7e4b3ef6bf109c2ce80 Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Sun, 9 Jul 2000 11:54:25 +0000 Subject: Several contacts list bugfixes. svn path=/trunk/; revision=4008 --- addressbook/gui/component/addressbook.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'addressbook/gui/component/addressbook.c') diff --git a/addressbook/gui/component/addressbook.c b/addressbook/gui/component/addressbook.c index 4929963689..b50f808230 100644 --- a/addressbook/gui/component/addressbook.c +++ b/addressbook/gui/component/addressbook.c @@ -25,6 +25,8 @@ #include #include +#include + #include #include #include @@ -674,7 +676,7 @@ static void allocate_callback(GtkWidget *canvas, GtkAllocation *allocation, gpoi "width", &width, NULL); width = MAX(width, allocation->width); - gnome_canvas_set_scroll_region(GNOME_CANVAS( view->canvas ), 0, 0, width, allocation->height ); + gnome_canvas_set_scroll_region(GNOME_CANVAS( view->canvas ), 0, 0, width - 1, allocation->height - 1); gnome_canvas_item_set( view->rect, "x2", (double) width, "y2", (double) allocation->height, @@ -689,7 +691,7 @@ static void resize(GnomeCanvas *canvas, gpointer data) "width", &width, NULL); width = MAX(width, view->last_alloc.width); - gnome_canvas_set_scroll_region(GNOME_CANVAS(view->canvas), 0, 0, width, view->last_alloc.height ); + gnome_canvas_set_scroll_region(GNOME_CANVAS(view->canvas), 0, 0, width - 1, view->last_alloc.height - 1); gnome_canvas_item_set( view->rect, "x2", (double) width, "y2", (double) view->last_alloc.height, @@ -857,8 +859,7 @@ create_alphabet (AddressbookView *view) static void create_minicard_view (AddressbookView *view, char *initial_query) { - GtkWidget *scrollbar; - GtkWidget *vbox; + GtkWidget *scrollframe; GtkWidget *alphabet; gtk_widget_push_visual (gdk_rgb_get_visual ()); @@ -866,8 +867,6 @@ create_minicard_view (AddressbookView *view, char *initial_query) view->minicard_hbox = gtk_hbox_new(FALSE, 0); - vbox = gtk_vbox_new(FALSE, 0); - view->canvas = e_canvas_new(); view->rect = gnome_canvas_item_new( gnome_canvas_root( GNOME_CANVAS( view->canvas ) ), @@ -894,14 +893,15 @@ create_minicard_view (AddressbookView *view, char *initial_query) 0, 0, 100, 100 ); - gtk_box_pack_start(GTK_BOX(vbox), view->canvas, TRUE, TRUE, 0); - - scrollbar = gtk_hscrollbar_new( - gtk_layout_get_hadjustment(GTK_LAYOUT(view->canvas))); - - gtk_box_pack_start(GTK_BOX(vbox), scrollbar, FALSE, FALSE, 0); - - gtk_box_pack_start(GTK_BOX(view->minicard_hbox), vbox, TRUE, TRUE, 0); + scrollframe = e_scroll_frame_new (gtk_layout_get_hadjustment (GTK_LAYOUT (view->canvas)), + gtk_layout_get_vadjustment (GTK_LAYOUT (view->canvas))); + e_scroll_frame_set_policy (E_SCROLL_FRAME (scrollframe), + GTK_POLICY_AUTOMATIC, + GTK_POLICY_NEVER); + + gtk_container_add (GTK_CONTAINER (scrollframe), view->canvas); + + gtk_box_pack_start(GTK_BOX(view->minicard_hbox), scrollframe, TRUE, TRUE, 0); alphabet = create_alphabet(view); if (alphabet) { -- cgit v1.2.3