Skip to content

Commit

Permalink
clapper-app: Make info window close with Esc key
Browse files Browse the repository at this point in the history
Fixes #448
  • Loading branch information
Rafostar committed May 14, 2024
1 parent 9b7c12c commit 333f8b4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/bin/clapper-app/clapper-app-info-window.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,15 @@ has_streams_closure (ClapperAppInfoWindow *self, guint n_streams)
return (n_streams > 0);
}

static gboolean
close_cb (GtkWidget *widget, GVariant *args G_GNUC_UNUSED,
gpointer user_data G_GNUC_UNUSED)
{
gtk_window_close (GTK_WINDOW (widget));

return TRUE;
}

GtkWidget *
clapper_app_info_window_new (GtkApplication *gtk_app, ClapperPlayer *player)
{
Expand Down Expand Up @@ -200,6 +209,8 @@ clapper_app_info_window_class_init (ClapperAppInfoWindowClass *klass)

g_object_class_install_properties (gobject_class, PROP_LAST, param_specs);

gtk_widget_class_add_binding (widget_class, GDK_KEY_Escape, 0, close_cb, NULL);

gtk_widget_class_bind_template_child (widget_class, ClapperAppInfoWindow, vstreams_list);
gtk_widget_class_bind_template_child (widget_class, ClapperAppInfoWindow, astreams_list);
gtk_widget_class_bind_template_child (widget_class, ClapperAppInfoWindow, sstreams_list);
Expand Down

0 comments on commit 333f8b4

Please sign in to comment.