[gnome-builder] plugins/project-tree: port to GTK 4



commit 699576c43eb14ab1561e6ecfb0c1daff7224ba9b
Author: Christian Hergert <chergert redhat com>
Date:   Mon Jul 11 23:12:46 2022 -0700

    plugins/project-tree: port to GTK 4
    
     - Remove libdazzle usage
     - Use IdePane to root popovers outside the IdeTree
     - Track refactorings in libide-editor/libide-gui/etc

 src/plugins/project-tree/gbp-new-file-popover.c    |  14 +-
 src/plugins/project-tree/gbp-new-file-popover.ui   |   5 +-
 src/plugins/project-tree/gbp-project-tree-addin.c  |  78 +++----
 .../project-tree/gbp-project-tree-frame-addin.c    |   1 -
 .../project-tree/gbp-project-tree-pane-actions.c   | 233 +++++++++++++++------
 src/plugins/project-tree/gbp-project-tree-pane.c   |   2 +-
 src/plugins/project-tree/gbp-project-tree-pane.ui  |   1 -
 .../project-tree/gbp-project-tree-private.h        |   1 +
 .../gbp-project-tree-workspace-addin.c             |  51 ++---
 src/plugins/project-tree/gbp-project-tree.c        |  63 +++---
 src/plugins/project-tree/gbp-rename-file-popover.c |  33 +--
 .../project-tree/gbp-rename-file-popover.ui        |  11 +-
 src/plugins/project-tree/gtk/menus.ui              |  38 ++--
 .../project-tree/project-tree.gresource.xml        |   1 -
 src/plugins/project-tree/project-tree.plugin       |   1 -
 src/plugins/project-tree/themes/shared.css         |   7 -
 16 files changed, 313 insertions(+), 227 deletions(-)
