app/widgets/gimpcontainergridview.c allow to popup the context menu from

2005-09-08  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimpcontainergridview.c
	* app/widgets/gimpcontainertreeview.c: allow to popup the context
	menu from the views' empty area. Fixes bug #314719.
This commit is contained in:
Michael Natterer 2005-09-08 18:23:14 +00:00 committed by Michael Natterer
parent 0f37b51641
commit 7e34681f86
3 changed files with 42 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2005-09-08 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpcontainergridview.c
* app/widgets/gimpcontainertreeview.c: allow to popup the context
menu from the views' empty area. Fixes bug #314719.
2005-09-07 Michael Natterer <mitch@gimp.org>
* app/core/gimpchannel-combine.c (gimp_channel_combine_ellipse):

View File

@ -95,6 +95,9 @@ static void gimp_container_grid_view_highlight_item (GimpContainerView *v
static void gimp_container_grid_view_viewport_resized (GtkWidget *widget,
GtkAllocation *allocation,
GimpContainerGridView *view);
static gboolean gimp_container_grid_view_button_press (GtkWidget *widget,
GdkEventButton *bevent,
GimpContainerGridView *view);
static GimpContainerBoxClass *parent_class = NULL;
@ -213,6 +216,9 @@ gimp_container_grid_view_init (GimpContainerGridView *grid_view)
g_signal_connect (grid_view->wrap_box->parent, "size-allocate",
G_CALLBACK (gimp_container_grid_view_viewport_resized),
grid_view);
g_signal_connect (grid_view->wrap_box->parent, "button-press-event",
G_CALLBACK (gimp_container_grid_view_button_press),
grid_view);
GTK_WIDGET_SET_FLAGS (grid_view, GTK_CAN_FOCUS);
}
@ -718,3 +724,21 @@ gimp_container_grid_view_viewport_resized (GtkWidget *widget,
}
}
}
static gboolean
gimp_container_grid_view_button_press (GtkWidget *widget,
GdkEventButton *bevent,
GimpContainerGridView *view)
{
switch (bevent->button)
{
case 3:
gimp_editor_popup_menu (GIMP_EDITOR (view), NULL, NULL);
break;
default:
break;
}
return TRUE;
}

View File

@ -1057,6 +1057,18 @@ gimp_container_tree_view_button_press (GtkWidget *widget,
gtk_tree_path_free (path);
g_object_unref (renderer);
}
else
{
switch (bevent->button)
{
case 3:
gimp_editor_popup_menu (GIMP_EDITOR (tree_view), NULL, NULL);
break;
default:
break;
}
}
return TRUE;
}