[gnome-builder/wip/gtk4-port: 118/343] libide/gui: remove unused bits from primary workspace




commit df0f512e17addfd7243d8acb40293e98fa81d93a
Author: Christian Hergert <chergert redhat com>
Date:   Tue Mar 29 00:36:12 2022 -0700

    libide/gui: remove unused bits from primary workspace

 src/libide/gui/ide-primary-workspace.c  | 33 ++-------------------------
 src/libide/gui/ide-primary-workspace.ui | 40 +++------------------------------
 2 files changed, 5 insertions(+), 68 deletions(-)
---
diff --git a/src/libide/gui/ide-primary-workspace.c b/src/libide/gui/ide-primary-workspace.c
index 1a7ca43c8..cd45e88ff 100644
--- a/src/libide/gui/ide-primary-workspace.c
+++ b/src/libide/gui/ide-primary-workspace.c
@@ -28,7 +28,6 @@
 #include "ide-omni-bar.h"
 #include "ide-primary-workspace.h"
 #include "ide-run-button.h"
-#include "ide-surface.h"
 #include "ide-window-settings-private.h"
 
 /**
@@ -44,8 +43,6 @@
  * when opening a project.
  *
  * Returns: (transfer full): an #IdePrimaryWorkspace
- *
- * Since: 3.32
  */
 
 struct _IdePrimaryWorkspace
@@ -54,10 +51,8 @@ struct _IdePrimaryWorkspace
 
   /* Template widgets */
   IdeHeaderBar       *header_bar;
-  DzlMenuButton      *surface_menu_button;
   IdeRunButton       *run_button;
   GtkLabel           *project_title;
-  DzlShortcutTooltip *search_tooltip;
 };
 
 G_DEFINE_FINAL_TYPE (IdePrimaryWorkspace, ide_primary_workspace, IDE_TYPE_WORKSPACE)
@@ -80,32 +75,11 @@ ide_primary_workspace_context_set (IdeWorkspace *workspace,
   project_info = ide_workbench_get_project_info (workbench);
 
   if (project_info)
-    g_object_bind_property (project_info, "name", self->project_title, "label",
+    g_object_bind_property (project_info, "name",
+                            self->project_title, "label",
                             G_BINDING_SYNC_CREATE);
 }
 
-static void
-ide_primary_workspace_surface_set (IdeWorkspace *workspace,
-                                   IdeSurface   *surface)
-{
-  IdePrimaryWorkspace *self = (IdePrimaryWorkspace *)workspace;
-
-  g_assert (IDE_IS_PRIMARY_WORKSPACE (self));
-  g_assert (!surface || IDE_IS_SURFACE (surface));
-
-  if (DZL_IS_DOCK_ITEM (surface))
-    {
-      g_autofree gchar *icon_name = NULL;
-
-      icon_name = dzl_dock_item_get_icon_name (DZL_DOCK_ITEM (surface));
-      g_object_set (self->surface_menu_button,
-                    "icon-name", icon_name,
-                    NULL);
-    }
-
-  IDE_WORKSPACE_CLASS (ide_primary_workspace_parent_class)->surface_set (workspace, surface);
-}
-
 static void
 ide_primary_workspace_class_init (IdePrimaryWorkspaceClass *klass)
 {
@@ -114,15 +88,12 @@ ide_primary_workspace_class_init (IdePrimaryWorkspaceClass *klass)
 
   ide_workspace_class_set_kind (workspace_class, "primary");
 
-  workspace_class->surface_set = ide_primary_workspace_surface_set;
   workspace_class->context_set = ide_primary_workspace_context_set;
 
   gtk_widget_class_set_template_from_resource (widget_class, 
"/org/gnome/libide-gui/ui/ide-primary-workspace.ui");
   gtk_widget_class_bind_template_child (widget_class, IdePrimaryWorkspace, header_bar);
   gtk_widget_class_bind_template_child (widget_class, IdePrimaryWorkspace, project_title);
   gtk_widget_class_bind_template_child (widget_class, IdePrimaryWorkspace, run_button);
-  gtk_widget_class_bind_template_child (widget_class, IdePrimaryWorkspace, search_tooltip);
-  gtk_widget_class_bind_template_child (widget_class, IdePrimaryWorkspace, surface_menu_button);
 
   g_type_ensure (IDE_TYPE_RUN_BUTTON);
 }
diff --git a/src/libide/gui/ide-primary-workspace.ui b/src/libide/gui/ide-primary-workspace.ui
index d9dfddef4..594ad9238 100644
--- a/src/libide/gui/ide-primary-workspace.ui
+++ b/src/libide/gui/ide-primary-workspace.ui
@@ -4,33 +4,14 @@
     <child type="titlebar">
       <object class="IdeHeaderBar" id="header_bar">
         <property name="menu-id">ide-primary-workspace-menu</property>
-        <property name="show-close-button">true</property>
-        <property name="show-fullscreen-button">false</property>
-        <property name="visible">true</property>
-        <child type="left">
-          <object class="IdeSurfacesButton" id="surface_menu_button">
-            <property name="focus-on-click">false</property>
-            <property name="menu-id">ide-primary-workspace-surfaces-menu</property>
-            <property name="show-accels">true</property>
-            <property name="show-arrow">true</property>
-            <property name="show-icons">true</property>
-            <!-- disable transitions since they'll cause jitter with the
-                 whole surface changing below it. -->
-            <property name="transitions-enabled">false</property>
-            <property name="has-tooltip">true</property>
-            <property name="tooltip-text" translatable="yes">Switch surface</property>
-          </object>
-        </child>
         <child type="title">
           <object class="IdeOmniBar" id="omni_bar">
             <property name="halign">center</property>
             <property name="hexpand">false</property>
             <property name="hexpand-set">true</property>
-            <property name="visible">true</property>
             <child type="placeholder">
               <object class="GtkLabel" id="project_title">
                 <property name="ellipsize">end</property>
-                <property name="visible">true</property>
                 <property name="xalign">0.0</property>
               </object>
             </child>
@@ -38,38 +19,23 @@
         </child>
         <child type="right-of-center">
           <object class="IdeRunButton" id="run_button">
-            <property name="visible">true</property>
           </object>
         </child>
         <child type="right">
-          <object class="IdeSearchButton" id="search_button">
-            <property name="visible">true</property>
-            <child internal-child="entry">
-              <object class="DzlSuggestionEntry">
-                <property name="max-width-chars">20</property>
-              </object>
-            </child>
+          <object class="GtkButton" id="search_button">
+            <property name="icon-name">edit-find-symbolic</property>
           </object>
         </child>
         <child type="right">
           <object class="GtkRevealer">
             <property name="reveal-child">false</property>
             <property name="transition-type">slide-left</property>
-            <property name="visible">true</property>
             <child>
-              <object class="IdeNotificationsButton" id="notifications_button">
-                <property name="show-theatric">false</property>
-                <property name="visible">true</property>
-              </object>
+              <object class="IdeNotificationsButton" id="notifications_button"/>
             </child>
           </object>
         </child>
       </object>
     </child>
   </template>
-  <object class="DzlShortcutTooltip" id="search_tooltip">
-    <property name="title" translatable="yes">Search your project</property>
-    <property name="command-id">org.gnome.builder.workspace.global-search</property>
-    <property name="widget">search_button</property>
-  </object>
 </interface>


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