summaryrefslogtreecommitdiff
path: root/src/nautilus-places-view.c
diff options
context:
space:
mode:
authorNeil Herald <neil.herald@gmail.com>2016-06-19 17:35:49 +0100
committerNeil Herald <neil.herald@gmail.com>2016-06-23 22:22:48 +0100
commit35f10147ccafd7ddea63e544aacfae81ae0d554e (patch)
treec0c4d3798af57eb48e150b8ba930a95b98f5602a /src/nautilus-places-view.c
parent0453216b8a6731d92cfcd6405c323d76c0c1182c (diff)
downloadnautilus-35f10147ccafd7ddea63e544aacfae81ae0d554e.tar.gz
view: allow view to have more control over the toolbar menu
Currently we have this menu structure: ------------------------------ 1. New Folder/New Tab/Bookmark ------------------------------ 2. Zoom controls ------------------------------ 3. Undo/Redo ------------------------------ 4. Sort options ------------------------------ 5. Other view related controls ------------------------------ The view creates 2-5, contained in a single GtkWidget - which is then passed to the toolbar via the enclosing window slot. The problem is that 3 shouldn't be created or managed by the view as the controls in that section of the menu are not related to the view. We'd like to move this responsibility back to the toolbar, but that would mean the view must pass multiple menu sections back to the toolbar (as 3 is in the middle of the other view controls). This change allows the view to pass multiple sections back to the toolbar, using the new NautilusToolbarMenuSections structure. The files view now passes 2 as a separate section to 3-5 (3 will be moved out of the view in a future commit). https://bugzilla.gnome.org/show_bug.cgi?id=764632
Diffstat (limited to 'src/nautilus-places-view.c')
-rw-r--r--src/nautilus-places-view.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/nautilus-places-view.c b/src/nautilus-places-view.c
index ed46f2059..dfe5a7fb9 100644
--- a/src/nautilus-places-view.c
+++ b/src/nautilus-places-view.c
@@ -47,7 +47,6 @@ enum {
PROP_ICON,
PROP_LOCATION,
PROP_SEARCH_QUERY,
- PROP_VIEW_WIDGET,
PROP_IS_LOADING,
PROP_IS_SEARCHING,
LAST_PROP
@@ -160,10 +159,6 @@ nautilus_places_view_get_property (GObject *object,
g_value_set_object (value, nautilus_view_get_search_query (view));
break;
- case PROP_VIEW_WIDGET:
- g_value_set_object (value, nautilus_view_get_view_widget (view));
- break;
-
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
}
@@ -280,10 +275,10 @@ nautilus_places_view_set_search_query (NautilusView *view,
g_free (text);
}
-static GtkWidget*
-nautilus_places_view_get_view_widget (NautilusView *view)
+static NautilusToolbarMenuSections *
+nautilus_places_view_get_toolbar_menu_sections (NautilusView *view)
{
- /* By returning NULL, no section will be added to the toolbar menu when this view is active */
+ /* By returning NULL, no sections will be added to the toolbar menu when this view is active */
return NULL;
}
@@ -317,7 +312,7 @@ nautilus_places_view_iface_init (NautilusViewInterface *iface)
iface->set_selection = nautilus_places_view_set_selection;
iface->get_search_query = nautilus_places_view_get_search_query;
iface->set_search_query = nautilus_places_view_set_search_query;
- iface->get_view_widget = nautilus_places_view_get_view_widget;
+ iface->get_toolbar_menu_sections = nautilus_places_view_get_toolbar_menu_sections;
iface->is_loading = nautilus_places_view_is_loading;
iface->is_searching = nautilus_places_view_is_searching;
}
@@ -336,7 +331,6 @@ nautilus_places_view_class_init (NautilusPlacesViewClass *klass)
g_object_class_override_property (object_class, PROP_IS_SEARCHING, "is-searching");
g_object_class_override_property (object_class, PROP_LOCATION, "location");
g_object_class_override_property (object_class, PROP_SEARCH_QUERY, "search-query");
- g_object_class_override_property (object_class, PROP_VIEW_WIDGET, "view-widget");
}
static void