diff options
author | Robert Roth <robert.roth.off@gmail.com> | 2018-08-03 10:25:46 +0300 |
---|---|---|
committer | Robert Roth <robert.roth.off@gmail.com> | 2018-08-03 10:25:46 +0300 |
commit | f0419c74476db6b7c42a62d4d1049650938cfbf5 (patch) | |
tree | fd8ff279300eaa588d630335c9950ef6ed6a9118 | |
parent | 877fffdd5efd55dc1067cd6e2b3a715197879f08 (diff) | |
download | gtk+-robertroth/emoji-name-tooltip.tar.gz |
emoji-chooser: add tooltip with emoji name (#910)robertroth/emoji-name-tooltip
-rw-r--r-- | gtk/gtkemojichooser.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gtk/gtkemojichooser.c b/gtk/gtkemojichooser.c index 1ea0cfc337..aa29e0cdec 100644 --- a/gtk/gtkemojichooser.c +++ b/gtk/gtkemojichooser.c @@ -345,11 +345,15 @@ add_emoji (GtkWidget *box, GVariant *codes; char text[64]; char *p = text; + const char *name; + int i; PangoLayout *layout; PangoRectangle rect; codes = g_variant_get_child_value (item, 0); + g_variant_get_child (item, 1, "&s", &name); + for (i = 0; i < g_variant_n_children (codes); i++) { gunichar code; @@ -364,6 +368,7 @@ add_emoji (GtkWidget *box, p[0] = 0; label = gtk_label_new (text); + gtk_widget_set_tooltip_text (GTK_WIDGET (label), name); attrs = pango_attr_list_new (); pango_attr_list_insert (attrs, pango_attr_scale_new (PANGO_SCALE_X_LARGE)); gtk_label_set_attributes (GTK_LABEL (label), attrs); |