aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@ximian.com>2002-01-09 14:49:52 +0800
committerChris Lahey <clahey@src.gnome.org>2002-01-09 14:49:52 +0800
commiteffefd28156b8ad5aff067f3031fd4b7627a2d5c (patch)
treedd7ff58c9245955565ab1eac46bcd19e0f370f82 /widgets
parente5d02e7ed1e4ba0b007cb130be6f4d268ecc9e92 (diff)
downloadgsoc2013-evolution-effefd28156b8ad5aff067f3031fd4b7627a2d5c.tar.gz
gsoc2013-evolution-effefd28156b8ad5aff067f3031fd4b7627a2d5c.tar.zst
gsoc2013-evolution-effefd28156b8ad5aff067f3031fd4b7627a2d5c.zip
Bumped version number to 0.19.99.0. Bumped GAL_CURRENT. Reset
2002-01-09 Christopher James Lahey <clahey@ximian.com> * configure.in: Bumped version number to 0.19.99.0. Bumped GAL_CURRENT. Reset GAL_REVISION. From gal/e-table/ChangeLog: 2002-01-09 Christopher James Lahey <clahey@ximian.com> * e-table.c, e-table.h (scroll_timeout), e-tree.c (scroll_timeout): Made these handle horizontal scrolling during drags. svn path=/trunk/; revision=15272
Diffstat (limited to 'widgets')
-rw-r--r--widgets/table/e-table.c62
-rw-r--r--widgets/table/e-table.h2
-rw-r--r--widgets/table/e-tree.c66
3 files changed, 87 insertions, 43 deletions
diff --git a/widgets/table/e-table.c b/widgets/table/e-table.c
index 1b0784b6ed..2d37fa45ef 100644
--- a/widgets/table/e-table.c
+++ b/widgets/table/e-table.c
@@ -95,6 +95,13 @@ enum {
ARG_UNIFORM_ROW_HEIGHT,
};
+enum {
+ ET_SCROLL_UP = 1 << 0,
+ ET_SCROLL_DOWN = 1 << 1,
+ ET_SCROLL_LEFT = 1 << 2,
+ ET_SCROLL_RIGHT = 1 << 3
+};
+
static gint et_signals [LAST_SIGNAL] = { 0, };
static void e_table_fill_table (ETable *e_table, ETableModel *model);
@@ -146,7 +153,7 @@ static void et_drag_data_received(GtkWidget *widget,
static gint et_focus (GtkContainer *container, GtkDirectionType direction);
static void scroll_off (ETable *et);
-static void scroll_on (ETable *et, gboolean down);
+static void scroll_on (ETable *et, guint scroll_direction);
static void
et_disconnect_model (ETable *et)
@@ -2421,22 +2428,31 @@ static gboolean
scroll_timeout (gpointer data)
{
ETable *et = data;
- int dy;
- GtkAdjustment *v;
- double value;
+ int dx = 0, dy = 0;
+ GtkAdjustment *h, *v;
+ double hvalue, vvalue;
- if (et->scroll_down)
- dy = 20;
- else
- dy = -20;
+ if (et->scroll_direction & ET_SCROLL_DOWN)
+ dy += 20;
+ if (et->scroll_direction & ET_SCROLL_UP)
+ dy -= 20;
+
+ if (et->scroll_direction & ET_SCROLL_RIGHT)
+ dx += 20;
+ if (et->scroll_direction & ET_SCROLL_LEFT)
+ dx -= 20;
+ h = GTK_LAYOUT(et->table_canvas)->hadjustment;
v = GTK_LAYOUT(et->table_canvas)->vadjustment;
- value = v->value;
+ hvalue = h->value;
+ vvalue = v->value;
+ gtk_adjustment_set_value(h, CLAMP(h->value + dx, h->lower, h->upper - h->page_size));
gtk_adjustment_set_value(v, CLAMP(v->value + dy, v->lower, v->upper - v->page_size));
- if (v->value != value)
+ if (h->value != hvalue ||
+ v->value != vvalue)
do_drag_motion(et,
et->last_drop_context,
et->last_drop_x,
@@ -2448,12 +2464,12 @@ scroll_timeout (gpointer data)
}
static void
-scroll_on (ETable *et, gboolean down)
+scroll_on (ETable *et, guint scroll_direction)
{
- if (et->scroll_idle_id == 0 || down != et->scroll_down) {
+ if (et->scroll_idle_id == 0 || scroll_direction != et->scroll_direction) {
if (et->scroll_idle_id != 0)
g_source_remove (et->scroll_idle_id);
- et->scroll_down = down;
+ et->scroll_direction = scroll_direction;
et->scroll_idle_id = g_timeout_add (100, scroll_timeout, et);
}
}
@@ -2517,6 +2533,7 @@ et_drag_motion(GtkWidget *widget,
ETable *et)
{
gboolean ret_val;
+ guint direction = 0;
et->last_drop_x = x;
et->last_drop_y = y;
@@ -2534,14 +2551,19 @@ et_drag_motion(GtkWidget *widget,
x -= widget->allocation.x;
y -= widget->allocation.y;
- if (y < 20 || y > widget->allocation.height - 20) {
- if (y < 20)
- scroll_on (et, FALSE);
- else
- scroll_on (et, TRUE);
- } else {
+ if (y < 20)
+ direction |= ET_SCROLL_UP;
+ if (y > widget->allocation.height - 20)
+ direction |= ET_SCROLL_DOWN;
+ if (x < 20)
+ direction |= ET_SCROLL_LEFT;
+ if (x > widget->allocation.width - 20)
+ direction |= ET_SCROLL_RIGHT;
+
+ if (direction != 0)
+ scroll_on (et, direction);
+ else
scroll_off (et);
- }
return ret_val;
}
diff --git a/widgets/table/e-table.h b/widgets/table/e-table.h
index 9900821eb7..30c2887cd0 100644
--- a/widgets/table/e-table.h
+++ b/widgets/table/e-table.h
@@ -108,7 +108,7 @@ typedef struct {
guint is_grouped : 1;
- guint scroll_down : 1;
+ guint scroll_direction : 4;
guint do_drag : 1;
diff --git a/widgets/table/e-tree.c b/widgets/table/e-tree.c
index db68daff11..4e1154f44f 100644
--- a/widgets/table/e-tree.c
+++ b/widgets/table/e-tree.c
@@ -99,6 +99,13 @@ enum {
ARG_UNIFORM_ROW_HEIGHT,
};
+enum {
+ ET_SCROLL_UP = 1 << 0,
+ ET_SCROLL_DOWN = 1 << 1,
+ ET_SCROLL_LEFT = 1 << 2,
+ ET_SCROLL_RIGHT = 1 << 3
+};
+
struct ETreePriv {
ETreeModel *model;
ETreeSorted *sorted;
@@ -142,7 +149,7 @@ struct ETreePriv {
guint horizontal_scrolling : 1;
- guint scroll_down : 1;
+ guint scroll_direction : 4;
guint do_drag : 1;
@@ -219,7 +226,7 @@ static void et_drag_data_received(GtkWidget *widget,
static gint et_focus (GtkContainer *container, GtkDirectionType direction);
static void scroll_off (ETree *et);
-static void scroll_on (ETree *et, gboolean down);
+static void scroll_on (ETree *et, guint scroll_direction);
static void hover_off (ETree *et);
static void hover_on (ETree *et, int x, int y);
@@ -2294,22 +2301,31 @@ static gboolean
scroll_timeout (gpointer data)
{
ETree *et = data;
- int dy;
- GtkAdjustment *v;
- double value;
+ int dx = 0, dy = 0;
+ GtkAdjustment *v, *h;
+ double vvalue, hvalue;
- if (et->priv->scroll_down)
- dy = 20;
- else
- dy = -20;
+ if (et->priv->scroll_direction & ET_SCROLL_DOWN)
+ dy += 20;
+ if (et->priv->scroll_direction & ET_SCROLL_UP)
+ dy -= 20;
+
+ if (et->priv->scroll_direction & ET_SCROLL_RIGHT)
+ dx += 20;
+ if (et->priv->scroll_direction & ET_SCROLL_LEFT)
+ dx -= 20;
+ h = GTK_LAYOUT(et->priv->table_canvas)->hadjustment;
v = GTK_LAYOUT(et->priv->table_canvas)->vadjustment;
- value = v->value;
+ hvalue = h->value;
+ vvalue = v->value;
+ gtk_adjustment_set_value(h, CLAMP(h->value + dx, h->lower, h->upper - h->page_size));
gtk_adjustment_set_value(v, CLAMP(v->value + dy, v->lower, v->upper - v->page_size));
- if (v->value != value)
+ if (h->value != hvalue ||
+ v->value != vvalue)
do_drag_motion(et,
et->priv->last_drop_context,
et->priv->last_drop_x,
@@ -2321,12 +2337,12 @@ scroll_timeout (gpointer data)
}
static void
-scroll_on (ETree *et, gboolean down)
+scroll_on (ETree *et, guint scroll_direction)
{
- if (et->priv->scroll_idle_id == 0 || down != et->priv->scroll_down) {
+ if (et->priv->scroll_idle_id == 0 || scroll_direction != et->priv->scroll_direction) {
if (et->priv->scroll_idle_id != 0)
g_source_remove (et->priv->scroll_idle_id);
- et->priv->scroll_down = down;
+ et->priv->scroll_direction = scroll_direction;
et->priv->scroll_idle_id = g_timeout_add (100, scroll_timeout, et);
}
}
@@ -2339,7 +2355,7 @@ scroll_off (ETree *et)
et->priv->scroll_idle_id = 0;
}
}
-
+
static gboolean
hover_timeout (gpointer data)
{
@@ -2478,6 +2494,7 @@ et_drag_motion(GtkWidget *widget,
ETree *et)
{
int ret_val;
+ guint direction = 0;
et->priv->last_drop_x = x;
et->priv->last_drop_y = y;
@@ -2503,14 +2520,19 @@ et_drag_motion(GtkWidget *widget,
x -= widget->allocation.x;
y -= widget->allocation.y;
- if (y < 20 || y > widget->allocation.height - 20) {
- if (y < 20)
- scroll_on (et, FALSE);
- else
- scroll_on (et, TRUE);
- } else {
+ if (y < 20)
+ direction |= ET_SCROLL_UP;
+ if (y > widget->allocation.height - 20)
+ direction |= ET_SCROLL_DOWN;
+ if (x < 20)
+ direction |= ET_SCROLL_LEFT;
+ if (x > widget->allocation.width - 20)
+ direction |= ET_SCROLL_RIGHT;
+
+ if (direction != 0)
+ scroll_on (et, direction);
+ else
scroll_off (et);
- }
return ret_val;
}
BROKEN: does not configurepav2008-04-171-0/+2 * - Fix build with gcc 4rafan2008-04-041-0/+14 * - Update to 0.6.0pav2008-03-275-134/+325 * - Add missing dependensmiwi2008-03-271-1/+2 * - Upgrade to 1.8.0.lippe2008-03-264-12/+19 * - Remove USE_XLIB/USE_X_PREFIX/USE_XPM in favor of USE_XORGmiwi2008-03-241-1/+0 * - Remove USE_XLIB/USE_X_PREFIX/USE_XPM in favor of USE_XORGmiwi2008-03-231-1/+0 * Update to KDE 3.5.8lofi2007-10-304-8/+62 * Presenting GNOME 2.20.1 and all related works for FreeBSD. The officialmarcus2007-10-253-13/+3 * Remove always-false/true conditions based on OSVERSION 500000edwin2007-10-041-3/+0 * - Update to 0.1.1.trasz2007-09-083-6/+7 * - Update to 2.3.0miwi2007-07-273-16/+4 * - Set --mandir and --infodir in CONFIGURE_ARGS if the configure scriptrafan2007-07-231-1/+0 * Update to KDE 3.5.7 / KOffice 1.6.3lofi2007-07-0412-25/+272 * - Update to 1.7itetcu2007-06-113-20/+11 * Update to 1.7.1itetcu2007-06-112-4/+4 * - Welcome X.org 7.2 \o/.flz2007-05-2011-5/+10 * - Update to 20070303.trasz2007-04-206-35/+125 * - When devel/libexecinfo presents, configure script detects but does notrafan2007-04-172-4/+10 * - Fix after objformat removalpav2007-03-281-7/+4 * Update to KDE 3.5.6 / KOffice 1.6.2lofi2007-03-1413-21/+512 * - Update 1.7 rc3rafan2007-03-122-6/+6 * - Update to 1.7 RC2rafan2007-02-253-18/+34 * - Update to 0.5.0rafan2007-02-256-371/+827 * - Update to 1.7.0rafan2007-02-244-37/+9 * - Update to 2.1.0pav2007-02-082-4/+4 * Update to 2.0.4rc2itetcu2006-12-282-5/+4 * Update to KDE 3.5.5 / KOffice 1.6.1lofi2006-12-2013-18/+507 * Update the ftp/curl port to 7.16.0.roam2006-12-131-1/+2 * - Update to 6.0.20061121miwi2006-12-133-4/+5 * - Respect X11BASErafan2006-12-031-0/+3 * - Add OPTIONS to enable optional modules for: spellchecker, esound, arts, tabspav2006-11-204-4/+95 * Update master site.lawrance2006-11-051-2/+2 * Chase the GNOME X11BASE to LOCALBASE move, and fix the build with themarcus2006-10-142-6/+9 * KDE 3.5.4 / KOffice 1.5.2lofi2006-09-1310-18/+480 * - Update to 2.2.9pav2006-09-079-177/+34 * Set correct dependency on libgadu.itetcu2006-07-291-1/+2 * - Add conflict with older versions of ekg to prevent overwrite of libgadu.so.itetcu2006-07-292-6/+30 * Make polish/ekg not install libgadu.so and use the one provided withitetcu2006-07-293-18/+21 * All dictionaries can be installed separately:thierry2006-07-154-7/+15 * - convert to OPTIONSitetcu2006-07-132-94/+25 * Update MASTER_SITES and WWWitetcu2006-06-142-2/+2 * Update to 20060519miwi2006-06-073-77/+88 * Update to KDE 3.5.3lofi2006-06-064-22/+146 * - Rename portspav2006-05-281-1/+1 * Update to KOffice 1.5.1lofi2006-05-276-12/+12 * Remove USE_REINPLACE from all categories starting with Pedwin2006-05-134-5/+0 * Update to KOffice 1.5.0lofi2006-04-299-15/+24 * - Fix broken WWWmnag2006-04-291-1/+1 * [maint update] polish/ekg2 fix 4.x compilation and upgradeedwin2006-04-052-4/+5 * - Mark broken on 4.Xpav2006-04-041-1/+7 * Text-based Gadu-Gadu (and other) client for Unix-like systems.pav2006-04-025-0/+150 * Disable OpenSSL support. This is not a big deal since gadugadu serversmarcus2006-04-021-1/+2 * Update to KDE 3.5.2lofi2006-03-314-128/+192 * Bump PORTREVISION on glib12/gtk12 consumer ports to ease the upgrade path.ade2006-03-071-1/+1 * Conversion to a single libtool environment.ade2006-02-232-19/+19 * Update to KDE 3.5.1.lofi2006-02-014-18/+162 * BROKEN: Needs to be converted to use OPTIONS. The home-brewed configurekris2006-01-281-0/+2 * SHA256ifyedwin2006-01-247-0/+7 * Replace ugly "@unexec rmdir %D... 2>/dev/null || true" with @dirrmtryedwin2006-01-222-15/+15 * A library used by many Instant Messangers that can communicate using thepav2006-01-155-0/+43 * Update to KDE 3.5.0lofi2006-01-094-110/+152 * Chase the dbus shared lib version.marcus2006-01-011-1/+1 * - Update to version 0.4.3az2005-12-152-4/+4 * Remove expired ports.lawrance2005-12-157-136/+0 * - Respect X11BASE\LOCALBASEaz2005-12-062-59/+71 * - Change mainter email addressaz2005-11-263-2/+3 * - Change maintainer email address.az2005-11-263-4/+5 * - Add SHA256pav2005-11-262-0/+2 * - Add SHA256sem2005-11-181-0/+1 * Mass-conversion to the USE_AUTOTOOLS New World Order. The code presentade2005-11-151-1/+1 * - Update to 1.6pav2005-11-122-7/+7 * - Update to 20051022pav2005-11-103-16/+22 * - Change second category to be net-impav2005-11-104-4/+4 * Move instant messaging related ports to newly created net-im category:pav2005-11-091-1/+1 * Update to KDE 3.4.3 / KOffice 1.4.2lofi2005-11-0513-16/+156 * Bump PORTREVISION to chase the glib20 shared library update.marcus2005-11-052-1/+2 * Respect LOCALBASE and X11BASE.lawrance2005-11-011-0/+2 * Remove all the secondary port of editors/ooodict-allmaho2005-11-012-24/+0 * BROKEN: Size mismatchkris2005-10-291-0/+2 * Add missing patch filesedwin2005-10-232-0/+68 * [MAINTAINER] polish/pl-kadu: update to 0.4.2edwin2005-10-235-135/+11 * - Update to 2.2.8pav2005-10-089-92/+215 * Add USE_OPENSSL and a simple post-patch to fix build on 4.xlawrance2005-09-141-2/+8 * Fix pkg-plistlawrance2005-09-081-0/+2 * - Update to 0.4.1lawrance2005-09-055-442/+625 * Mark deprecated (expires in 3 months). This version of sms is outdatedlawrance2005-08-301-0/+3 * Fix index build by moving openoffice.org-1.1 ports.maho2005-08-291-1/+1 * - Fix dependency on pcre++lawrance2005-08-081-3/+4 * Update to KDE 3.4.2 / KOffice 1.4.1lofi2005-08-0113-88/+293 * - Update to 1.6r3pav2005-07-202-4/+4 * - Update to 1.6r2pav2005-07-172-5/+5 * Update to KOffice 1.4.0a.lofi2005-07-069-87/+24 * Remove openoffice.org localized ports as I announced:maho2005-06-293-33/+0 * Update to KDE 3.4.1lofi2005-06-264-10/+18 * Directory share/pixmaps is now included in mtreelesi2005-06-151-1/+0 * - Unbreak and general updatepav2005-06-061-5/+3 * - update polish/ekg to version 1.6rc1leeym2005-04-163-24/+23 * - Update to to 2.2.5 (thanks to Matthew Luckie <mjl@luckie.org.nz> for testin...flz2005-04-119-204/+52 * - Update to 0.0.20050220pav2005-04-093-15/+22 * - Update to 2.0.3pav2005-04-043-4/+5 * Update to KDE 3.4lofi2005-03-214-52/+130 * Bump PORTREVISION to chase the glib20 shared lib version change.marcus2005-03-122-1/+2 * - install kde/gnome .desktop files without detecting kde/gnome present atpav2005-01-302-13/+10 * - Update to 2.2.4pav2005-01-2812-239/+297 * Package contains plenty of funny Polish fortunes.pav2005-01-285-0/+187 * Fix packaging (PORTREV-bump so the package gets better KDE support)vs2005-01-262-9/+11 * Fix plist.krion2005-01-151-0/+2 * Add i18nized doc subdirs to kdehier and adjust i18n port plists accordingly.lofi2004-12-233-3/+0 * This port is scheduled to be removed on 2005-02-18 if it is stillkris2004-12-191-0/+2 * Fix kde3-i18n ports.lofi2004-12-162-4/+4 * Update to KDE 3.3.2lofi2004-12-1415-39/+26 * - Define LATEST_LINK as sms2pav2004-12-021-0/+2 * - Update to 20041113sergei2004-11-232-5/+6 * Update pkg-descrarved2004-11-111-1/+1 * - Update master site (fix fetching)pav2004-11-101-1/+1 * - Update to 2.0.2pav2004-11-102-4/+6 * Update to KDE 3.3.1lofi2004-11-0810-13/+17 * Bump PORTREVISIONS for all ports that depend on atk or pango to ease in themarcus2004-11-082-0/+2 * Add sap, console based free polish to english dictionaryarved2004-11-055-0/+37 * - Update to 2.0.1pav2004-11-012-4/+4 * - After repocopy from polish/sms, update to 2.0.0pav2004-11-017-113/+20 * I, for one, welcome our new polish php_doc slaveport!edwin2004-10-212-0/+14 * - Update to 1.9.2mpav2004-09-0210-40/+106 * - Resign on maintainership of my FreeBSD portspav2004-09-023-3/+3 * Update to KDE 3.3lofi2004-08-319-23/+119 * Chase libaspell to aspell.16.thierry2004-08-291-2/+2 * Factor out all but one of the build switches of the KDE main module portslofi2004-08-116-9/+9 * Fix build with gcc-3.4krion2004-08-041-0/+2 * - Update to 2.0.3pav2004-07-225-3/+164 * - OpenSSL is special on FreeBSD, it's always there, and is not visiblepav2004-07-222-0/+11 * Apply a big libtool patch to allow porters to use the libtool installed bymarcus2004-07-101-1/+1 * - Update to 1.5pav2004-07-062-4/+4 * - Update to 0.3.9pav2004-07-034-10/+35 * Back out accidental modification.lofi2004-06-101-2/+1 * Update to version 3.2.3lofi2004-06-105-4/+19 * BROKEN: Checksum mismatchkris2004-05-211-0/+2 * - Update to 2.0.2pav2004-05-114-18/+11 * - Update to ekg-1.4.20040505pav2004-05-102-6/+13 * Oops. Forgot the language categories.lofi2004-05-079-9/+15 * Update to latest snapshot, to fix build problems on STABLEarved2004-05-033-11/+18 * Update to 0.3.8arved2004-04-294-58/+142 * Update to KDE 3.2.2lofi2004-04-204-40/+14 * Fix LATEST_LINK conflictsmaho2004-04-121-0/+1 * Chase the glib20 update, and bump all affected ports' PORTREVISIONs.marcus2004-04-051-0/+1 * Remove category pkg/COMMENT files in favour of a COMMENT variable in thekris2004-04-022-1/+3 * - Update to 2.0pre8pav2004-04-025-36/+15 * SIZEify (maintainer timeout)trevor2004-03-315-0/+5 * Add tleenx2, a Gtk2 client for IM network tlen.plpav2004-03-305-0/+107 * Reorder those filesmat2004-03-211-2/+2 * Whoa there, boy, that's a mighty big commit y'all have there...ade2004-03-141-1/+1