Beispiel #1
0
static gboolean
label_button_pressed_callback (GtkWidget             *widget,
			       GdkEventButton        *event)
{
	NemoWindow *window;
	NemoWindowSlot *slot;
	NemoView *view;
	GtkWidget *label;

	if (event->button != 3) {
		return FALSE;
	}

	window = nemo_location_bar_get_window (gtk_widget_get_parent (widget));
	slot = nemo_window_get_active_slot (window);
	view = slot->content_view;
	label = gtk_bin_get_child (GTK_BIN (widget));
	/* only pop-up if the URI in the entry matches the displayed location */
	if (view == NULL ||
	    strcmp (gtk_label_get_text (GTK_LABEL (label)), LOCATION_LABEL)) {
		return FALSE;
	}

	nemo_view_pop_up_location_context_menu (view, event, NULL);

	return FALSE;
}
Beispiel #2
0
static gboolean
button_pressed_callback (GtkWidget             *widget,
			       GdkEventButton        *event)
{
	NemoWindow *window;
	NemoWindowSlot *slot;
	NemoView *view;
	NemoLocationEntry *entry;

	if (event->button != 3) {
		return FALSE;
	}

	window = nemo_location_bar_get_window (gtk_widget_get_parent (widget));
	slot = nemo_window_get_active_slot (window);
	view = slot->content_view;
	entry = NEMO_LOCATION_ENTRY (gtk_bin_get_child (GTK_BIN (widget)));

    if (view == NULL ||
        nemo_location_entry_get_secondary_action (entry) == NEMO_LOCATION_ENTRY_ACTION_GOTO) {
        return FALSE;
    }

	nemo_view_pop_up_location_context_menu (view, event, NULL);

	return FALSE;
}
Beispiel #3
0
static gboolean
path_bar_button_pressed_callback (GtkWidget *widget,
				  GdkEventButton *event,
				  NemoWindowPane *pane)
{
	NemoWindowSlot *slot;
	NemoView *view;
	GFile *location;
	char *uri;

	g_object_set_data (G_OBJECT (widget), "handle-button-release",
			   GINT_TO_POINTER (TRUE));

	if (event->button == 3) {
		slot = nemo_window_get_active_slot (pane->window);
		view = slot->content_view;
		if (view != NULL) {
			location = nemo_path_bar_get_path_for_button (
				NEMO_PATH_BAR (pane->path_bar), widget);
			if (location != NULL) {
				uri = g_file_get_uri (location);
				nemo_view_pop_up_location_context_menu (
					view, event, uri);
				g_object_unref (location);
				g_free (uri);
				return TRUE;
			}
		}
	}

	return FALSE;
}