diff options
author | Milan Crha <mcrha@redhat.com> | 2014-02-13 03:45:53 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2014-02-13 03:47:07 +0800 |
commit | b48e21d9aa7eb16e559739b71b9d08f90dfa92be (patch) | |
tree | 22244f22b235b1dfc80bbc50c7e2ab8eecb91cdf /e-util/e-dialog-widgets.c | |
parent | 4bdbb71da69076287ffbb781109aa5687026349c (diff) | |
download | gsoc2013-evolution-b48e21d9aa7eb16e559739b71b9d08f90dfa92be.tar gsoc2013-evolution-b48e21d9aa7eb16e559739b71b9d08f90dfa92be.tar.gz gsoc2013-evolution-b48e21d9aa7eb16e559739b71b9d08f90dfa92be.tar.bz2 gsoc2013-evolution-b48e21d9aa7eb16e559739b71b9d08f90dfa92be.tar.lz gsoc2013-evolution-b48e21d9aa7eb16e559739b71b9d08f90dfa92be.tar.xz gsoc2013-evolution-b48e21d9aa7eb16e559739b71b9d08f90dfa92be.tar.zst gsoc2013-evolution-b48e21d9aa7eb16e559739b71b9d08f90dfa92be.zip |
Stop using deprecated gtk-stock items
Diffstat (limited to 'e-util/e-dialog-widgets.c')
-rw-r--r-- | e-util/e-dialog-widgets.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/e-util/e-dialog-widgets.c b/e-util/e-dialog-widgets.c index 5657c21aa2..1a64b4b1b9 100644 --- a/e-util/e-dialog-widgets.c +++ b/e-util/e-dialog-widgets.c @@ -132,3 +132,38 @@ e_dialog_combo_box_get (GtkWidget *widget, return i; } + +/** + * e_dialog_button_new_with_icon: + * @icon_name: Icon's name to use; can be %NULL + * @label: Button label to set, with mnemonics + * + * Creates a new #GtkButton with preset @label and image set + * to @icon_name. + * + * Returns: (transfer-full): A new #GtkButton + * + * Since: 3.12 + **/ +GtkWidget * +e_dialog_button_new_with_icon (const gchar *icon_name, + const gchar *label) +{ + GtkIconSize icon_size = GTK_ICON_SIZE_BUTTON; + GtkWidget *button; + + if (label && *label) { + button = gtk_button_new_with_mnemonic (label); + } else { + button = gtk_button_new (); + icon_size = GTK_ICON_SIZE_MENU; + } + + if (icon_name) + gtk_button_set_image (GTK_BUTTON (button), + gtk_image_new_from_icon_name (icon_name, icon_size)); + + gtk_widget_show (button); + + return button; +} |