[nautilus/wip/gbsneto/actionbar-final: 2/6] view: add ::get_action_bar() vfunc
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/gbsneto/actionbar-final: 2/6] view: add ::get_action_bar() vfunc
- Date: Mon, 20 Jun 2016 15:31:47 +0000 (UTC)
commit 5b67dbf72248e3fd0e135c1af41e749781cf9c84
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Wed Mar 2 01:02:33 2016 -0300
view: add ::get_action_bar() vfunc
This will be used in the next patch so we can
access the actionbar of the view.
src/nautilus-files-view.c | 14 ++++++++++++++
src/nautilus-places-view.c | 7 +++++++
src/nautilus-view.c | 16 ++++++++++++++++
src/nautilus-view.h | 5 +++++
4 files changed, 42 insertions(+), 0 deletions(-)
---
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index c1383e9..356eb5a 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -27,6 +27,7 @@
#include "nautilus-files-view.h"
+#include "nautilus-action-bar.h"
#include "nautilus-application.h"
#include "nautilus-error-reporting.h"
#include "nautilus-floating-bar.h"
@@ -271,6 +272,9 @@ struct NautilusFilesViewDetails
GtkAdjustment *zoom_adjustment;
GtkWidget *zoom_level_scale;
+ /* Action bar */
+ GtkWidget *actionbar;
+
gulong stop_signal_handler;
gulong reload_signal_handler;
};
@@ -7808,6 +7812,12 @@ nautilus_files_view_key_press_event (GtkWidget *widget,
return GDK_EVENT_PROPAGATE;
}
+static GtkWidget*
+nautilus_files_view_get_action_bar (NautilusView *view)
+{
+ return NAUTILUS_FILES_VIEW (view)->details->actionbar;
+}
+
static NautilusQuery*
nautilus_files_view_get_search_query (NautilusView *view)
{
@@ -7910,6 +7920,7 @@ nautilus_files_view_is_loading (NautilusView *view)
static void
nautilus_files_view_iface_init (NautilusViewInterface *iface)
{
+ iface->get_action_bar = nautilus_files_view_get_action_bar;
iface->get_icon = nautilus_files_view_get_icon;
iface->get_location = nautilus_files_view_get_location;
iface->set_location = nautilus_files_view_set_location;
@@ -8123,6 +8134,9 @@ nautilus_files_view_init (NautilusFilesView *view)
gtk_container_add (GTK_CONTAINER (view->details->overlay), view->details->scrolled_window);
+ /* Actionbar */
+ view->details->actionbar = nautilus_action_bar_new (NAUTILUS_VIEW (view));
+
/* Empty states */
builder = gtk_builder_new_from_resource ("/org/gnome/nautilus/ui/nautilus-no-search-results.ui");
view->details->no_search_results_widget = GTK_WIDGET (gtk_builder_get_object (builder,
"no_search_results"));
diff --git a/src/nautilus-places-view.c b/src/nautilus-places-view.c
index 96d290e..b0094d5 100644
--- a/src/nautilus-places-view.c
+++ b/src/nautilus-places-view.c
@@ -246,6 +246,12 @@ nautilus_places_view_set_location (NautilusView *view,
}
}
+static GtkWidget*
+nautilus_places_view_get_action_bar (NautilusView *view)
+{
+ return NULL;
+}
+
static GList*
nautilus_places_view_get_selection (NautilusView *view)
{
@@ -318,6 +324,7 @@ nautilus_places_view_is_searching (NautilusView *view)
static void
nautilus_places_view_iface_init (NautilusViewInterface *iface)
{
+ iface->get_action_bar = nautilus_places_view_get_action_bar;
iface->get_icon = nautilus_places_view_get_icon;
iface->get_location = nautilus_places_view_get_location;
iface->set_location = nautilus_places_view_set_location;
diff --git a/src/nautilus-view.c b/src/nautilus-view.c
index 30f72f9..8094330 100644
--- a/src/nautilus-view.c
+++ b/src/nautilus-view.c
@@ -110,6 +110,22 @@ nautilus_view_default_init (NautilusViewInterface *iface)
}
/**
+ * nautilus_view_get_action_bar:
+ * @view: a #NautilusView
+ *
+ * Retrieves the action bar of @view.
+ *
+ * Returns: (transfer none): a #GtkWidget or %NULL.
+ */
+GtkWidget*
+nautilus_view_get_action_bar (NautilusView *view)
+{
+ g_return_val_if_fail (NAUTILUS_VIEW_GET_IFACE (view)->get_action_bar, NULL);
+
+ return NAUTILUS_VIEW_GET_IFACE (view)->get_action_bar (view);
+}
+
+/**
* nautilus_view_get_icon:
* @view: a #NautilusView
*
diff --git a/src/nautilus-view.h b/src/nautilus-view.h
index 2bc9a13..6bfa921 100644
--- a/src/nautilus-view.h
+++ b/src/nautilus-view.h
@@ -35,6 +35,9 @@ struct _NautilusViewInterface
{
GTypeInterface parent;
+ /* Action bar of the view */
+ GtkWidget* (*get_action_bar) (NautilusView *view);
+
/* The icon that represents the view */
GIcon* (*get_icon) (NautilusView *view);
@@ -66,6 +69,8 @@ struct _NautilusViewInterface
gboolean (*is_searching) (NautilusView *view);
};
+GtkWidget* nautilus_view_get_action_bar (NautilusView *view);
+
GIcon* nautilus_view_get_icon (NautilusView *view);
GtkWidget* nautilus_view_get_view_widget (NautilusView *view);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]