From aa81b9a9cd7ac38b872cdce8867b68fd80e8e835 Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Mon, 21 Sep 2020 19:49:19 -0300 Subject: [PATCH] Adding tooltips in the header bar buttons. --- src/objects/window/header.c | 5 +++++ 1 file changed, 5 insertions(+), 0 deletions(-) diff --git a/src/objects/window/header.c b/src/objects/window/header.c index d88eaa7..37a23e4 100644 --- a/src/objects/window/header.c +++ b/src/objects/window/header.c @@ -145,6 +145,7 @@ if(!action) { g_warning("Can't find action %s",action_name); + return NULL; } button = gtk_button_new_from_action(action,GTK_ICON_SIZE_BUTTON,symbolic); @@ -152,6 +153,10 @@ gtk_actionable_set_action_name(GTK_ACTIONABLE(button),action_name); gtk_widget_set_visible(button,g_action_get_enabled(action)); + g_autofree gchar * tooltip = g_action_get_tooltip(action); + if(tooltip) + gtk_widget_set_tooltip_markup(GTK_WIDGET(button),tooltip); + } g_signal_connect(button, "notify::sensitive", G_CALLBACK(on_sensitive), widget); -- libgit2 0.21.2