aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@src.gnome.org>2000-07-09 19:54:25 +0800
committerAnders Carlsson <andersca@src.gnome.org>2000-07-09 19:54:25 +0800
commitaf3c0ca93922eccab25da7e4b3ef6bf109c2ce80 (patch)
treec696f940f93e64382d64d0b77f267f92eaf6c421 /addressbook
parentabd6ce3b53f239441f5a655a362d057e16622b62 (diff)
downloadgsoc2013-evolution-af3c0ca93922eccab25da7e4b3ef6bf109c2ce80.tar
gsoc2013-evolution-af3c0ca93922eccab25da7e4b3ef6bf109c2ce80.tar.gz
gsoc2013-evolution-af3c0ca93922eccab25da7e4b3ef6bf109c2ce80.tar.bz2
gsoc2013-evolution-af3c0ca93922eccab25da7e4b3ef6bf109c2ce80.tar.lz
gsoc2013-evolution-af3c0ca93922eccab25da7e4b3ef6bf109c2ce80.tar.xz
gsoc2013-evolution-af3c0ca93922eccab25da7e4b3ef6bf109c2ce80.tar.zst
gsoc2013-evolution-af3c0ca93922eccab25da7e4b3ef6bf109c2ce80.zip
Several contacts list bugfixes.
svn path=/trunk/; revision=4008
Diffstat (limited to 'addressbook')
-rw-r--r--addressbook/ChangeLog17
-rw-r--r--addressbook/gui/component/Makefile.am1
-rw-r--r--addressbook/gui/component/addressbook.c28
-rw-r--r--addressbook/gui/minicard/Makefile.am1
-rw-r--r--addressbook/gui/minicard/e-reflow.c23
-rw-r--r--addressbook/gui/minicard/test-reflow.c21
-rw-r--r--addressbook/gui/widgets/Makefile.am1
-rw-r--r--addressbook/gui/widgets/test-reflow.c21
8 files changed, 75 insertions, 38 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index 300a089533..8a14d49470 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,3 +1,20 @@
+2000-07-09 Anders Carlsson <andersca@gnu.org>
+
+ * gui/minicard/test-reflow.c (allocate_callback): Fix off by one bug with
+ scroll region setting.
+ (resize): Likewise.
+ (main): Put the contacts list in an EScrolledFrame instead of using a
+ separate GtkScrollbar.
+
+ * gui/minicard/e-reflow.c (e_reflow_event): Don't change mouse cursor and
+ don't allow drags on dividers that aren't visible.
+
+ * gui/component/addressbook.c (allocate_callback): Fix off by one bug with
+ scroll region setting.
+ (resize): Likewise.
+ (create_minicard_view): Put the contacts list in an EScrolledFrame instead of
+ using a separate GtkScrollbar.
+
2000-07-09 Christopher James Lahey <clahey@helixcode.com>
* gui/component/addressbook.c: Removed unused do_nothing_cb
diff --git a/addressbook/gui/component/Makefile.am b/addressbook/gui/component/Makefile.am
index 389f51f9ba..fd569fa9bb 100644
--- a/addressbook/gui/component/Makefile.am
+++ b/addressbook/gui/component/Makefile.am
@@ -13,6 +13,7 @@ INCLUDES = \
-I$(top_builddir)/shell \
-I$(top_srcdir)/widgets/e-text \
-I$(top_srcdir)/widgets/e-table \
+ -I$(top_srcdir)/widgets/misc \
-I$(top_srcdir)/addressbook/gui/minicard \
-I$(top_srcdir)/addressbook/contact-editor \
-I$(top_srcdir)/addressbook/backend \
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 <e-table.h>
#include <e-cell-text.h>
+#include <e-scroll-frame.h>
+
#include <e-addressbook-model.h>
#include <select-names/e-select-names.h>
#include <select-names/e-select-names-manager.h>
@@ -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) {
diff --git a/addressbook/gui/minicard/Makefile.am b/addressbook/gui/minicard/Makefile.am
index 0eb7946ac5..a20edc1c08 100644
--- a/addressbook/gui/minicard/Makefile.am
+++ b/addressbook/gui/minicard/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/minicard/e-reflow.c b/addressbook/gui/minicard/e-reflow.c
index ba7bf36c4d..0e9c8b92b1 100644
--- a/addressbook/gui/minicard/e-reflow.c
+++ b/addressbook/gui/minicard/e-reflow.c
@@ -329,11 +329,14 @@ e_reflow_event (GnomeCanvasItem *item, GdkEvent *event)
case 1:
{
GdkEventButton *button = (GdkEventButton *) event;
- double n_x;
+ double n_x, max_x;
n_x = button->x;
n_x += E_REFLOW_BORDER_WIDTH + E_REFLOW_DIVIDER_WIDTH;
n_x = fmod(n_x,(e_reflow->column_width + E_REFLOW_FULL_GUTTER));
- if ( button->y >= E_REFLOW_BORDER_WIDTH && button->y <= e_reflow->height - E_REFLOW_BORDER_WIDTH && n_x < E_REFLOW_FULL_GUTTER ) {
+
+ max_x = E_REFLOW_BORDER_WIDTH;
+ max_x += (e_reflow->column_width + E_REFLOW_FULL_GUTTER) * e_reflow->column_count;
+ if ( button->y >= E_REFLOW_BORDER_WIDTH && button->y <= e_reflow->height - E_REFLOW_BORDER_WIDTH && n_x < E_REFLOW_FULL_GUTTER && max_x > button->x ) {
e_reflow->which_column_dragged = e_reflow_pick_line(e_reflow, button->x);
e_reflow->start_x = e_reflow->which_column_dragged * (e_reflow->column_width + E_REFLOW_FULL_GUTTER) - E_REFLOW_DIVIDER_WIDTH / 2;
e_reflow->temp_column_width = e_reflow->column_width;
@@ -412,11 +415,16 @@ e_reflow_event (GnomeCanvasItem *item, GdkEvent *event)
return TRUE;
} else {
GdkEventMotion *motion = (GdkEventMotion *) event;
- double n_x;
+ double n_x, max_x;
+
n_x = motion->x;
n_x += E_REFLOW_BORDER_WIDTH + E_REFLOW_DIVIDER_WIDTH;
n_x = fmod(n_x,(e_reflow->column_width + E_REFLOW_FULL_GUTTER));
- if ( motion->y >= E_REFLOW_BORDER_WIDTH && motion->y <= e_reflow->height - E_REFLOW_BORDER_WIDTH && n_x < E_REFLOW_FULL_GUTTER ) {
+
+ max_x = E_REFLOW_BORDER_WIDTH;
+ max_x += (e_reflow->column_width + E_REFLOW_FULL_GUTTER) * e_reflow->column_count;
+
+ if ( motion->y >= E_REFLOW_BORDER_WIDTH && motion->y <= e_reflow->height - E_REFLOW_BORDER_WIDTH && n_x < E_REFLOW_FULL_GUTTER && max_x > motion->x) {
if ( e_reflow->default_cursor_shown ) {
gdk_window_set_cursor(GTK_WIDGET(item->canvas)->window, e_reflow->arrow_cursor);
e_reflow->default_cursor_shown = FALSE;
@@ -432,11 +440,14 @@ e_reflow_event (GnomeCanvasItem *item, GdkEvent *event)
case GDK_ENTER_NOTIFY:
if (!e_reflow->column_drag) {
GdkEventCrossing *crossing = (GdkEventCrossing *) event;
- double n_x;
+ double n_x, max_x;
n_x = crossing->x;
n_x += E_REFLOW_BORDER_WIDTH + E_REFLOW_DIVIDER_WIDTH;
n_x = fmod(n_x,(e_reflow->column_width + E_REFLOW_FULL_GUTTER));
- if ( crossing->y >= E_REFLOW_BORDER_WIDTH && crossing->y <= e_reflow->height - E_REFLOW_BORDER_WIDTH && n_x < E_REFLOW_FULL_GUTTER ) {
+
+ max_x = E_REFLOW_BORDER_WIDTH;
+ max_x += (e_reflow->column_width + E_REFLOW_FULL_GUTTER) * e_reflow->column_count;
+ if ( crossing->y >= E_REFLOW_BORDER_WIDTH && crossing->y <= e_reflow->height - E_REFLOW_BORDER_WIDTH && n_x < E_REFLOW_FULL_GUTTER && max_x > crossing->x) {
if ( e_reflow->default_cursor_shown ) {
gdk_window_set_cursor(GTK_WIDGET(item->canvas)->window, e_reflow->arrow_cursor);
e_reflow->default_cursor_shown = FALSE;
diff --git a/addressbook/gui/minicard/test-reflow.c b/addressbook/gui/minicard/test-reflow.c
index dacaeb055c..8013c428d5 100644
--- a/addressbook/gui/minicard/test-reflow.c
+++ b/addressbook/gui/minicard/test-reflow.c
@@ -51,6 +51,7 @@
#include <e-util/e-canvas.h>
#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",
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 <e-util/e-canvas.h>
#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",