diff options
author | Rodrigo Moya <rodrigo@gnome-db.org> | 2010-12-10 20:15:27 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@gnome-db.org> | 2011-06-30 00:41:26 +0800 |
commit | b5aba428f4d7daca78a6b079e1766d9fba5a8bc3 (patch) | |
tree | c8cd9400a62f2cf2b3ba84bd6e6b01774f2b3085 /widgets/misc/e-menu-tool-button.c | |
parent | cd633936b1f2f2e8c678dfb4e3e38ba9713e41a4 (diff) | |
download | gsoc2013-evolution-b5aba428f4d7daca78a6b079e1766d9fba5a8bc3.tar gsoc2013-evolution-b5aba428f4d7daca78a6b079e1766d9fba5a8bc3.tar.gz gsoc2013-evolution-b5aba428f4d7daca78a6b079e1766d9fba5a8bc3.tar.bz2 gsoc2013-evolution-b5aba428f4d7daca78a6b079e1766d9fba5a8bc3.tar.lz gsoc2013-evolution-b5aba428f4d7daca78a6b079e1766d9fba5a8bc3.tar.xz gsoc2013-evolution-b5aba428f4d7daca78a6b079e1766d9fba5a8bc3.tar.zst gsoc2013-evolution-b5aba428f4d7daca78a6b079e1766d9fba5a8bc3.zip |
Adapt size_request vfuncs to latest gtk+-3.0 API.
Diffstat (limited to 'widgets/misc/e-menu-tool-button.c')
-rw-r--r-- | widgets/misc/e-menu-tool-button.c | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/widgets/misc/e-menu-tool-button.c b/widgets/misc/e-menu-tool-button.c index 612ed801f2..628fdea55d 100644 --- a/widgets/misc/e-menu-tool-button.c +++ b/widgets/misc/e-menu-tool-button.c @@ -100,14 +100,23 @@ menu_tool_button_update_button (GtkToolButton *tool_button) } static void -menu_tool_button_size_request (GtkWidget *widget, - GtkRequisition *requisition) +menu_tool_button_get_preferred_height (GtkWidget *widget, + gint *minimal_height, + gint *natural_height) { - gint minimum_width; + GTK_WIDGET_CLASS (e_menu_tool_button_parent_class)-> + get_preferred_height (widget, minimal_height, natural_height); +} + +static void +menu_tool_button_get_preferred_width (GtkWidget *widget, + gint *minimal_width, + gint *natural_width) +{ + gint minimum_width, min_height, nat_height; - /* Chain up to parent's size_request() method. */ GTK_WIDGET_CLASS (e_menu_tool_button_parent_class)-> - size_request (widget, requisition); + get_preferred_width (widget, minimal_width, natural_width); /* XXX This is a hack. This widget is only used for the New * button in the main window toolbar. The New button is @@ -117,8 +126,9 @@ menu_tool_button_size_request (GtkWidget *widget, * * We can't go hard-coding a width, but we -can- use a * heuristic based on the toolbar button height. */ - minimum_width = requisition->height * 2; - requisition->width = MAX (minimum_width, requisition->width); + menu_tool_button_get_preferred_height (widget, &min_height, &nat_height); + minimum_width = min_height * 2; + *minimal_width = *natural_width = MAX (minimum_width, *minimal_width); } static void @@ -141,7 +151,8 @@ e_menu_tool_button_class_init (EMenuToolButtonClass *class) GtkToolButtonClass *tool_button_class; widget_class = GTK_WIDGET_CLASS (class); - widget_class->size_request = menu_tool_button_size_request; + widget_class->get_preferred_height = menu_tool_button_get_preferred_height; + widget_class->get_preferred_width = menu_tool_button_get_preferred_width; tool_button_class = GTK_TOOL_BUTTON_CLASS (class); tool_button_class->clicked = menu_tool_button_clicked; |