Commit aa81b9a9cd7ac38b872cdce8867b68fd80e8e835
1 parent
d1ddffe5
Exists in
master
and in
2 other branches
Adding tooltips in the header bar buttons.
Showing
1 changed file
with
5 additions
and
0 deletions
Show diff stats
src/objects/window/header.c
@@ -145,6 +145,7 @@ | @@ -145,6 +145,7 @@ | ||
145 | 145 | ||
146 | if(!action) { | 146 | if(!action) { |
147 | g_warning("Can't find action %s",action_name); | 147 | g_warning("Can't find action %s",action_name); |
148 | + return NULL; | ||
148 | } | 149 | } |
149 | 150 | ||
150 | button = gtk_button_new_from_action(action,GTK_ICON_SIZE_BUTTON,symbolic); | 151 | button = gtk_button_new_from_action(action,GTK_ICON_SIZE_BUTTON,symbolic); |
@@ -152,6 +153,10 @@ | @@ -152,6 +153,10 @@ | ||
152 | gtk_actionable_set_action_name(GTK_ACTIONABLE(button),action_name); | 153 | gtk_actionable_set_action_name(GTK_ACTIONABLE(button),action_name); |
153 | gtk_widget_set_visible(button,g_action_get_enabled(action)); | 154 | gtk_widget_set_visible(button,g_action_get_enabled(action)); |
154 | 155 | ||
156 | + g_autofree gchar * tooltip = g_action_get_tooltip(action); | ||
157 | + if(tooltip) | ||
158 | + gtk_widget_set_tooltip_markup(GTK_WIDGET(button),tooltip); | ||
159 | + | ||
155 | } | 160 | } |
156 | 161 | ||
157 | g_signal_connect(button, "notify::sensitive", G_CALLBACK(on_sensitive), widget); | 162 | g_signal_connect(button, "notify::sensitive", G_CALLBACK(on_sensitive), widget); |