From af050bc184a6cce433bf23f52fd9e7a9f6983d7c Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Tue, 18 Jul 2023 17:37:33 -0700 Subject: [PATCH] sysprof: add F9 for sidebar toggles --- src/sysprof/sysprof-window.c | 10 ++++++++++ src/sysprof/sysprof-window.ui | 13 +++++++++++++ 2 files changed, 23 insertions(+) diff --git a/src/sysprof/sysprof-window.c b/src/sysprof/sysprof-window.c index 5faf0516..ea556fe8 100644 --- a/src/sysprof/sysprof-window.c +++ b/src/sysprof/sysprof-window.c @@ -43,6 +43,7 @@ struct _SysprofWindow SysprofSession *session; GtkToggleButton *show_right_sidebar; + GtkWidget *left_split_overlay; }; enum { @@ -374,6 +375,8 @@ sysprof_window_class_init (SysprofWindowClass *klass) gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/sysprof/sysprof-window.ui"); gtk_widget_class_bind_template_child (widget_class, SysprofWindow, show_right_sidebar); + gtk_widget_class_bind_template_child (widget_class, SysprofWindow, left_split_overlay); + gtk_widget_class_bind_template_callback (widget_class, main_view_notify_sidebar); gtk_widget_class_install_action (widget_class, "win.open-capture", NULL, sysprof_window_open_capture_action); @@ -409,7 +412,14 @@ sysprof_window_class_init (SysprofWindowClass *klass) static void sysprof_window_init (SysprofWindow *self) { + g_autoptr(GPropertyAction) show_left_sidebar = NULL; + gtk_widget_init_template (GTK_WIDGET (self)); + + show_left_sidebar = g_property_action_new ("show-left-sidebar", + self->left_split_overlay, + "show-sidebar"); + g_action_map_add_action (G_ACTION_MAP (self), G_ACTION (show_left_sidebar)); } GtkWidget * diff --git a/src/sysprof/sysprof-window.ui b/src/sysprof/sysprof-window.ui index 8c717c12..76756282 100644 --- a/src/sysprof/sysprof-window.ui +++ b/src/sysprof/sysprof-window.ui @@ -8,6 +8,12 @@ 750 + + + F9 + action(win.show-left-sidebar) + + <ctrl>n @@ -296,6 +302,13 @@ +
+ + Show Sidebar + win.show-left-sidebar + F9 + +
Callgraph