static GtkNotebook * notebook_create_window_cb (GtkNotebook *notebook, GtkWidget *page, gint x, gint y, gpointer user_data) { NemoApplication *app; NemoWindow *new_window; NemoWindowPane *new_pane; NemoWindowSlot *slot; if (!NEMO_IS_WINDOW_SLOT (page)) { return NULL; } app = NEMO_APPLICATION (g_application_get_default ()); new_window = nemo_application_create_window (app, gtk_widget_get_screen (GTK_WIDGET (notebook))); slot = NEMO_WINDOW_SLOT (page); g_object_set_data (G_OBJECT (slot), "dnd-window-slot", GINT_TO_POINTER (TRUE)); gtk_window_set_position (GTK_WINDOW (new_window), GTK_WIN_POS_MOUSE); new_pane = nemo_window_get_active_pane (new_window); return GTK_NOTEBOOK (new_pane->notebook); }
static void action_tabs_move_right_callback (GtkAction *action, gpointer user_data) { NemoWindowPane *pane; NemoWindow *window = user_data; pane = nemo_window_get_active_pane (window); nemo_notebook_reorder_current_child_relative (NEMO_NOTEBOOK (pane->notebook), 1); }
static void action_tabs_previous_callback (GtkAction *action, gpointer user_data) { NemoWindowPane *pane; NemoWindow *window = user_data; pane = nemo_window_get_active_pane (window); nemo_notebook_set_current_page_relative (NEMO_NOTEBOOK (pane->notebook), -1); }
static void action_edit_location_callback (GtkAction *action, gpointer user_data) { NemoWindow *window = user_data; NemoWindowPane *pane; pane = nemo_window_get_active_pane (window); nemo_window_pane_ensure_location_bar (pane); }
static void action_tab_change_action_activate_callback (GtkAction *action, gpointer user_data) { NemoWindowPane *pane; NemoWindow *window = user_data; GtkNotebook *notebook; int num; pane = nemo_window_get_active_pane (window); notebook = GTK_NOTEBOOK (pane->notebook); num = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (action), "num")); if (num < gtk_notebook_get_n_pages (notebook)) { gtk_notebook_set_current_page (notebook, num); } }
void nemo_window_pane_sync_location_widgets (NemoWindowPane *pane) { NemoWindowSlot *slot, *active_slot; NemoNavigationState *nav_state; gchar *view_id; slot = pane->active_slot; nemo_window_pane_hide_temporary_bars (pane); /* Change the location bar and path bar to match the current location. */ if (slot->location != NULL) { char *uri; /* this may be NULL if we just created the slot */ uri = nemo_window_slot_get_location_uri (slot); nemo_location_bar_set_location (NEMO_LOCATION_BAR (pane->location_bar), uri); g_free (uri); nemo_path_bar_set_path (NEMO_PATH_BAR (pane->path_bar), slot->location); restore_focus_widget (pane); } /* Update window global UI if this is the active pane */ if (pane == nemo_window_get_active_pane (pane->window)) { nemo_window_sync_up_button (pane->window); /* Check if the back and forward buttons need enabling or disabling. */ active_slot = nemo_window_get_active_slot (pane->window); nav_state = nemo_window_get_navigation_state (pane->window); nemo_navigation_state_set_boolean (nav_state, NEMO_ACTION_BACK, active_slot->back_list != NULL); nemo_navigation_state_set_boolean (nav_state, NEMO_ACTION_FORWARD, active_slot->forward_list != NULL); } }