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/widgets/Makefile.am | 1 + addressbook/gui/widgets/test-reflow.c | 21 ++++++++++++--------- 2 files changed, 13 insertions(+), 9 deletions(-) (limited to 'addressbook/gui/widgets') diff --git a/addressbook/gui/widgets/Makefile.am b/addressbook/gui/widgets/Makefile.am index 0eb7946ac5..a20edc1c08 100644 --- a/addressbook/gui/widgets/Makefile.am +++ b/addressbook/gui/widgets/Makefile.am @@ -5,6 +5,7 @@ INCLUDES = \ -I$(top_builddir)/addressbook/backend \ -I$(top_srcdir)/addressbook/contact-editor \ -I$(top_srcdir)/widgets/e-text \ + -I$(top_srcdir)/widgets/misc \ $(BONOBO_GNOME_CFLAGS) noinst_LIBRARIES = \ diff --git a/addressbook/gui/widgets/test-reflow.c b/addressbook/gui/widgets/test-reflow.c index dacaeb055c..8013c428d5 100644 --- a/addressbook/gui/widgets/test-reflow.c +++ b/addressbook/gui/widgets/test-reflow.c @@ -51,6 +51,7 @@ #include #include "e-reflow.h" #include "e-minicard.h" +#include "e-scroll-frame.h" /* This is a horrible thing to do, but it is just a test. */ GnomeCanvasItem *reflow; @@ -76,7 +77,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( canvas ), 0, 0, width, allocation->height ); + gnome_canvas_set_scroll_region(GNOME_CANVAS( canvas ), 0, 0, width - 1, allocation->height - 1); gnome_canvas_item_set( rect, "x2", (double) width, "y2", (double) allocation->height, @@ -90,7 +91,7 @@ static void resize(GnomeCanvas *canvas, gpointer data) "width", &width, NULL); width = MAX(width, last_alloc.width); - gnome_canvas_set_scroll_region(canvas , 0, 0, width, last_alloc.height ); + gnome_canvas_set_scroll_region(canvas , 0, 0, width - 1, last_alloc.height - 1); gnome_canvas_item_set( rect, "x2", (double) width, "y2", (double) last_alloc.height, @@ -122,7 +123,7 @@ int main( int argc, char *argv[] ) GtkWidget *app; GtkWidget *canvas; GtkWidget *vbox; - GtkWidget *scrollbar; + GtkWidget *scrollframe; int i; /* bindtextdomain (PACKAGE, GNOMELOCALEDIR); @@ -164,13 +165,15 @@ int main( int argc, char *argv[] ) 0, 0, 100, 100 ); - gtk_box_pack_start(GTK_BOX(vbox), canvas, TRUE, TRUE, 0); - - scrollbar = gtk_hscrollbar_new(gtk_layout_get_hadjustment(GTK_LAYOUT(canvas))); - - gtk_box_pack_start(GTK_BOX(vbox), scrollbar, FALSE, FALSE, 0); + scrollframe = e_scroll_frame_new (gtk_layout_get_hadjustment(GTK_LAYOUT(canvas)), + gtk_layout_get_vadjustment(GTK_LAYOUT(canvas))); + e_scroll_frame_set_policy (E_SCROLL_FRAME (scrollframe), + GTK_POLICY_AUTOMATIC, + GTK_POLICY_NEVER); + + gtk_container_add (GTK_CONTAINER (scrollframe), canvas); - gnome_app_set_contents( GNOME_APP( app ), vbox ); + gnome_app_set_contents( GNOME_APP( app ), scrollframe ); /* Connect the signals */ gtk_signal_connect( GTK_OBJECT( app ), "destroy", -- cgit v1.2.3