[nautilus/wip/apoos-maximus/gsoc2020: 5/29] properties-window: Add Basic tab containers to template




commit df017e6202f5051bd8bdeaf18334e192c9132f93
Author: Apoorv Sachan <apoorv 99 sachan gmail com>
Date:   Mon May 25 21:33:41 2020 +0530

    properties-window: Add Basic tab containers to template
    
    This commit obtains the outer containers of the Basic page from the
    widget template UI definition.
    
    A new GtkBox to pack the icon widget is included.
    
    The inner widgets are ported to the UI definition in the next commits.

 src/nautilus-properties-window.c               | 25 +++-----
 src/resources/ui/nautilus-properties-window.ui | 85 +++++++++++++++++++++++++-
 2 files changed, 92 insertions(+), 18 deletions(-)
---
diff --git a/src/nautilus-properties-window.c b/src/nautilus-properties-window.c
index b4dc4d762..8e5c6af65 100644
--- a/src/nautilus-properties-window.c
+++ b/src/nautilus-properties-window.c
@@ -82,6 +82,9 @@ struct _NautilusPropertiesWindow
 
     GtkNotebook *notebook;
 
+    /* Basic tab widgets */
+
+    GtkBox *image_box;
     GtkGrid *basic_grid;
 
     GtkWidget *icon_button;
@@ -3142,19 +3145,13 @@ open_in_disks (GtkButton                *button,
 }
 
 static void
-create_basic_page (NautilusPropertiesWindow *window)
+setup_basic_page (NautilusPropertiesWindow *window)
 {
     GtkGrid *grid;
     GtkWidget *icon_pixmap_widget;
     GtkWidget *volume_usage;
-    GtkWidget *hbox, *vbox;
     GtkWidget *button;
 
-    hbox = create_page_with_box (window->notebook,
-                                 GTK_ORIENTATION_HORIZONTAL,
-                                 _("Basic"),
-                                 "help:gnome-help/nautilus-file-properties-basic");
-
     /* Icon pixmap */
 
     icon_pixmap_widget = create_image_widget (
@@ -3162,19 +3159,13 @@ create_basic_page (NautilusPropertiesWindow *window)
     gtk_widget_set_valign (icon_pixmap_widget, GTK_ALIGN_START);
     gtk_widget_show (icon_pixmap_widget);
 
-    gtk_box_pack_start (GTK_BOX (hbox), icon_pixmap_widget, FALSE, FALSE, 0);
+    gtk_box_pack_start (window->image_box, icon_pixmap_widget, FALSE, FALSE, 0);
 
     window->icon_chooser = NULL;
 
     /* Grid */
 
-    vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
-    gtk_widget_show (vbox);
-    gtk_container_add (GTK_CONTAINER (hbox), vbox);
-
-    grid = GTK_GRID (create_grid_with_standard_properties ());
-    gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET (grid), FALSE, FALSE, 0);
-    window->basic_grid = grid;
+    grid = window->basic_grid;
 
     /* Name label.  The text will be determined in update_name_field */
     window->name_label = attach_title_field (grid, NULL);
@@ -5131,7 +5122,7 @@ create_properties_window (StartupData *startup_data)
     }
 
     /* Create the pages. */
-    create_basic_page (window);
+    setup_basic_page (window);
 
     if (should_show_permissions (window))
     {
@@ -5788,6 +5779,8 @@ nautilus_properties_window_class_init (NautilusPropertiesWindowClass *klass)
     gtk_widget_class_set_template_from_resource (widget_class, 
"/org/gnome/nautilus/ui/nautilus-properties-window.ui");
 
     gtk_widget_class_bind_template_child (widget_class, NautilusPropertiesWindow, notebook);
+    gtk_widget_class_bind_template_child (widget_class, NautilusPropertiesWindow, image_box);
+    gtk_widget_class_bind_template_child (widget_class, NautilusPropertiesWindow, basic_grid);
 }
 
 static void
diff --git a/src/resources/ui/nautilus-properties-window.ui b/src/resources/ui/nautilus-properties-window.ui
index 22bda2da6..5b6a62f34 100644
--- a/src/resources/ui/nautilus-properties-window.ui
+++ b/src/resources/ui/nautilus-properties-window.ui
@@ -19,10 +19,91 @@
             <property name="can_focus">True</property>
             <property name="show_border">False</property>
             <child>
-              <placeholder/>
+              <object class="GtkBox" id="basic_box">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="border_width">12</property>
+                <property name="spacing">12</property>
+                <child>
+                  <object class="GtkBox" id="image_box">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="orientation">vertical</property>
+                    <child>
+                      <placeholder/>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkBox" id="grid_box">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="orientation">vertical</property>
+                    <child>
+                      <object class="GtkGrid" id="basic_grid">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="border_width">6</property>
+                        <property name="orientation">vertical</property>
+                        <property name="row_spacing">6</property>
+                        <property name="column_spacing">12</property>
+                        <child>
+                          <placeholder/>
+                        </child>
+                        <child>
+                          <placeholder/>
+                        </child>
+                        <child>
+                          <placeholder/>
+                        </child>
+                        <child>
+                          <placeholder/>
+                        </child>
+                        <child>
+                          <placeholder/>
+                        </child>
+                        <child>
+                          <placeholder/>
+                        </child>
+                        <child>
+                          <placeholder/>
+                        </child>
+                        <child>
+                          <placeholder/>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="tab_expand">True</property>
+              </packing>
             </child>
             <child type="tab">
-              <placeholder/>
+              <object class="GtkLabel" id="basic_label">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Basic</property>
+              </object>
+              <packing>
+                <property name="tab_fill">False</property>
+              </packing>
             </child>
             <child>
               <placeholder/>


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