mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-09 22:50:54 +00:00
sysprof: add F9 for sidebar toggles
This commit is contained in:
@ -43,6 +43,7 @@ struct _SysprofWindow
|
|||||||
SysprofSession *session;
|
SysprofSession *session;
|
||||||
|
|
||||||
GtkToggleButton *show_right_sidebar;
|
GtkToggleButton *show_right_sidebar;
|
||||||
|
GtkWidget *left_split_overlay;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
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_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, 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_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);
|
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
|
static void
|
||||||
sysprof_window_init (SysprofWindow *self)
|
sysprof_window_init (SysprofWindow *self)
|
||||||
{
|
{
|
||||||
|
g_autoptr(GPropertyAction) show_left_sidebar = NULL;
|
||||||
|
|
||||||
gtk_widget_init_template (GTK_WIDGET (self));
|
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 *
|
GtkWidget *
|
||||||
|
|||||||
@ -8,6 +8,12 @@
|
|||||||
<property name="default-height">750</property>
|
<property name="default-height">750</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkShortcutController">
|
<object class="GtkShortcutController">
|
||||||
|
<child>
|
||||||
|
<object class="GtkShortcut">
|
||||||
|
<property name="trigger">F9</property>
|
||||||
|
<property name="action">action(win.show-left-sidebar)</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkShortcut">
|
<object class="GtkShortcut">
|
||||||
<property name="trigger"><ctrl>n</property>
|
<property name="trigger"><ctrl>n</property>
|
||||||
@ -296,6 +302,13 @@
|
|||||||
</section>
|
</section>
|
||||||
</menu>
|
</menu>
|
||||||
<menu id="view_menu">
|
<menu id="view_menu">
|
||||||
|
<section>
|
||||||
|
<item>
|
||||||
|
<attribute name="label" translatable="yes">Show Sidebar</attribute>
|
||||||
|
<attribute name="action">win.show-left-sidebar</attribute>
|
||||||
|
<attribute name="accel">F9</attribute>
|
||||||
|
</item>
|
||||||
|
</section>
|
||||||
<section>
|
<section>
|
||||||
<attribute name="label" translatable="yes">Callgraph</attribute>
|
<attribute name="label" translatable="yes">Callgraph</attribute>
|
||||||
<item>
|
<item>
|
||||||
|
|||||||
Reference in New Issue
Block a user