utils: Add utility function for creating activate signal and shortcuts

The current way of adding activation shortcuts is cumbersome,
as it is a for-loop pasted in the middle of class initializers.
The utility function addresses this problem by simply allowing us
to declaratively add these shortcuts with minimal effort.

Furthermore, the implementation is also simpler, thanks to the
`gtk_widget_class_add_binding_signal()` wrapper function.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/747>
This commit is contained in:
Hari Rana
2026-05-04 10:42:02 +00:00
committed by Marge Bot
parent 16a67b7f60
commit 312b286e2b
2 changed files with 44 additions and 0 deletions
+3
View File
@@ -141,4 +141,7 @@ SoupSession * gcal_create_soup_session (void);
GListModel * gcal_create_writable_calendars_model (GcalManager *manager);
const gchar * gcal_get_email_from_mailto_uri (const gchar *mailto_uri);
guint gcal_create_activate_signal_and_shortcuts (GtkWidgetClass *widget_class,
GType widget_type);
#endif /* __GCAL_UTILS_H__ */