aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-chat.c
diff options
context:
space:
mode:
authorJonny Lamb <jonny.lamb@collabora.co.uk>2009-06-21 00:27:06 +0800
committerJonny Lamb <jonny.lamb@collabora.co.uk>2009-07-10 20:13:24 +0800
commit7deb4ea20b08eab10473f2620c90f6b896d5af10 (patch)
tree0658af67eae180a741bd65a3e92ffe92e8faf497 /libempathy-gtk/empathy-chat.c
parentfb43069972c8eccefcf1beb28251d1ed23c4a20c (diff)
downloadgsoc2013-empathy-7deb4ea20b08eab10473f2620c90f6b896d5af10.tar
gsoc2013-empathy-7deb4ea20b08eab10473f2620c90f6b896d5af10.tar.gz
gsoc2013-empathy-7deb4ea20b08eab10473f2620c90f6b896d5af10.tar.bz2
gsoc2013-empathy-7deb4ea20b08eab10473f2620c90f6b896d5af10.tar.lz
gsoc2013-empathy-7deb4ea20b08eab10473f2620c90f6b896d5af10.tar.xz
gsoc2013-empathy-7deb4ea20b08eab10473f2620c90f6b896d5af10.tar.zst
gsoc2013-empathy-7deb4ea20b08eab10473f2620c90f6b896d5af10.zip
Use accessor functions instead direct access (Fixes #586476)
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
Diffstat (limited to 'libempathy-gtk/empathy-chat.c')
-rw-r--r--libempathy-gtk/empathy-chat.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c
index 1729e5305..a8ca745e2 100644
--- a/libempathy-gtk/empathy-chat.c
+++ b/libempathy-gtk/empathy-chat.c
@@ -748,13 +748,14 @@ chat_input_key_press_event_cb (GtkWidget *widget,
if (!(event->state & GDK_CONTROL_MASK) &&
event->keyval == GDK_Page_Up) {
adj = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (text_view_sw));
- gtk_adjustment_set_value (adj, adj->value - adj->page_size);
+ gtk_adjustment_set_value (adj, gtk_adjustment_get_value (adj) - gtk_adjustment_get_page_size (adj));
return TRUE;
}
if ((event->state & GDK_CONTROL_MASK) != GDK_CONTROL_MASK &&
event->keyval == GDK_Page_Down) {
adj = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (text_view_sw));
- val = MIN (adj->value + adj->page_size, adj->upper - adj->page_size);
+ val = MIN (gtk_adjustment_get_value (adj) + gtk_adjustment_get_page_size (adj),
+ gtk_adjustment_get_upper (adj) - gtk_adjustment_get_page_size (adj));
gtk_adjustment_set_value (adj, val);
return TRUE;
}
@@ -1478,15 +1479,18 @@ chat_size_request (GtkWidget *widget,
GtkRequisition *requisition)
{
GtkBin *bin = GTK_BIN (widget);
+ GtkWidget *child;
- requisition->width = GTK_CONTAINER (widget)->border_width * 2;
- requisition->height = GTK_CONTAINER (widget)->border_width * 2;
+ requisition->width = gtk_container_get_border_width (GTK_CONTAINER (widget)) * 2;
+ requisition->height = gtk_container_get_border_width (GTK_CONTAINER (widget)) * 2;
- if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
+ child = gtk_bin_get_child (bin);
+
+ if (child && GTK_WIDGET_VISIBLE (child))
{
GtkRequisition child_requisition;
- gtk_widget_size_request (bin->child, &child_requisition);
+ gtk_widget_size_request (child, &child_requisition);
requisition->width += child_requisition.width;
requisition->height += child_requisition.height;
@@ -1499,17 +1503,20 @@ chat_size_allocate (GtkWidget *widget,
{
GtkBin *bin = GTK_BIN (widget);
GtkAllocation child_allocation;
+ GtkWidget *child;
widget->allocation = *allocation;
- if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
+ child = gtk_bin_get_child (bin);
+
+ if (child && GTK_WIDGET_VISIBLE (child))
{
- child_allocation.x = allocation->x + GTK_CONTAINER (widget)->border_width;
- child_allocation.y = allocation->y + GTK_CONTAINER (widget)->border_width;
- child_allocation.width = MAX (allocation->width - GTK_CONTAINER (widget)->border_width * 2, 0);
- child_allocation.height = MAX (allocation->height - GTK_CONTAINER (widget)->border_width * 2, 0);
+ child_allocation.x = allocation->x + gtk_container_get_border_width (GTK_CONTAINER (widget));
+ child_allocation.y = allocation->y + gtk_container_get_border_width (GTK_CONTAINER (widget));
+ child_allocation.width = MAX (allocation->width - gtk_container_get_border_width (GTK_CONTAINER (widget)) * 2, 0);
+ child_allocation.height = MAX (allocation->height - gtk_container_get_border_width (GTK_CONTAINER (widget)) * 2, 0);
- gtk_widget_size_allocate (bin->child, &child_allocation);
+ gtk_widget_size_allocate (child, &child_allocation);
}
}