[nautilus/antonioffix-menus-and-popovers: 15/26] files-view: Rename compute_rename_popover_pointing_to
- From: António Fernandes <antoniof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/antonioffix-menus-and-popovers: 15/26] files-view: Rename compute_rename_popover_pointing_to
- Date: Sat, 13 Jan 2018 23:27:19 +0000 (UTC)
commit 4a252e00547102fce1535abd2e5b12daa37dabd8
Author: António Fernandes <antoniof gnome org>
Date: Sat Jan 6 19:28:34 2018 +0000
files-view: Rename compute_rename_popover_pointing_to
It will also be used to position keyboard-triggered context menus at
the selection, so give it a more general name.
Heavily based on patch from Daniel Boles at
https://bugzilla.gnome.org/show_bug.cgi?id=773154
src/nautilus-canvas-view.c | 4 ++--
src/nautilus-files-view.c | 6 +++---
src/nautilus-files-view.h | 4 +++-
src/nautilus-list-view.c | 4 ++--
src/nautilus-view-icon-controller.c | 4 ++--
5 files changed, 12 insertions(+), 10 deletions(-)
---
diff --git a/src/nautilus-canvas-view.c b/src/nautilus-canvas-view.c
index f00fa5064..7e75db072 100644
--- a/src/nautilus-canvas-view.c
+++ b/src/nautilus-canvas-view.c
@@ -935,7 +935,7 @@ nautilus_canvas_view_reveal_selection (NautilusFilesView *view)
}
static GdkRectangle *
-nautilus_canvas_view_compute_rename_popover_pointing_to (NautilusFilesView *view)
+nautilus_canvas_view_get_rectangle_for_popup (NautilusFilesView *view)
{
GArray *bounding_boxes;
GdkRectangle *bounding_box;
@@ -1496,7 +1496,7 @@ nautilus_canvas_view_class_init (NautilusCanvasViewClass *klass)
nautilus_files_view_class->clear = nautilus_canvas_view_clear;
nautilus_files_view_class->end_loading = nautilus_canvas_view_end_loading;
nautilus_files_view_class->file_changed = nautilus_canvas_view_file_changed;
- nautilus_files_view_class->compute_rename_popover_pointing_to =
nautilus_canvas_view_compute_rename_popover_pointing_to;
+ nautilus_files_view_class->get_rectangle_for_popup = nautilus_canvas_view_get_rectangle_for_popup;
nautilus_files_view_class->get_selection = nautilus_canvas_view_get_selection;
nautilus_files_view_class->get_selection_for_file_transfer = nautilus_canvas_view_get_selection;
nautilus_files_view_class->is_empty = nautilus_canvas_view_is_empty;
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index 86ead4606..e14e10303 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -1887,9 +1887,9 @@ new_folder_data_new (NautilusFilesView *directory_view,
}
static GdkRectangle *
-nautilus_files_view_compute_rename_popover_pointing_to (NautilusFilesView *view)
+nautilus_files_view_get_rectangle_for_popup (NautilusFilesView *view)
{
- return NAUTILUS_FILES_VIEW_CLASS (G_OBJECT_GET_CLASS (view))->compute_rename_popover_pointing_to (view);
+ return NAUTILUS_FILES_VIEW_CLASS (G_OBJECT_GET_CLASS (view))->get_rectangle_for_popup (view);
}
static void
@@ -1946,7 +1946,7 @@ nautilus_files_view_rename_file_popover_new (NautilusFilesView *view,
return;
}
- pointing_to = nautilus_files_view_compute_rename_popover_pointing_to (view);
+ pointing_to = nautilus_files_view_get_rectangle_for_popup (view);
priv->rename_file_controller =
nautilus_rename_file_popover_controller_new (target_file,
diff --git a/src/nautilus-files-view.h b/src/nautilus-files-view.h
index 80384f27d..1ef989e8e 100644
--- a/src/nautilus-files-view.h
+++ b/src/nautilus-files-view.h
@@ -229,7 +229,9 @@ struct _NautilusFilesViewClass {
NautilusWindow * (*get_window) (NautilusFilesView *view);
- GdkRectangle * (* compute_rename_popover_pointing_to) (NautilusFilesView *view);
+ /* Use this to point a popover or anchor a context menu to the
+ selected item(s) */
+ GdkRectangle * (* get_rectangle_for_popup) (NautilusFilesView *view);
GIcon * (* get_icon) (NautilusFilesView *view);
diff --git a/src/nautilus-list-view.c b/src/nautilus-list-view.c
index 0e2d678b3..a1f1c1b0a 100644
--- a/src/nautilus-list-view.c
+++ b/src/nautilus-list-view.c
@@ -3707,7 +3707,7 @@ nautilus_list_view_get_id (NautilusFilesView *view)
}
static GdkRectangle *
-nautilus_list_view_compute_rename_popover_pointing_to (NautilusFilesView *view)
+nautilus_list_view_get_rectangle_for_popup (NautilusFilesView *view)
{
GtkTreeSelection *selection;
GtkTreePath *path;
@@ -3786,7 +3786,7 @@ nautilus_list_view_class_init (NautilusListViewClass *class)
nautilus_files_view_class->get_view_id = nautilus_list_view_get_id;
nautilus_files_view_class->get_first_visible_file = nautilus_list_view_get_first_visible_file;
nautilus_files_view_class->scroll_to_file = list_view_scroll_to_file;
- nautilus_files_view_class->compute_rename_popover_pointing_to =
nautilus_list_view_compute_rename_popover_pointing_to;
+ nautilus_files_view_class->get_rectangle_for_popup = nautilus_list_view_get_rectangle_for_popup;
}
static void
diff --git a/src/nautilus-view-icon-controller.c b/src/nautilus-view-icon-controller.c
index 1b7007982..c070ea9f7 100644
--- a/src/nautilus-view-icon-controller.c
+++ b/src/nautilus-view-icon-controller.c
@@ -594,7 +594,7 @@ real_can_zoom_out (NautilusFilesView *files_view)
}
static GdkRectangle *
-real_compute_rename_popover_pointing_to (NautilusFilesView *files_view)
+real_get_rectangle_for_popup (NautilusFilesView *files_view)
{
NautilusViewIconController *self;
GdkRectangle *allocation;
@@ -915,7 +915,7 @@ nautilus_view_icon_controller_class_init (NautilusViewIconControllerClass *klass
files_view_class->restore_standard_zoom_level = real_restore_standard_zoom_level;
files_view_class->get_zoom_level_percentage = real_get_zoom_level_percentage;
files_view_class->is_zoom_level_default = real_is_zoom_level_default;
- files_view_class->compute_rename_popover_pointing_to = real_compute_rename_popover_pointing_to;
+ files_view_class->get_rectangle_for_popup = real_get_rectangle_for_popup;
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]