diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2009-08-25 11:35:46 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-08-25 11:35:46 +0800 |
commit | 452650a573432a6416f3f31ec0594b888a52b93f (patch) | |
tree | 72e32d902f5e43757f29129551dd138d5a901b8d | |
parent | 2b8c7c62aa3d172e3530c0570be29dfaac501432 (diff) | |
download | gsoc2013-evolution-452650a573432a6416f3f31ec0594b888a52b93f.tar.gz gsoc2013-evolution-452650a573432a6416f3f31ec0594b888a52b93f.tar.zst gsoc2013-evolution-452650a573432a6416f3f31ec0594b888a52b93f.zip |
Bug 359909 - "New" Button too small
-rw-r--r-- | widgets/misc/e-menu-tool-button.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/widgets/misc/e-menu-tool-button.c b/widgets/misc/e-menu-tool-button.c index 58c8317053..fcf73d6c4e 100644 --- a/widgets/misc/e-menu-tool-button.c +++ b/widgets/misc/e-menu-tool-button.c @@ -93,6 +93,27 @@ menu_tool_button_update_button (GtkToolButton *tool_button) } static void +menu_tool_button_size_request (GtkWidget *widget, + GtkRequisition *requisition) +{ + gint minimum_width; + + /* Chain up to parent's size_request() method. */ + GTK_WIDGET_CLASS (parent_class)->size_request (widget, requisition); + + /* XXX This is a hack. This widget is only used for the New + * button in the main window toolbar. The New button is + * pretty important, but the word "New" is pretty short + * (in English, anyway) and this results in a small screen + * target when using a "text below item" toolbar style. + * + * 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); +} + +static void menu_tool_button_clicked (GtkToolButton *tool_button) { GtkMenuItem *menu_item; @@ -108,10 +129,14 @@ menu_tool_button_clicked (GtkToolButton *tool_button) static void menu_tool_button_class_init (EMenuToolButtonClass *class) { + GtkWidgetClass *widget_class; GtkToolButtonClass *tool_button_class; parent_class = g_type_class_peek_parent (class); + widget_class = GTK_WIDGET_CLASS (class); + widget_class->size_request = menu_tool_button_size_request; + tool_button_class = GTK_TOOL_BUTTON_CLASS (class); tool_button_class->clicked = menu_tool_button_clicked; } |