libsysprof-gtk: connect zoom plumbing to session

This gets the plumbing in place, but all of the charts are not yet doing
the proper filtering based on session visible time.
This commit is contained in:
Christian Hergert
2023-06-30 15:38:55 -07:00
parent bd5ce9de06
commit a3a9ca1529
3 changed files with 32 additions and 0 deletions

View File

@ -319,6 +319,19 @@ G_GNUC_END_IGNORE_DEPRECATIONS
gtk_widget_get_height (GTK_WIDGET (self))));
}
static void
sysprof_tracks_view_zoom_to_selection (GtkWidget *widget,
const char *action_name,
GVariant *params)
{
SysprofTracksView *self = (SysprofTracksView *)widget;
g_assert (SYSPROF_IS_TRACKS_VIEW (self));
if (self->session != NULL)
sysprof_session_zoom_to_selection (self->session);
}
static void
sysprof_tracks_view_measure (GtkWidget *widget,
GtkOrientation orientation,
@ -467,6 +480,8 @@ sysprof_tracks_view_class_init (SysprofTracksViewClass *klass)
gtk_widget_class_bind_template_callback (widget_class, sysprof_tracks_view_drag_end_cb);
gtk_widget_class_bind_template_callback (widget_class, sysprof_tracks_view_drag_update_cb);
gtk_widget_class_install_action (widget_class, "zoom-to-selection", NULL, sysprof_tracks_view_zoom_to_selection);
g_type_ensure (SYSPROF_TYPE_TIME_RULER);
g_type_ensure (SYSPROF_TYPE_TRACK_VIEW);
}