[frogr] Use gtk_application_set_accels_for_action if GTK > 3.12
- From: Mario Sanchez Prada <msanchez src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [frogr] Use gtk_application_set_accels_for_action if GTK > 3.12
- Date: Wed, 24 Dec 2014 02:54:26 +0000 (UTC)
commit cc902f91189cea57053382d8175efeec75624786
Author: Mario Sanchez Prada <msanchez gnome org>
Date: Wed Dec 24 02:51:20 2014 +0000
Use gtk_application_set_accels_for_action if GTK > 3.12
src/frogr-main-view.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/src/frogr-main-view.c b/src/frogr-main-view.c
index 0a02de6..a85d34c 100644
--- a/src/frogr-main-view.c
+++ b/src/frogr-main-view.c
@@ -687,13 +687,18 @@ static GtkWidget *
_create_header_bar_item (GtkApplication *app, const gchar *action_name, const gchar *icon_name, const gchar
*label, const gchar *tooltip_text, const gchar *accel)
{
GtkWidget *widget = NULL;
+#if GTK_CHECK_VERSION (3, 12, 0)
+ const gchar *accels[2] = { accel, NULL };
+#endif
widget = gtk_button_new_from_icon_name (icon_name, GTK_ICON_SIZE_MENU);
gtk_widget_set_tooltip_text (widget, tooltip_text);
gtk_actionable_set_action_name (GTK_ACTIONABLE (widget), action_name);
- G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+#if GTK_CHECK_VERSION (3, 12, 0)
+ gtk_application_set_accels_for_action (app, action_name, accels);
+#else
gtk_application_add_accelerator (app, accel, action_name, NULL);
- G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+#endif
gtk_widget_show (widget);
return widget;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]