Connect accelerators of implicitly created panel actions
This commit is contained in:
parent
139132afbd
commit
f4c7df59b4
1 changed files with 1 additions and 2 deletions
|
@ -853,13 +853,12 @@ midori_panel_append_page (MidoriPanel* panel,
|
||||||
G_CALLBACK (midori_panel_action_activate_cb), panel);
|
G_CALLBACK (midori_panel_action_activate_cb), panel);
|
||||||
if (panel->action_group)
|
if (panel->action_group)
|
||||||
{
|
{
|
||||||
/* FIXME: For some reason the accelerator only works if a menuitem
|
|
||||||
is created, but not before that. */
|
|
||||||
GtkWidget* toplevel = gtk_widget_get_toplevel (GTK_WIDGET (panel));
|
GtkWidget* toplevel = gtk_widget_get_toplevel (GTK_WIDGET (panel));
|
||||||
GSList* groups = gtk_accel_groups_from_object (G_OBJECT (toplevel));
|
GSList* groups = gtk_accel_groups_from_object (G_OBJECT (toplevel));
|
||||||
gtk_action_set_accel_group (action, g_slist_nth_data (groups, 0));
|
gtk_action_set_accel_group (action, g_slist_nth_data (groups, 0));
|
||||||
gtk_action_group_add_action_with_accel (panel->action_group,
|
gtk_action_group_add_action_with_accel (panel->action_group,
|
||||||
action, NULL);
|
action, NULL);
|
||||||
|
gtk_action_connect_accelerator (action);
|
||||||
}
|
}
|
||||||
if (n > 0)
|
if (n > 0)
|
||||||
g_object_set (action, "group", g_object_get_data (
|
g_object_set (action, "group", g_object_get_data (
|
||||||
|
|
Loading…
Reference in a new issue