---
diff --git a/src/plugins/project-tree/gbp-new-file-popover.c b/src/plugins/project-tree/gbp-new-file-popover.c
index 7f61207dc..b987c5425 100644
--- a/src/plugins/project-tree/gbp-new-file-popover.c
+++ b/src/plugins/project-tree/gbp-new-file-popover.c
@@ -66,8 +66,8 @@ gbp_new_file_popover_button_clicked (GbpNewFilePopover *self,
   if (self->directory == NULL)
     return;
 
-  path = gtk_entry_get_text (self->entry);
-  if (dzl_str_empty0 (path))
+  path = gtk_editable_get_text (GTK_EDITABLE (self->entry));
+  if (ide_str_empty0 (path))
     return;
 
   stripped = g_strstrip (g_strdup (path));
@@ -178,9 +178,9 @@ gbp_new_file_popover_entry_changed (GbpNewFilePopover *self,
 
   /* make sure to strip so that warnings (eg. "file already exists") are
    * consistents with the final behavior (creating the file). */
-  stripped = g_strstrip(g_strdup (gtk_entry_get_text (entry)));
+  stripped = g_strstrip(g_strdup (gtk_editable_get_text (GTK_EDITABLE (entry))));
 
-  gtk_widget_set_sensitive (GTK_WIDGET (self->button), !dzl_str_empty0 (stripped));
+  gtk_widget_set_sensitive (GTK_WIDGET (self->button), !ide_str_empty0 (stripped));
 
   gbp_new_file_popover_check_exists (self, self->directory, stripped);
 }
@@ -243,8 +243,6 @@ gbp_new_file_popover_get_property (GObject    *object,
  * @pspec: (in): a #ParamSpec.
  *
  * Set a given #GObject property.
- *
- * Since: 3.32
  */
 static void
 gbp_new_file_popover_set_property (GObject      *object,
@@ -372,7 +370,7 @@ gbp_new_file_popover_set_directory (GbpNewFilePopover *self,
     {
       const gchar *path;
 
-      path = gtk_entry_get_text (self->entry);
+      path = gtk_editable_get_text (GTK_EDITABLE (self->entry));
       gbp_new_file_popover_check_exists (self, directory, path);
       g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_DIRECTORY]);
     }
@@ -382,8 +380,6 @@ gbp_new_file_popover_set_directory (GbpNewFilePopover *self,
  * gbp_new_file_popover_get_directory:
  *
  * Returns: (transfer none) (nullable): a #GFile or %NULL.
- *
- * Since: 3.32
  */
 GFile *
 gbp_new_file_popover_get_directory (GbpNewFilePopover *self)
diff --git a/src/plugins/project-tree/gbp-new-file-popover.ui 
b/src/plugins/project-tree/gbp-new-file-popover.ui
index 5cbce4915..a4eacbb80 100644
--- a/src/plugins/project-tree/gbp-new-file-popover.ui
+++ b/src/plugins/project-tree/gbp-new-file-popover.ui
@@ -4,7 +4,10 @@
   <template class="GbpNewFilePopover" parent="GtkPopover">
     <child>
       <object class="GtkBox">
-        <property name="border-width">12</property>
+        <property name="margin-top">12</property>
+        <property name="margin-bottom">12</property>
+        <property name="margin-start">12</property>
+        <property name="margin-end">12</property>
         <property name="orientation">vertical</property>
         <property name="spacing">6</property>
         <property name="visible">true</property>
diff --git a/src/plugins/project-tree/gbp-project-tree-addin.c 
b/src/plugins/project-tree/gbp-project-tree-addin.c
index aa879cb08..cf062d3ea 100644
--- a/src/plugins/project-tree/gbp-project-tree-addin.c
+++ b/src/plugins/project-tree/gbp-project-tree-addin.c
@@ -22,8 +22,8 @@
 
 #include "config.h"
 
-#include <dazzle.h>
 #include <glib/gi18n.h>
+
 #include <libide-gui.h>
 #include <libide-projects.h>
 #include <libide-tree.h>
@@ -260,7 +260,7 @@ gbp_project_tree_addin_node_activated (IdeTreeAddin *addin,
       file = ide_project_file_ref_file (project_file);
       workbench = ide_widget_get_workbench (GTK_WIDGET (tree));
 
-      ide_workbench_open_async (workbench, file, NULL, 0, NULL, NULL, NULL);
+      ide_workbench_open_async (workbench, file, NULL, 0, NULL, NULL, NULL, NULL);
 
       return TRUE;
     }
@@ -553,14 +553,11 @@ gbp_project_tree_addin_load (IdeTreeAddin *addin,
                              IdeTree      *tree,
                              IdeTreeModel *model)
 {
-  static const GtkTargetEntry drag_targets[] = {
-    { (gchar *)"GTK_TREE_MODEL_ROW", GTK_TARGET_SAME_WIDGET, 0 },
-    { (gchar *)"text/uri-list", 0, 0 },
-  };
-
   GbpProjectTreeAddin *self = (GbpProjectTreeAddin *)addin;
   IdeVcsMonitor *monitor;
   IdeWorkbench *workbench;
+  g_autoptr(GdkContentFormats) formats = NULL;
+  GdkContentFormatsBuilder *builder;
 
   g_assert (GBP_IS_PROJECT_TREE_ADDIN (self));
   g_assert (IDE_IS_TREE_MODEL (model));
@@ -583,12 +580,17 @@ gbp_project_tree_addin_load (IdeTreeAddin *addin,
                            self,
                            G_CONNECT_SWAPPED);
 
+  builder = gdk_content_formats_builder_new ();
+  gdk_content_formats_builder_add_gtype (builder, GDK_TYPE_FILE_LIST);
+  gdk_content_formats_builder_add_gtype (builder, GTK_TYPE_TREE_ROW_DATA);
+  formats = gdk_content_formats_builder_free_to_formats (builder);
+
   gtk_tree_view_enable_model_drag_source (GTK_TREE_VIEW (tree),
                                           GDK_BUTTON1_MASK,
-                                          drag_targets, G_N_ELEMENTS (drag_targets),
+                                          formats,
                                           GDK_ACTION_COPY | GDK_ACTION_MOVE);
   gtk_tree_view_enable_model_drag_dest (GTK_TREE_VIEW (tree),
-                                        drag_targets, G_N_ELEMENTS (drag_targets),
+                                        formats,
                                         GDK_ACTION_COPY | GDK_ACTION_MOVE);
 }
 
@@ -617,10 +619,9 @@ static gboolean
 gbp_project_tree_addin_node_droppable (IdeTreeAddin     *addin,
                                        IdeTreeNode      *drag_node,
                                        IdeTreeNode      *drop_node,
-                                       GtkSelectionData *selection)
+                                       const GValue     *value)
 {
   IdeProjectFile *drop_file = NULL;
-  g_auto(GStrv) uris = NULL;
 
   g_assert (IDE_IS_MAIN_THREAD ());
   g_assert (GBP_IS_PROJECT_TREE_ADDIN (addin));
@@ -638,9 +639,13 @@ gbp_project_tree_addin_node_droppable (IdeTreeAddin     *addin,
     return FALSE;
 
   /* We need a uri list or file node */
-  uris = gtk_selection_data_get_uris (selection);
-  if ((uris == NULL || uris[0] == NULL) && drag_node == NULL)
-    return FALSE;
+  if (G_VALUE_HOLDS (value, GDK_TYPE_FILE_LIST))
+    {
+      const GList *files = g_value_get_boxed (value);
+
+      if ((files == NULL || !G_IS_FILE (files->data)) && drag_node == NULL)
+        return FALSE;
+    }
 
   /* If we have a drag node, make sure it's a file */
   if (drag_node != NULL &&
@@ -651,23 +656,23 @@ gbp_project_tree_addin_node_droppable (IdeTreeAddin     *addin,
 }
 
 static void
-gbp_project_tree_addin_notify_progress_cb (DzlFileTransfer *transfer,
+gbp_project_tree_addin_notify_progress_cb (IdeFileTransfer *transfer,
                                            GParamSpec      *pspec,
                                            IdeNotification *notif)
 {
   g_autofree gchar *body = NULL;
-  DzlFileTransferStat stbuf;
+  IdeFileTransferStat stbuf;
   gchar count[16];
   gchar total[16];
   gdouble progress;
 
   g_assert (IDE_IS_MAIN_THREAD ());
-  g_assert (DZL_IS_FILE_TRANSFER (transfer));
+  g_assert (IDE_IS_FILE_TRANSFER (transfer));
   g_assert (IDE_IS_NOTIFICATION (notif));
 
-  dzl_file_transfer_stat (transfer, &stbuf);
+  ide_file_transfer_stat (transfer, &stbuf);
 
-  progress = dzl_file_transfer_get_progress (transfer);
+  progress = ide_file_transfer_get_progress (transfer);
   ide_notification_set_progress (notif, progress);
 
   g_snprintf (count, sizeof count, "%"G_GINT64_FORMAT, stbuf.n_files);
@@ -687,17 +692,17 @@ gbp_project_tree_addin_transfer_cb (GObject      *object,
                                     GAsyncResult *result,
                                     gpointer      user_data)
 {
-  DzlFileTransfer *transfer = (DzlFileTransfer *)object;
+  IdeFileTransfer *transfer = (IdeFileTransfer *)object;
   g_autoptr(IdeTask) task = user_data;
   g_autoptr(GError) error = NULL;
   GbpProjectTreeAddin *self;
   IdeNotification *notif;
-  DzlFileTransferStat stbuf;
+  IdeFileTransferStat stbuf;
 
   IDE_ENTRY;
 
   g_assert (IDE_IS_MAIN_THREAD ());
-  g_assert (DZL_IS_FILE_TRANSFER (transfer));
+  g_assert (IDE_IS_FILE_TRANSFER (transfer));
   g_assert (G_IS_ASYNC_RESULT (result));
   g_assert (IDE_IS_TASK (task));
 
@@ -711,7 +716,7 @@ gbp_project_tree_addin_transfer_cb (GObject      *object,
   gbp_project_tree_addin_notify_progress_cb (transfer, NULL, notif);
   ide_notification_set_progress (notif, 1.0);
 
-  if (!dzl_file_transfer_execute_finish (transfer, result, &error))
+  if (!ide_file_transfer_execute_finish (transfer, result, &error))
     {
       ide_notification_set_title (notif, _("Failed to copy files"));
       ide_notification_set_body (notif, error->message);
@@ -725,7 +730,7 @@ gbp_project_tree_addin_transfer_cb (GObject      *object,
 
       ide_notification_set_title (notif, _("Files copied"));
 
-      dzl_file_transfer_stat (transfer, &stbuf);
+      ide_file_transfer_stat (transfer, &stbuf);
       g_snprintf (count, sizeof count, "%"G_GINT64_FORMAT, stbuf.n_files_total);
       format = g_strdup_printf (ngettext ("Copied %s file", "Copied %s files", stbuf.n_files_total), count);
       ide_notification_set_body (notif, format);
@@ -807,7 +812,7 @@ static void
 gbp_project_tree_addin_node_dropped_async (IdeTreeAddin        *addin,
                                            IdeTreeNode         *drag_node,
                                            IdeTreeNode         *drop_node,
-                                           GtkSelectionData    *selection,
+                                           const GValue        *value,
                                            GdkDragAction        actions,
                                            GCancellable        *cancellable,
                                            GAsyncReadyCallback  callback,
@@ -815,16 +820,16 @@ gbp_project_tree_addin_node_dropped_async (IdeTreeAddin        *addin,
 {
   GbpProjectTreeAddin *self = (GbpProjectTreeAddin *)addin;
   g_autoptr(IdeTask) task = NULL;
-  g_autoptr(DzlFileTransfer) transfer = NULL;
+  g_autoptr(IdeFileTransfer) transfer = NULL;
   g_autoptr(GFile) src_file = NULL;
   g_autoptr(GFile) dst_dir = NULL;
   g_autoptr(IdeNotification) notif = NULL;
   g_autoptr(GPtrArray) srcs = NULL;
-  g_auto(GStrv) uris = NULL;
   IdeProjectFile *drag_file;
   IdeProjectFile *drop_file;
   IdeBufferManager *buffer_manager;
   IdeContext *context;
+  const GList *files = NULL;
 
   IDE_ENTRY;
 
@@ -836,19 +841,20 @@ gbp_project_tree_addin_node_dropped_async (IdeTreeAddin        *addin,
   task = ide_task_new (self, cancellable, callback, user_data);
   ide_task_set_source_tag (task, gbp_project_tree_addin_node_dropped_async);
 
-  if (!gbp_project_tree_addin_node_droppable (addin, drag_node, drop_node, selection))
+  if (!gbp_project_tree_addin_node_droppable (addin, drag_node, drop_node, value))
     {
       ide_task_return_boolean (task, TRUE);
       IDE_EXIT;
     }
 
   srcs = g_ptr_array_new_with_free_func (g_object_unref);
-  uris = gtk_selection_data_get_uris (selection);
+  if (G_VALUE_HOLDS (value, GDK_TYPE_FILE_LIST))
+    files = g_value_get_boxed (value);
 
-  if (uris != NULL)
+  if (files != NULL)
     {
-      for (guint i = 0; uris[i]; i++)
-        g_ptr_array_add (srcs, g_file_new_for_uri (uris[i]));
+      for (const GList *iter = files; iter; iter = iter->next)
+        g_ptr_array_add (srcs, g_object_ref (iter->data));
     }
 
   drop_file = ide_tree_node_get_item (drop_node);
@@ -866,8 +872,8 @@ gbp_project_tree_addin_node_dropped_async (IdeTreeAddin        *addin,
   dst_dir = ide_project_file_ref_file (drop_file);
   g_assert (G_IS_FILE (dst_dir));
 
-  transfer = dzl_file_transfer_new ();
-  dzl_file_transfer_set_flags (transfer, DZL_FILE_TRANSFER_FLAGS_NONE);
+  transfer = ide_file_transfer_new ();
+  ide_file_transfer_set_flags (transfer, IDE_FILE_TRANSFER_FLAGS_NONE);
   g_signal_connect_object (transfer,
                            "notify::progress",
                            G_CALLBACK (gbp_project_tree_addin_notify_progress_cb),
@@ -899,7 +905,7 @@ gbp_project_tree_addin_node_dropped_async (IdeTreeAddin        *addin,
           IDE_EXIT;
         }
 
-      dzl_file_transfer_add (transfer, source, dst_file);
+      ide_file_transfer_add (transfer, source, dst_file);
 
       /* If there are any buffers that are open with this file as an
        * ancester, then we need to rename there file to point at the
@@ -925,7 +931,7 @@ gbp_project_tree_addin_node_dropped_async (IdeTreeAddin        *addin,
   ide_notification_attach (notif, IDE_OBJECT (self->model));
   ide_task_set_task_data (task, g_object_ref (notif), g_object_unref);
 
-  dzl_file_transfer_execute_async (transfer,
+  ide_file_transfer_execute_async (transfer,
                                    G_PRIORITY_DEFAULT,
                                    cancellable,
                                    gbp_project_tree_addin_transfer_cb,
diff --git a/src/plugins/project-tree/gbp-project-tree-frame-addin.c 
b/src/plugins/project-tree/gbp-project-tree-frame-addin.c
index 70e7485ca..0a6532ab1 100644
--- a/src/plugins/project-tree/gbp-project-tree-frame-addin.c
+++ b/src/plugins/project-tree/gbp-project-tree-frame-addin.c
@@ -23,7 +23,6 @@
 #include "config.h"
 
 #include <libide-gui.h>
-#include <libide-editor.h>
 
 #include "gbp-project-tree-frame-addin.h"
 #include "gbp-project-tree-workspace-addin.h"
diff --git a/src/plugins/project-tree/gbp-project-tree-pane-actions.c 
b/src/plugins/project-tree/gbp-project-tree-pane-actions.c
index a93bae7ce..6f3bfefd4 100644
--- a/src/plugins/project-tree/gbp-project-tree-pane-actions.c
+++ b/src/plugins/project-tree/gbp-project-tree-pane-actions.c
@@ -22,9 +22,12 @@
 
 #include "config.h"
 
+#include <vte/vte.h>
+
 #include <libide-editor.h>
+
+#include <libide-gtk.h>
 #include <libide-projects.h>
-#include <vte/vte.h>
 
 #include "gbp-project-tree-private.h"
 #include "gbp-rename-file-popover.h"
@@ -73,7 +76,14 @@ new_action_completed_cb (GObject      *object,
         return;
 
       if (state->file != NULL)
-        ide_workbench_open_async (workbench, state->file, "editor", 0, NULL, NULL, NULL);
+        ide_workbench_open_async (workbench,
+                                  state->file,
+                                  "editorui",
+                                  0,
+                                  NULL,
+                                  NULL,
+                                  NULL,
+                                  NULL);
     }
 }
 
@@ -164,7 +174,7 @@ gbp_project_tree_pane_actions_new_cb (GObject      *object,
   else
     g_assert_not_reached ();
 
-  gtk_widget_destroy (GTK_WIDGET (popover));
+  gtk_popover_popdown (GTK_POPOVER (popover));
 }
 
 static void
@@ -233,10 +243,28 @@ gbp_project_tree_pane_actions_new (GbpProjectTreePane *self,
 }
 
 static void
-close_matching_pages (GtkWidget *widget,
-                      gpointer   user_data)
+rename_save_cb (GObject      *object,
+                GAsyncResult *result,
+                gpointer      user_data)
+{
+  IdeBuffer *buffer = (IdeBuffer *)object;
+  g_autoptr(IdePage) page = user_data;
+  g_autoptr(GError) error = NULL;
+
+  g_assert (IDE_IS_BUFFER (buffer));
+  g_assert (G_IS_ASYNC_RESULT (result));
+  g_assert (IDE_IS_PAGE (page));
+
+  if (!ide_buffer_save_file_finish (buffer, result, &error))
+    g_warning ("Failed to save file before rename: %s", error->message);
+
+  panel_widget_close (PANEL_WIDGET (page));
+}
+
+static void
+close_matching_pages (IdePage  *page,
+                      gpointer  user_data)
 {
-  IdePage *page = (IdePage *)widget;
   GFile *file = user_data;
   GFile *this_file;
 
@@ -246,46 +274,59 @@ close_matching_pages (GtkWidget *widget,
   if (!IDE_IS_EDITOR_PAGE (page))
     return;
 
-  this_file = ide_editor_page_get_file (IDE_EDITOR_PAGE (page));
-  if (this_file == NULL)
+  if (!(this_file = ide_editor_page_get_file (IDE_EDITOR_PAGE (page))))
     return;
 
   if (g_file_equal (this_file, file))
     {
       IdeBuffer *buffer = ide_editor_page_get_buffer (IDE_EDITOR_PAGE (page));
-      ide_buffer_save_file_async (buffer, NULL, NULL, NULL, NULL, NULL);
-      gtk_widget_destroy (widget);
+      ide_buffer_save_file_async (buffer, NULL, NULL,
+                                  NULL,
+                                  rename_save_cb,
+                                  g_object_ref (page));
     }
 }
 
-#define DEFINE_ACTION_HANDLER(short_name, BODY)                       \
-static void                                                           \
-gbp_project_tree_pane_actions_##short_name (GSimpleAction *action,    \
-                                            GVariant      *param,     \
-                                            gpointer       user_data) \
-{                                                                     \
-  GbpProjectTreePane *self = user_data;                               \
-                                                                      \
-  g_assert (G_IS_SIMPLE_ACTION (action));                             \
-  g_assert (GBP_IS_PROJECT_TREE_PANE (self));                         \
-                                                                      \
-  BODY                                                                \
-}
+static void
+gbp_project_tree_pane_actions_new_file (GSimpleAction *action,
+                                        GVariant      *param,
+                                        gpointer       user_data)
+{
+  GbpProjectTreePane *self = user_data;
+
+  g_assert (G_IS_SIMPLE_ACTION (action));
+  g_assert (GBP_IS_PROJECT_TREE_PANE (self));
 
-DEFINE_ACTION_HANDLER (new_file, {
   gbp_project_tree_pane_actions_new (self, G_FILE_TYPE_REGULAR);
-});
+}
+
+static void
+gbp_project_tree_pane_actions_new_folder (GSimpleAction *action,
+                                          GVariant      *param,
+                                          gpointer       user_data)
+{
+  GbpProjectTreePane *self = user_data;
+
+  g_assert (G_IS_SIMPLE_ACTION (action));
+  g_assert (GBP_IS_PROJECT_TREE_PANE (self));
 
-DEFINE_ACTION_HANDLER (new_folder, {
   gbp_project_tree_pane_actions_new (self, G_FILE_TYPE_DIRECTORY);
-});
+}
 
-DEFINE_ACTION_HANDLER (open, {
+static void
+gbp_project_tree_pane_actions_open (GSimpleAction *action,
+                                    GVariant      *param,
+                                    gpointer       user_data)
+{
+  GbpProjectTreePane *self = user_data;
   IdeProjectFile *project_file;
   g_autoptr(GFile) file = NULL;
   IdeWorkbench *workbench;
   IdeTreeNode *selected;
 
+  g_assert (G_IS_SIMPLE_ACTION (action));
+  g_assert (GBP_IS_PROJECT_TREE_PANE (self));
+
   if (!(selected = ide_tree_get_selected_node (self->tree)) ||
       !ide_tree_node_holds (selected, IDE_TYPE_PROJECT_FILE) ||
       !(project_file = ide_tree_node_get_item (selected)))
@@ -298,8 +339,11 @@ DEFINE_ACTION_HANDLER (open, {
                             file,
                             NULL,
                             IDE_BUFFER_OPEN_FLAGS_NONE,
-                            NULL, NULL, NULL);
-});
+                            NULL,
+                            NULL,
+                            NULL,
+                            NULL);
+}
 
 static void
 gbp_project_tree_pane_actions_rename_cb (GObject      *object,
@@ -334,7 +378,7 @@ gbp_project_tree_pane_actions_rename_display_cb (GObject      *object,
   g_assert (GBP_IS_PROJECT_TREE_PANE (self));
 
   if (!(dst = gbp_rename_file_popover_display_finish (popover, result, &error)))
-    goto destroy;
+    goto done;
 
   src = gbp_rename_file_popover_get_file (popover);
   context = ide_widget_get_context (GTK_WIDGET (self));
@@ -347,11 +391,16 @@ gbp_project_tree_pane_actions_rename_display_cb (GObject      *object,
                                  gbp_project_tree_pane_actions_rename_cb,
                                  g_object_ref (self));
 
-destroy:
-  gtk_widget_destroy (GTK_WIDGET (popover));
+done:
+  gtk_popover_popdown (GTK_POPOVER (popover));
 }
 
-DEFINE_ACTION_HANDLER (rename, {
+static void
+gbp_project_tree_pane_actions_rename (GSimpleAction *action,
+                                      GVariant      *param,
+                                      gpointer       user_data)
+{
+  GbpProjectTreePane *self = user_data;
   IdeProjectFile *project_file;
   g_autoptr(GFile) file = NULL;
   GbpRenameFilePopover *popover;
@@ -359,6 +408,9 @@ DEFINE_ACTION_HANDLER (rename, {
   IdeTreeNode *selected;
   gboolean is_dir;
 
+  g_assert (G_IS_SIMPLE_ACTION (action));
+  g_assert (GBP_IS_PROJECT_TREE_PANE (self));
+
   if (!(selected = ide_tree_get_selected_node (self->tree)) ||
       !ide_tree_node_holds (selected, IDE_TYPE_PROJECT_FILE) ||
       !(project_file = ide_tree_node_get_item (selected)))
@@ -381,7 +433,7 @@ DEFINE_ACTION_HANDLER (rename, {
                                          NULL,
                                          gbp_project_tree_pane_actions_rename_display_cb,
                                          g_object_ref (self));
-});
+}
 
 static void
 gbp_project_tree_pane_actions_trash_cb (GObject      *object,
@@ -405,12 +457,20 @@ gbp_project_tree_pane_actions_trash_cb (GObject      *object,
     ide_tree_node_remove (parent, node);
 }
 
-DEFINE_ACTION_HANDLER (trash, {
+static void
+gbp_project_tree_pane_actions_trash (GSimpleAction *action,
+                                     GVariant      *param,
+                                     gpointer       user_data)
+{
+  GbpProjectTreePane *self = user_data;
   IdeProjectFile *project_file;
   g_autoptr(GFile) file = NULL;
   IdeWorkbench *workbench;
   IdeTreeNode *selected;
 
+  g_assert (G_IS_SIMPLE_ACTION (action));
+  g_assert (GBP_IS_PROJECT_TREE_PANE (self));
+
   if (!(selected = ide_tree_get_selected_node (self->tree)) ||
       !ide_tree_node_holds (selected, IDE_TYPE_PROJECT_FILE) ||
       !(project_file = ide_tree_node_get_item (selected)))
@@ -424,29 +484,45 @@ DEFINE_ACTION_HANDLER (trash, {
                                 NULL,
                                 gbp_project_tree_pane_actions_trash_cb,
                                 g_object_ref (selected));
-});
+}
 
-DEFINE_ACTION_HANDLER (open_containing_folder, {
+static void
+gbp_project_tree_pane_actions_open_containing_folder (GSimpleAction *action,
+                                                      GVariant      *param,
+                                                      gpointer       user_data)
+{
+  GbpProjectTreePane *self = user_data;
   IdeProjectFile *project_file;
   g_autoptr(GFile) file = NULL;
   IdeTreeNode *selected;
 
+  g_assert (G_IS_SIMPLE_ACTION (action));
+  g_assert (GBP_IS_PROJECT_TREE_PANE (self));
+
   if (!(selected = ide_tree_get_selected_node (self->tree)) ||
       !ide_tree_node_holds (selected, IDE_TYPE_PROJECT_FILE) ||
       !(project_file = ide_tree_node_get_item (selected)))
     return;
 
   file = ide_project_file_ref_file (project_file);
-  dzl_file_manager_show (file, NULL);
-});
+  ide_file_manager_show (file, NULL);
+}
 
-DEFINE_ACTION_HANDLER (open_with_hint, {
+static void
+gbp_project_tree_pane_actions_open_with_hint (GSimpleAction *action,
+                                              GVariant      *param,
+                                              gpointer       user_data)
+{
+  GbpProjectTreePane *self = user_data;
   IdeProjectFile *project_file;
   g_autoptr(GFile) file = NULL;
   IdeWorkbench *workbench;
   IdeTreeNode *selected;
   const gchar *hint;
 
+  g_assert (G_IS_SIMPLE_ACTION (action));
+  g_assert (GBP_IS_PROJECT_TREE_PANE (self));
+
   if (!(selected = ide_tree_get_selected_node (self->tree)) ||
       !ide_tree_node_holds (selected, IDE_TYPE_PROJECT_FILE) ||
       !(project_file = ide_tree_node_get_item (selected)) ||
@@ -460,8 +536,11 @@ DEFINE_ACTION_HANDLER (open_with_hint, {
                             file,
                             hint,
                             IDE_BUFFER_OPEN_FLAGS_NONE,
-                            NULL, NULL, NULL);
-});
+                            NULL,
+                            NULL,
+                            NULL,
+                            NULL);
+}
 
 /* Based on gdesktopappinfo.c in GIO */
 static gchar *
@@ -575,13 +654,31 @@ _gbp_project_tree_pane_init_actions (GbpProjectTreePane *self)
                                    self);
   g_action_map_add_action (G_ACTION_MAP (actions), ignored_action);
   g_action_map_add_action (G_ACTION_MAP (actions), sort_action);
-  gtk_widget_insert_action_group (GTK_WIDGET (self->tree),
+  gtk_widget_insert_action_group (GTK_WIDGET (self),
                                   "project-tree",
                                   G_ACTION_GROUP (actions));
 
+  self->actions = g_object_ref (G_ACTION_GROUP (actions));
+
   _gbp_project_tree_pane_update_actions (self);
 }
 
+G_GNUC_NULL_TERMINATED static void
+action_map_set (GActionMap *map,
+                const char *name,
+                const char *first_property,
+                ...)
+{
+  GAction *action;
+  va_list args;
+
+  action = g_action_map_lookup_action (map, name);
+
+  va_start (args, first_property);
+  g_object_set_valist (G_OBJECT (action), first_property, args);
+  va_end (args);
+}
+
 void
 _gbp_project_tree_pane_update_actions (GbpProjectTreePane *self)
 {
@@ -606,28 +703,28 @@ _gbp_project_tree_pane_update_actions (GbpProjectTreePane *self)
         }
     }
 
-  dzl_gtk_widget_action_set (GTK_WIDGET (self->tree), "project-tree", "new-file",
-                             "enabled", is_file,
-                             NULL);
-  dzl_gtk_widget_action_set (GTK_WIDGET (self->tree), "project-tree", "new-folder",
-                             "enabled", is_file,
-                             NULL);
-  dzl_gtk_widget_action_set (GTK_WIDGET (self->tree), "project-tree", "trash",
-                             "enabled", is_file,
-                             NULL);
-  dzl_gtk_widget_action_set (GTK_WIDGET (self->tree), "project-tree", "rename",
-                             "enabled", is_file,
-                             NULL);
-  dzl_gtk_widget_action_set (GTK_WIDGET (self->tree), "project-tree", "open",
-                             "enabled", is_file && !is_dir,
-                             NULL);
-  dzl_gtk_widget_action_set (GTK_WIDGET (self->tree), "project-tree", "open-with-hint",
-                             "enabled", is_file,
-                             NULL);
-  dzl_gtk_widget_action_set (GTK_WIDGET (self->tree), "project-tree", "open-containing-folder",
-                             "enabled", is_file,
-                             NULL);
-  dzl_gtk_widget_action_set (GTK_WIDGET (self->tree), "project-tree", "open-in-terminal",
-                             "enabled", is_file,
-                             NULL);
+  action_map_set (G_ACTION_MAP (self->actions), "new-file",
+                  "enabled", is_file,
+                  NULL);
+  action_map_set (G_ACTION_MAP (self->actions), "new-folder",
+                  "enabled", is_file,
+                  NULL);
+  action_map_set (G_ACTION_MAP (self->actions), "trash",
+                  "enabled", is_file,
+                  NULL);
+  action_map_set (G_ACTION_MAP (self->actions), "rename",
+                  "enabled", is_file,
+                  NULL);
+  action_map_set (G_ACTION_MAP (self->actions), "open",
+                  "enabled", is_file && !is_dir,
+                  NULL);
+  action_map_set (G_ACTION_MAP (self->actions), "open-with-hint",
+                  "enabled", is_file,
+                  NULL);
+  action_map_set (G_ACTION_MAP (self->actions), "open-containing-folder",
+                  "enabled", is_file,
+                  NULL);
+  action_map_set (G_ACTION_MAP (self->actions), "open-in-terminal",
+                  "enabled", is_file,
+                  NULL);
 }
diff --git a/src/plugins/project-tree/gbp-project-tree-pane.c 
b/src/plugins/project-tree/gbp-project-tree-pane.c
index 906b5c74e..3ad51a541 100644
--- a/src/plugins/project-tree/gbp-project-tree-pane.c
+++ b/src/plugins/project-tree/gbp-project-tree-pane.c
@@ -48,7 +48,7 @@ gbp_project_tree_pane_init (GbpProjectTreePane *self)
   gtk_widget_init_template (GTK_WIDGET (self));
 
   app = IDE_APPLICATION_DEFAULT;
-  menu = dzl_application_get_menu_by_id (DZL_APPLICATION (app), "project-tree-menu");
+  menu = ide_application_get_menu_by_id (IDE_APPLICATION (app), "project-tree-menu");
   ide_tree_set_context_menu (self->tree, menu);
 
   selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (self->tree));
diff --git a/src/plugins/project-tree/gbp-project-tree-pane.ui 
b/src/plugins/project-tree/gbp-project-tree-pane.ui
index b78479e86..2715ffde5 100644
--- a/src/plugins/project-tree/gbp-project-tree-pane.ui
+++ b/src/plugins/project-tree/gbp-project-tree-pane.ui
@@ -9,7 +9,6 @@
             <property name="level-indentation">16</property>
             <property name="visible">true</property>
             <style>
-              <class name="i-wanna-be-listbox"/>
               <class name="project-tree"/>
             </style>
           </object>
diff --git a/src/plugins/project-tree/gbp-project-tree-private.h 
b/src/plugins/project-tree/gbp-project-tree-private.h
index ba0aa052d..e6d814dfd 100644
--- a/src/plugins/project-tree/gbp-project-tree-private.h
+++ b/src/plugins/project-tree/gbp-project-tree-private.h
@@ -31,6 +31,7 @@ struct _GbpProjectTreePane
 {
   IdePane       parent_instance;
   IdeTree      *tree;
+  GActionGroup *actions;
   guint         has_loaded : 1;
 };
 
diff --git a/src/plugins/project-tree/gbp-project-tree-workspace-addin.c 
b/src/plugins/project-tree/gbp-project-tree-workspace-addin.c
index f7b49c708..bc45bff3f 100644
--- a/src/plugins/project-tree/gbp-project-tree-workspace-addin.c
+++ b/src/plugins/project-tree/gbp-project-tree-workspace-addin.c
@@ -23,7 +23,6 @@
 #include "config.h"
 
 #include <glib/gi18n.h>
-#include <libide-editor.h>
 #include <libide-gui.h>
 
 #include "gbp-project-tree-workspace-addin.h"
@@ -40,33 +39,25 @@ gbp_project_tree_workspace_addin_load (IdeWorkspaceAddin *addin,
                                        IdeWorkspace      *workspace)
 {
   GbpProjectTreeWorkspaceAddin *self = (GbpProjectTreeWorkspaceAddin *)addin;
-  IdeEditorSidebar *sidebar;
-  IdeSurface *surface;
+  g_autoptr(IdePanelPosition) position = NULL;
 
   g_assert (GBP_IS_PROJECT_TREE_WORKSPACE_ADDIN (self));
-  g_assert (IDE_IS_PRIMARY_WORKSPACE (workspace) ||
-            IDE_IS_EDITOR_WORKSPACE (workspace));
-
-  surface = ide_workspace_get_surface_by_name (workspace, "editor");
-  g_assert (IDE_IS_EDITOR_SURFACE (surface));
-
-  sidebar = ide_editor_surface_get_sidebar (IDE_EDITOR_SURFACE (surface));
-  g_assert (IDE_IS_EDITOR_SIDEBAR (sidebar));
-
-  self->pane = g_object_new (GBP_TYPE_PROJECT_TREE_PANE,
-                             "visible", TRUE,
-                             NULL);
-  g_signal_connect (self->pane,
-                    "destroy",
-                    G_CALLBACK (gtk_widget_destroyed),
-                    &self->pane);
-  ide_editor_sidebar_add_section (sidebar,
-                                  "project-tree",
-                                  _("Project Tree"),
-                                  "view-list-symbolic",
-                                  NULL, NULL,
-                                  GTK_WIDGET (self->pane),
-                                  0);
+  g_assert (IDE_IS_WORKSPACE (workspace));
+
+  ide_pane_observe (g_object_new (GBP_TYPE_PROJECT_TREE_PANE,
+                                  "title", _("Project Tree"),
+                                  "icon-name", "view-list-symbolic",
+                                  NULL),
+                    (IdePane **)&self->pane);
+
+  position = ide_panel_position_new ();
+  ide_panel_position_set_edge (position, PANEL_DOCK_POSITION_START);
+  ide_panel_position_set_row (position, 0);
+  ide_panel_position_set_depth (position, 0);
+
+  ide_workspace_add_pane (workspace, IDE_PANE (self->pane), position);
+
+  panel_widget_raise (PANEL_WIDGET (self->pane));
 }
 
 static void
@@ -76,11 +67,9 @@ gbp_project_tree_workspace_addin_unload (IdeWorkspaceAddin *addin,
   GbpProjectTreeWorkspaceAddin *self = (GbpProjectTreeWorkspaceAddin *)addin;
 
   g_assert (GBP_IS_PROJECT_TREE_WORKSPACE_ADDIN (self));
-  g_assert (IDE_IS_PRIMARY_WORKSPACE (workspace) ||
-            IDE_IS_EDITOR_WORKSPACE (workspace));
+  g_assert (IDE_IS_WORKSPACE (workspace));
 
-  if (self->pane != NULL)
-    gtk_widget_destroy (GTK_WIDGET (self->pane));
+  ide_clear_pane ((IdePane **)&self->pane);
 }
 
 static void
@@ -91,7 +80,7 @@ workspace_addin_iface_init (IdeWorkspaceAddinInterface *iface)
 }
 
 G_DEFINE_FINAL_TYPE_WITH_CODE (GbpProjectTreeWorkspaceAddin, gbp_project_tree_workspace_addin, G_TYPE_OBJECT,
-                         G_IMPLEMENT_INTERFACE (IDE_TYPE_WORKSPACE_ADDIN, workspace_addin_iface_init))
+                               G_IMPLEMENT_INTERFACE (IDE_TYPE_WORKSPACE_ADDIN, workspace_addin_iface_init))
 
 static void
 gbp_project_tree_workspace_addin_class_init (GbpProjectTreeWorkspaceAddinClass *klass)
diff --git a/src/plugins/project-tree/gbp-project-tree.c b/src/plugins/project-tree/gbp-project-tree.c
index c54d08a4a..985229d9f 100644
--- a/src/plugins/project-tree/gbp-project-tree.c
+++ b/src/plugins/project-tree/gbp-project-tree.c
@@ -127,56 +127,55 @@ cleanup:
 }
 
 static void
-gbp_project_tree_hierarchy_changed (GtkWidget *widget,
-                                    GtkWidget *old_toplevel)
+gbp_project_tree_context_set (GtkWidget  *widget,
+                              IdeContext *context)
 {
   GbpProjectTree *self = (GbpProjectTree *)widget;
-  GtkWidget *toplevel;
+  g_autoptr(IdeTreeNode) root = NULL;
+  g_autoptr(IdeTreeModel) model = NULL;
+  g_autoptr(IdeTask) task = NULL;
 
   g_assert (IDE_IS_MAIN_THREAD ());
   g_assert (GBP_IS_PROJECT_TREE (self));
+  g_assert (!context || IDE_IS_CONTEXT (context));
 
-  toplevel = gtk_widget_get_toplevel (GTK_WIDGET (self));
+  if (context == NULL)
+    return;
 
-  if (IDE_IS_WORKSPACE (toplevel))
-    {
-      IdeContext *context = ide_widget_get_context (GTK_WIDGET (toplevel));
-      g_autoptr(IdeTreeNode) root = ide_tree_node_new ();
-      g_autoptr(IdeTreeModel) model = NULL;
-      g_autoptr(IdeTask) task = NULL;
+  root = ide_tree_node_new ();
 
-      model = g_object_new (IDE_TYPE_TREE_MODEL,
-                            "kind", "project-tree",
-                            "tree", self,
-                            NULL);
-      gtk_tree_view_set_model (GTK_TREE_VIEW (self), GTK_TREE_MODEL (model));
+  model = g_object_new (IDE_TYPE_TREE_MODEL,
+                        "kind", "project-tree",
+                        "tree", self,
+                        NULL);
+  gtk_tree_view_set_model (GTK_TREE_VIEW (self), GTK_TREE_MODEL (model));
 
-      ide_tree_node_set_item (root, context);
-      ide_object_append (IDE_OBJECT (context), IDE_OBJECT (model));
-      ide_tree_model_set_root (model, root);
+  ide_tree_node_set_item (root, context);
+  ide_object_append (IDE_OBJECT (context), IDE_OBJECT (model));
+  ide_tree_model_set_root (model, root);
 
-      task = ide_task_new (self, NULL, NULL, NULL);
-      ide_task_set_source_tag (task, gbp_project_tree_hierarchy_changed);
+  task = ide_task_new (self, NULL, NULL, NULL);
+  ide_task_set_source_tag (task, gbp_project_tree_context_set);
 
-      ide_tree_model_expand_async (model,
-                                   root,
-                                   NULL,
-                                   gbp_project_tree_expand_cb,
-                                   g_steal_pointer (&task));
-    }
+  ide_tree_model_expand_async (model,
+                               root,
+                               NULL,
+                               gbp_project_tree_expand_cb,
+                               g_steal_pointer (&task));
 }
 
 static void
 gbp_project_tree_class_init (GbpProjectTreeClass *klass)
 {
-  GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
-
-  widget_class->hierarchy_changed = gbp_project_tree_hierarchy_changed;
 }
 
 static void
 gbp_project_tree_init (GbpProjectTree *self)
 {
+  ide_widget_set_context_handler (GTK_WIDGET (self),
+                                  gbp_project_tree_context_set);
+
+  gtk_tree_view_set_show_expanders (GTK_TREE_VIEW (self), FALSE);
 }
 
 static IdeTreeNode *
@@ -327,11 +326,9 @@ reveal_next (Reveal *r)
                                 NULL,
                                 FALSE);
       /* We still need to grab the focus on the tree view widget as suggested
-       * by the documentation. ide_widget_reveal_and_grab() also makes the left
-       * dock show up automatically which is very nice because it avoids having
-       * to press F9 when it could have been revealed automatically.
+       * by the documentation.
        */
-      ide_widget_reveal_and_grab (GTK_WIDGET (r->tree));
+      gtk_widget_grab_focus (GTK_WIDGET (r->tree));
     }
 
 failure:
diff --git a/src/plugins/project-tree/gbp-rename-file-popover.c 
b/src/plugins/project-tree/gbp-rename-file-popover.c
index a13dd1741..80b19015a 100644
--- a/src/plugins/project-tree/gbp-rename-file-popover.c
+++ b/src/plugins/project-tree/gbp-rename-file-popover.c
@@ -85,7 +85,7 @@ gbp_rename_file_popover_set_file (GbpRenameFilePopover *self,
           label = g_strdup_printf (_("Rename %s"), name);
 
           gtk_label_set_label (self->label, label);
-          gtk_entry_set_text (self->entry, name);
+          gtk_editable_set_text (GTK_EDITABLE (self->entry), name);
         }
 
       g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_FILE]);
@@ -167,7 +167,7 @@ gbp_rename_file_popover__entry_changed (GbpRenameFilePopover *self,
   gtk_widget_set_sensitive (GTK_WIDGET (self->button), FALSE);
   gtk_label_set_label (self->message, NULL);
 
-  text = gtk_entry_get_text (entry);
+  text = gtk_editable_get_text (GTK_EDITABLE (entry));
   if (ide_str_empty0 (text))
     return;
 
@@ -214,7 +214,7 @@ select_range_in_idle_cb (GtkEntry *entry)
 
   g_assert (GTK_IS_ENTRY (entry));
 
-  name = gtk_entry_get_text (entry);
+  name = gtk_editable_get_text (GTK_EDITABLE (entry));
 
   if ((dot = strrchr (name, '.')))
     {
@@ -226,17 +226,17 @@ select_range_in_idle_cb (GtkEntry *entry)
 }
 
 static void
-gbp_rename_file_popover__entry_focus_in_event (GbpRenameFilePopover *self,
-                                               GdkEvent             *event,
-                                               GtkEntry             *entry)
+gbp_rename_file_popover__entry_focus_in_event (GbpRenameFilePopover    *self,
+                                               GtkEventControllerFocus *focus)
 {
   g_assert (GBP_IS_RENAME_FILE_POPOVER (self));
-  g_assert (GTK_IS_ENTRY (entry));
+  g_assert (GTK_IS_EVENT_CONTROLLER_FOCUS (focus));
+  g_assert (GTK_IS_ENTRY (self->entry));
 
-  gdk_threads_add_idle_full (G_PRIORITY_DEFAULT,
-                             (GSourceFunc) select_range_in_idle_cb,
-                             g_object_ref (entry),
-                             g_object_unref);
+  g_idle_add_full (G_PRIORITY_DEFAULT,
+                   (GSourceFunc) select_range_in_idle_cb,
+                   g_object_ref (self->entry),
+                   g_object_unref);
 }
 
 static void
@@ -254,7 +254,7 @@ gbp_rename_file_popover__button_clicked (GbpRenameFilePopover *self,
   g_assert (self->file != NULL);
   g_assert (G_IS_FILE (self->file));
 
-  path = gtk_entry_get_text (self->entry);
+  path = gtk_editable_get_text (GTK_EDITABLE (self->entry));
   if (ide_str_empty0 (path))
     return;
 
@@ -404,6 +404,8 @@ gbp_rename_file_popover_class_init (GbpRenameFilePopoverClass *klass)
 static void
 gbp_rename_file_popover_init (GbpRenameFilePopover *self)
 {
+  GtkEventController *controller;
+
   gtk_widget_init_template (GTK_WIDGET (self));
 
   g_signal_connect_object (self->entry,
@@ -424,11 +426,14 @@ gbp_rename_file_popover_init (GbpRenameFilePopover *self)
                            self,
                            G_CONNECT_SWAPPED);
 
-  g_signal_connect_object (self->entry,
-                           "focus-in-event",
+  controller = gtk_event_controller_focus_new ();
+  g_signal_connect_object (controller,
+                           "enter",
                            G_CALLBACK (gbp_rename_file_popover__entry_focus_in_event),
                            self,
                            G_CONNECT_SWAPPED | G_CONNECT_AFTER);
+  gtk_widget_add_controller (GTK_WIDGET (self->entry), controller);
+
 }
 
 void
diff --git a/src/plugins/project-tree/gbp-rename-file-popover.ui 
b/src/plugins/project-tree/gbp-rename-file-popover.ui
index 9da58ddc6..1d1bbf272 100644
--- a/src/plugins/project-tree/gbp-rename-file-popover.ui
+++ b/src/plugins/project-tree/gbp-rename-file-popover.ui
@@ -4,15 +4,16 @@
   <template class="GbpRenameFilePopover" parent="GtkPopover">
     <child>
       <object class="GtkBox">
-        <property name="border-width">12</property>
+        <property name="margin-top">12</property>
+        <property name="margin-bottom">12</property>
+        <property name="margin-start">12</property>
+        <property name="margin-end">12</property>
         <property name="orientation">vertical</property>
         <property name="spacing">6</property>
-        <property name="visible">true</property>
         <child>
           <object class="GtkLabel" id="label">
             <property name="label" translatable="yes">File Name</property>
             <property name="xalign">0.0</property>
-            <property name="visible">true</property>
             <attributes>
               <attribute name="weight" value="bold"/>
             </attributes>
@@ -22,11 +23,9 @@
           <object class="GtkBox">
             <property name="orientation">horizontal</property>
             <property name="spacing">9</property>
-            <property name="visible">true</property>
             <child>
               <object class="GtkEntry" id="entry">
                 <property name="width-chars">20</property>
-                <property name="visible">true</property>
               </object>
             </child>
             <child>
@@ -34,7 +33,6 @@
                 <property name="sensitive">false</property>
                 <property name="label" translatable="yes">_Rename</property>
                 <property name="use-underline">true</property>
-                <property name="visible">true</property>
                 <style>
                   <class name="destructive-action"/>
                 </style>
@@ -45,7 +43,6 @@
         <child>
           <object class="GtkLabel" id="message">
             <property name="xalign">0.0</property>
-            <property name="visible">true</property>
             <style>
               <class name="dim-label"/>
             </style>
diff --git a/src/plugins/project-tree/gtk/menus.ui b/src/plugins/project-tree/gtk/menus.ui
index 41f9a6705..ff3bc1e1b 100644
--- a/src/plugins/project-tree/gtk/menus.ui
+++ b/src/plugins/project-tree/gtk/menus.ui
@@ -33,18 +33,25 @@
           </item>
         </section>
       </submenu>
-      <item>
-        <attribute name="id">project-tree-menu-open-folder</attribute>
-        <attribute name="hidden-when">action-disabled</attribute>
+      <submenu id="project-tree-menu-open-containing-folder-menu">
         <attribute name="label" translatable="yes">Open _Containing Folder</attribute>
-        <attribute name="action">project-tree.open-containing-folder</attribute>
-      </item>
-      <item>
-        <attribute name="id">project-tree-menu-open-terminal</attribute>
-        <attribute name="hidden-when">action-disabled</attribute>
-        <attribute name="label" translatable="yes">Open in _Terminal</attribute>
-        <attribute name="action">project-tree.open-in-terminal</attribute>
-      </item>
+        <item>
+          <attribute name="id">project-tree-menu-open-folder</attribute>
+          <attribute name="hidden-when">action-disabled</attribute>
+          <attribute name="label" translatable="yes">With File _Browser…</attribute>
+          <attribute name="action">project-tree.open-containing-folder</attribute>
+        </item>
+        <item>
+          <attribute name="id">project-tree-menu-open-terminal</attribute>
+          <attribute name="hidden-when">action-disabled</attribute>
+          <attribute name="label" translatable="yes">With _Terminal…</attribute>
+          <attribute name="action">project-tree.open-in-terminal</attribute>
+        </item>
+      </submenu>
+    </section>
+    <section id="project-tree-menu-find-section">
+    </section>
+    <section id="project-tree-menu-foundry-section">
     </section>
     <section id="project-tree-menu-destructive-section">
       <item>
@@ -78,10 +85,9 @@
       </submenu>
     </section>
   </menu>
-  <menu id="ide-editor-page-document-menu">
-    <section id="ide-frame-menu-reveal">
-      <attribute name="after">editor-document-preferences-section</attribute>
-      <attribute name="before">editor-document-save-section</attribute>
+  <menu id="ide-editor-page-menu">
+    <section id="ide-editor-page-reveal-section">
+      <attribute name="before">ide-editor-page-save-section</attribute>
       <item>
         <attribute name="id">project-tree-reveal</attribute>
         <attribute name="label" translatable="yes">Reveal in Project Tree</attribute>
@@ -93,7 +99,7 @@
   <menu id="ide-source-view-popup-menu">
     <section id="ide-source-view-popup-menu-files-section">
       <item>
-        <attribute name="label" translatable="yes">Reveal File in Project _Tree</attribute>
+        <attribute name="label" translatable="yes">Reveal in Project _Tree</attribute>
         <attribute name="action">project-tree.reveal</attribute>
       </item>
     </section>
diff --git a/src/plugins/project-tree/project-tree.gresource.xml 
b/src/plugins/project-tree/project-tree.gresource.xml
index 075b14326..b170d433e 100644
--- a/src/plugins/project-tree/project-tree.gresource.xml
+++ b/src/plugins/project-tree/project-tree.gresource.xml
@@ -6,6 +6,5 @@
     <file preprocess="xml-stripblanks">gbp-new-file-popover.ui</file>
     <file preprocess="xml-stripblanks">gbp-rename-file-popover.ui</file>
     <file>project-tree.plugin</file>
-    <file>themes/shared.css</file>
   </gresource>
 </gresources>
diff --git a/src/plugins/project-tree/project-tree.plugin b/src/plugins/project-tree/project-tree.plugin
index f17aa52a7..27a68c00b 100644
--- a/src/plugins/project-tree/project-tree.plugin
+++ b/src/plugins/project-tree/project-tree.plugin
@@ -2,7 +2,6 @@
 Authors=Christian Hergert <christian hergert me>
 Builtin=true
 Copyright=Copyright © 2014-2018 Christian Hergert
-Depends=editor;
 Description=Builder's project creation wizard
 Embedded=_gbp_project_tree_register_types
 Hidden=true


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]