diff options
author | Benjamin Otte <otte@redhat.com> | 2018-08-23 21:07:36 +0200 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-03-25 23:14:28 -0400 |
commit | 7974751e2432178686b13f9057efcb7dbe39af60 (patch) | |
tree | 916a0c071a0e9357d2f11499920d3ed809db60b3 /gtk/gtkbuilder.c | |
parent | daa7d9072dc3e0dee3fe041354ddddbb97695061 (diff) | |
download | gtk+-7974751e2432178686b13f9057efcb7dbe39af60.tar.gz |
shortcuttrigger: Add gtk_shortcut_triger_new_parse_string()
And hook it up into the GtkBuilder infrastructure.
Diffstat (limited to 'gtk/gtkbuilder.c')
-rw-r--r-- | gtk/gtkbuilder.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gtk/gtkbuilder.c b/gtk/gtkbuilder.c index ba3f367ddc..c2285dfbf9 100644 --- a/gtk/gtkbuilder.c +++ b/gtk/gtkbuilder.c @@ -219,8 +219,11 @@ #include "gtkbuilderscopeprivate.h" #include "gtkdebug.h" #include "gtkmain.h" +#include "gtkicontheme.h" #include "gtkintl.h" #include "gtkprivate.h" +#include "gtkshortcuttrigger.h" +#include "gtktestutils.h" #include "gtktypebuiltins.h" #include "gtkicontheme.h" #include "gtkiconthemeprivate.h" @@ -2092,6 +2095,22 @@ gtk_builder_value_from_string_type (GtkBuilder *builder, ret = FALSE; } } + else if (G_VALUE_HOLDS (value, GTK_TYPE_SHORTCUT_TRIGGER)) + { + GtkShortcutTrigger *trigger = gtk_shortcut_trigger_parse_string (string); + + if (trigger) + g_value_take_boxed (value, trigger); + else + { + g_set_error (error, + GTK_BUILDER_ERROR, + GTK_BUILDER_ERROR_INVALID_VALUE, + "Could not parse shortcut trigger '%s'", + string); + ret = FALSE; + } + } else if (G_VALUE_HOLDS (value, G_TYPE_STRV)) { gchar **vector = g_strsplit (string, "\n", 0); |