From 8b793f42781b1cfbce45834e22ca914c08a6eddf Mon Sep 17 00:00:00 2001 From: Pablo Barciela Date: Wed, 23 May 2018 17:56:42 +0200 Subject: pluma-utils: remove unused 'pluma_utils_menu_position_under_tree_view' --- docs/reference/pluma-sections.txt | 1 - pluma/pluma-utils.c | 50 --------------------------------------- pluma/pluma-utils.h | 7 ------ 3 files changed, 58 deletions(-) diff --git a/docs/reference/pluma-sections.txt b/docs/reference/pluma-sections.txt index c9e9254a..e466d0de 100644 --- a/docs/reference/pluma-sections.txt +++ b/docs/reference/pluma-sections.txt @@ -698,7 +698,6 @@ IS_VALID_BOOLEAN pluma_utils_uri_has_writable_scheme pluma_utils_uri_has_file_scheme pluma_utils_menu_position_under_widget -pluma_utils_menu_position_under_tree_view pluma_gtk_button_new_with_icon pluma_dialog_add_button pluma_utils_escape_underscores diff --git a/pluma/pluma-utils.c b/pluma/pluma-utils.c index 0e37f92d..048e7fc2 100644 --- a/pluma/pluma-utils.c +++ b/pluma/pluma-utils.c @@ -152,56 +152,6 @@ pluma_utils_menu_position_under_widget (GtkMenu *menu, *push_in = TRUE; } -void -pluma_utils_menu_position_under_tree_view (GtkMenu *menu, - gint *x, - gint *y, - gboolean *push_in, - gpointer user_data) -{ - GtkTreeView *tree = GTK_TREE_VIEW (user_data); - GtkTreeModel *model; - GtkTreeSelection *selection; - GtkTreeIter iter; - - model = gtk_tree_view_get_model (tree); - g_return_if_fail (model != NULL); - - selection = gtk_tree_view_get_selection (tree); - g_return_if_fail (selection != NULL); - - if (gtk_tree_selection_get_selected (selection, NULL, &iter)) - { - GtkTreePath *path; - GdkRectangle rect; - - widget_get_origin (GTK_WIDGET (tree), x, y); - - path = gtk_tree_model_get_path (model, &iter); - gtk_tree_view_get_cell_area (tree, path, - gtk_tree_view_get_column (tree, 0), /* FIXME 0 for RTL ? */ - &rect); - gtk_tree_path_free (path); - - *x += rect.x; - *y += rect.y + rect.height; - - if (gtk_widget_get_direction (GTK_WIDGET (tree)) == GTK_TEXT_DIR_RTL) - { - GtkRequisition requisition; - gtk_widget_get_preferred_size (GTK_WIDGET (menu), NULL, &requisition); - *x += rect.width - requisition.width; - } - } - else - { - /* no selection -> regular "under widget" positioning */ - pluma_utils_menu_position_under_widget (menu, - x, y, push_in, - tree); - } -} - void menu_popup_at_treeview_selection (GtkWidget *menu, GtkWidget *treeview) diff --git a/pluma/pluma-utils.h b/pluma/pluma-utils.h index 22f03a49..7695ee5c 100644 --- a/pluma/pluma-utils.h +++ b/pluma/pluma-utils.h @@ -57,13 +57,6 @@ void pluma_utils_menu_position_under_widget (GtkMenu *menu, gboolean *push_in, gpointer user_data); -void pluma_utils_menu_position_under_tree_view - (GtkMenu *menu, - gint *x, - gint *y, - gboolean *push_in, - gpointer user_data); - void menu_popup_at_treeview_selection (GtkWidget *menu, GtkWidget *treeview); -- cgit v1.2.1