aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-10-28 16:10:30 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-10-28 20:30:27 +0800
commit047aefcdfb7a8f19d6cb569375601e81cae30a38 (patch)
tree50225ddd19d359ae0e6a441d90879d04b67f76e3 /libempathy-gtk
parent7fc61f47a6133047135b01190ad3dc8e9eed4489 (diff)
downloadgsoc2013-empathy-047aefcdfb7a8f19d6cb569375601e81cae30a38.tar
gsoc2013-empathy-047aefcdfb7a8f19d6cb569375601e81cae30a38.tar.gz
gsoc2013-empathy-047aefcdfb7a8f19d6cb569375601e81cae30a38.tar.bz2
gsoc2013-empathy-047aefcdfb7a8f19d6cb569375601e81cae30a38.tar.lz
gsoc2013-empathy-047aefcdfb7a8f19d6cb569375601e81cae30a38.tar.xz
gsoc2013-empathy-047aefcdfb7a8f19d6cb569375601e81cae30a38.tar.zst
gsoc2013-empathy-047aefcdfb7a8f19d6cb569375601e81cae30a38.zip
Use GTK3 API
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-individual-view.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/libempathy-gtk/empathy-individual-view.c b/libempathy-gtk/empathy-individual-view.c
index 2e88ac24d..9022e5095 100644
--- a/libempathy-gtk/empathy-individual-view.c
+++ b/libempathy-gtk/empathy-individual-view.c
@@ -570,14 +570,15 @@ individual_view_auto_scroll_cb (AutoScrollData *data)
GtkAdjustment *adj;
gdouble new_value;
- adj = gtk_scrollable_get_vadjustment (GTK_TREE_VIEW (data->view));
+ adj = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (data->view));
if (data->distance < 0)
- new_value = adj->value - AUTO_SCROLL_PITCH;
+ new_value = gtk_adjustment_get_value (adj) - AUTO_SCROLL_PITCH;
else
- new_value = adj->value + AUTO_SCROLL_PITCH;
+ new_value = gtk_adjustment_get_value (adj) + AUTO_SCROLL_PITCH;
- new_value = CLAMP (new_value, adj->lower, adj->upper - adj->page_size);
+ new_value = CLAMP (new_value, gtk_adjustment_get_lower (adj),
+ gtk_adjustment_get_upper (adj) - gtk_adjustment_get_page_size (adj));
gtk_adjustment_set_value (adj, new_value);
@@ -602,6 +603,7 @@ individual_view_drag_motion (GtkWidget *widget,
gboolean is_different = FALSE;
gboolean cleanup = TRUE;
gboolean retval = TRUE;
+ GtkAllocation allocation;
priv = GET_PRIV (EMPATHY_INDIVIDUAL_VIEW (widget));
model = gtk_tree_view_get_model (GTK_TREE_VIEW (widget));
@@ -612,13 +614,15 @@ individual_view_drag_motion (GtkWidget *widget,
if (as.timeout_id)
g_source_remove (as.timeout_id);
+ gtk_widget_get_allocation (widget, &allocation);
+
if (y < AUTO_SCROLL_MARGIN_SIZE ||
- y > (widget->allocation.height - AUTO_SCROLL_MARGIN_SIZE))
+ y > (allocation.height - AUTO_SCROLL_MARGIN_SIZE))
{
if (y < AUTO_SCROLL_MARGIN_SIZE)
as.distance = MIN (-y, -1);
else
- as.distance = MAX (widget->allocation.height - y, 1);
+ as.distance = MAX (allocation.height - y, 1);
as.timeout_id = g_timeout_add (10 * ABS (as.distance),
(GSourceFunc) individual_view_auto_scroll_cb, &as);