clapper-app: Make info window close with Esc key

Fixes #448
This commit is contained in:
Rafał Dzięgiel
2024-05-14 21:13:02 +02:00
parent 9b7c12c3d0
commit 333f8b4692

View File

@@ -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)
{
@@ -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);