aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/e-reflow
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@helixcode.com>2000-05-31 01:06:11 +0800
committerChris Lahey <clahey@src.gnome.org>2000-05-31 01:06:11 +0800
commit936611683a969d2a93bde1c41d048881e860edea (patch)
tree4d30ce4db8310ffc3fd0dfbbd6c92405b0856aa6 /widgets/e-reflow
parent016b2a545c3b3f79132f0b2fb333fbf830203eb5 (diff)
downloadgsoc2013-evolution-936611683a969d2a93bde1c41d048881e860edea.tar
gsoc2013-evolution-936611683a969d2a93bde1c41d048881e860edea.tar.gz
gsoc2013-evolution-936611683a969d2a93bde1c41d048881e860edea.tar.bz2
gsoc2013-evolution-936611683a969d2a93bde1c41d048881e860edea.tar.lz
gsoc2013-evolution-936611683a969d2a93bde1c41d048881e860edea.tar.xz
gsoc2013-evolution-936611683a969d2a93bde1c41d048881e860edea.tar.zst
gsoc2013-evolution-936611683a969d2a93bde1c41d048881e860edea.zip
Added alphabet.glade and alphabet.glade.h.
2000-05-30 Christopher James Lahey <clahey@helixcode.com> * gui/component/Makefile.am: Added alphabet.glade and alphabet.glade.h. * gui/component/addressbook.c, gui/component/alphabet.glade, gui/component/alphabet.glade.h: Added an alphabet bar. * gui/minicard/e-minicard-view.c, gui/minicard/e-minicard-view.h, gui/minicard/e-reflow-sorted.c, gui/minicard/e-reflow-sorted.h: Added the ability to just to a particular spot in the reflow. svn path=/trunk/; revision=3283
Diffstat (limited to 'widgets/e-reflow')
-rw-r--r--widgets/e-reflow/e-reflow-sorted.c33
-rw-r--r--widgets/e-reflow/e-reflow-sorted.h1
2 files changed, 34 insertions, 0 deletions
diff --git a/widgets/e-reflow/e-reflow-sorted.c b/widgets/e-reflow/e-reflow-sorted.c
index 7205785c6c..c899ccb9a7 100644
--- a/widgets/e-reflow/e-reflow-sorted.c
+++ b/widgets/e-reflow/e-reflow-sorted.c
@@ -34,6 +34,10 @@ static void e_reflow_sorted_set_arg (GtkObject *o, GtkArg *arg, guint arg_id);
static void e_reflow_sorted_get_arg (GtkObject *object, GtkArg *arg, guint arg_id);
static void e_reflow_sorted_add_item(EReflow *e_reflow, GnomeCanvasItem *item);
+#define E_REFLOW_DIVIDER_WIDTH 2
+#define E_REFLOW_BORDER_WIDTH 7
+#define E_REFLOW_FULL_GUTTER (E_REFLOW_DIVIDER_WIDTH + E_REFLOW_BORDER_WIDTH * 2)
+
static EReflowClass *parent_class = NULL;
/* The arguments we take */
@@ -234,3 +238,32 @@ e_reflow_sorted_add_item(EReflow *reflow, GnomeCanvasItem *item)
}
e_reflow_post_add_item(reflow, item);
}
+
+void e_reflow_sorted_jump (EReflowSorted *sorted,
+ GCompareFunc compare_func,
+ void *value)
+{
+ int columns = 0;
+ EReflow *reflow = E_REFLOW(sorted);
+ GList *list;
+
+ for (list = reflow->columns; list; list = g_list_next(list)) {
+ if (compare_func(((GList *)list->data)->data, value) >= 0) {
+ GList *last = list->prev;
+ GtkAdjustment *adjustment;
+ if (last) {
+ GList *walk;
+ for (walk = last->data; walk != list->data; walk = g_list_next(walk)) {
+ if (compare_func(walk->data, value) >= 0) {
+ columns --;
+ break;
+ }
+ }
+ }
+ adjustment = gtk_layout_get_hadjustment(GTK_LAYOUT(GNOME_CANVAS_ITEM(sorted)->canvas));
+ gtk_adjustment_set_value(adjustment, (reflow->column_width + E_REFLOW_FULL_GUTTER) * columns);
+ return;
+ }
+ columns ++;
+ }
+}
diff --git a/widgets/e-reflow/e-reflow-sorted.h b/widgets/e-reflow/e-reflow-sorted.h
index d9b4acc747..7adfa2c045 100644
--- a/widgets/e-reflow/e-reflow-sorted.h
+++ b/widgets/e-reflow/e-reflow-sorted.h
@@ -81,6 +81,7 @@ void e_reflow_sorted_replace_item (EReflowSorted *sorted, GnomeCanvasI
void e_reflow_sorted_reorder_item (EReflowSorted *e_reflow_sorted, const gchar *id);
GnomeCanvasItem *e_reflow_sorted_get_item (EReflowSorted *e_reflow_sorted, const gchar *id);
GtkType e_reflow_sorted_get_type (void);
+void e_reflow_sorted_jump (EReflowSorted *sorted, GCompareFunc compare_func, void *value);
#ifdef __cplusplus
}