comparison src/view_dir.c @ 395:c359fc2c5a1f

Move common menu position callback to view_dir.c.
author zas_
date Thu, 17 Apr 2008 16:33:31 +0000
parents 4a5e1377f3d7
children a01535f52b56
comparison
equal deleted inserted replaced
394:4a5e1377f3d7 395:c359fc2c5a1f
847 G_CALLBACK(vd_dnd_drop_motion), vd); 847 G_CALLBACK(vd_dnd_drop_motion), vd);
848 g_signal_connect(G_OBJECT(vd->view), "drag_leave", 848 g_signal_connect(G_OBJECT(vd->view), "drag_leave",
849 G_CALLBACK(vd_dnd_drop_leave), vd); 849 G_CALLBACK(vd_dnd_drop_leave), vd);
850 } 850 }
851 851
852 /*
853 *----------------------------------------------------------------------------
854 * callbacks
855 *----------------------------------------------------------------------------
856 */
857
858 void vd_menu_position_cb(GtkMenu *menu, gint *x, gint *y, gboolean *push_in, gpointer data)
859 {
860 ViewDir *vd = data;
861 GtkTreeModel *store;
862 GtkTreeIter iter;
863 GtkTreePath *tpath;
864 gint cw, ch;
865
866 if (vd_find_row(vd, vd->click_fd, &iter) < 0) return;
867 store = gtk_tree_view_get_model(GTK_TREE_VIEW(vd->view));
868 tpath = gtk_tree_model_get_path(store, &iter);
869 tree_view_get_cell_clamped(GTK_TREE_VIEW(vd->view), tpath, 0, TRUE, x, y, &cw, &ch);
870 gtk_tree_path_free(tpath);
871 *y += ch;
872 popup_menu_position_clamp(menu, x, y, 0);
873 }
874