aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo@gnome-db.org>2010-12-10 20:15:27 +0800
committerMatthew Barnes <mbarnes@redhat.com>2011-01-25 23:37:16 +0800
commitb7c2f49973b93c2e80bed6f10c534af17b757c04 (patch)
tree938da8b0b636884610fa745542cb85f100fc8331 /modules
parenta2f59fe0fc9e1b8737759ecb884bca18fa8defe3 (diff)
downloadgsoc2013-evolution-b7c2f49973b93c2e80bed6f10c534af17b757c04.tar.gz
gsoc2013-evolution-b7c2f49973b93c2e80bed6f10c534af17b757c04.tar.zst
gsoc2013-evolution-b7c2f49973b93c2e80bed6f10c534af17b757c04.zip
Adapt size_request vfuncs to latest gtk+-3.0 API.
Diffstat (limited to 'modules')
-rw-r--r--modules/mail/e-mail-shell-sidebar.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/modules/mail/e-mail-shell-sidebar.c b/modules/mail/e-mail-shell-sidebar.c
index 2b24aae5e1..7c538de519 100644
--- a/modules/mail/e-mail-shell-sidebar.c
+++ b/modules/mail/e-mail-shell-sidebar.c
@@ -231,8 +231,17 @@ guess_screen_width (EMailShellSidebar *sidebar)
}
static void
-mail_shell_sidebar_size_request (GtkWidget *widget,
- GtkRequisition *requisition)
+mail_shell_sidebar_get_preferred_height (GtkWidget *widget,
+ gint *minimum_height,
+ gint *natural_height)
+{
+ GTK_WIDGET_CLASS (parent_class)->get_preferred_height (widget, minimum_height, natural_height);
+}
+
+static void
+mail_shell_sidebar_get_preferred_width (GtkWidget *widget,
+ gint *minimum_width,
+ gint *natural_width)
{
/* We override the normal size-request handler so that we can
* spit out a treeview with a suitable width. We measure the
@@ -258,7 +267,7 @@ mail_shell_sidebar_size_request (GtkWidget *widget,
sidebar = E_MAIL_SHELL_SIDEBAR (widget);
- GTK_WIDGET_CLASS (parent_class)->size_request (widget, requisition);
+ GTK_WIDGET_CLASS (parent_class)->get_preferred_width (widget, minimum_width, natural_width);
/* This string is a mockup only; it doesn't need to be translated */
layout = gtk_widget_create_pango_layout (
@@ -274,7 +283,7 @@ mail_shell_sidebar_size_request (GtkWidget *widget,
border = 2 * style->xthickness + 4;
sidebar_width = ink_rect.width + border;
sidebar_width = MIN (sidebar_width, screen_width / 4);
- requisition->width = MAX (requisition->width, sidebar_width);
+ *minimum_width = *natural_width = MAX (*natural_width, sidebar_width);
}
static guint32
@@ -305,7 +314,8 @@ mail_shell_sidebar_class_init (EMailShellSidebarClass *class)
object_class->constructed = mail_shell_sidebar_constructed;
widget_class = GTK_WIDGET_CLASS (class);
- widget_class->size_request = mail_shell_sidebar_size_request;
+ widget_class->get_preferred_width = mail_shell_sidebar_get_preferred_width;
+ widget_class->get_preferred_height = mail_shell_sidebar_get_preferred_height;
shell_sidebar_class = E_SHELL_SIDEBAR_CLASS (class);
shell_sidebar_class->check_state = mail_shell_sidebar_check_state;