[nautilus/wip/apoos-maximus/gsoc2020: 54/73] properties-window: Add "Open With" page to template




commit 54b4c2750ac4902b842e2b01e448676482c3e037
Author: Apoorv Sachan <apoorv 99 sachan gmail com>
Date:   Sat Jul 4 18:59:06 2020 +0530

    properties-window: Add "Open With" page to template
    
    This commit only creates outer container of the open-with
    page. Inner widgets will be built in later commits.

 src/nautilus-properties-window.c               | 16 ++++++++--------
 src/resources/ui/nautilus-properties-window.ui | 24 ++++++++++++++++++++++++
 2 files changed, 32 insertions(+), 8 deletions(-)
---
diff --git a/src/nautilus-properties-window.c b/src/nautilus-properties-window.c
index dc80f289d..b2bf3ed67 100644
--- a/src/nautilus-properties-window.c
+++ b/src/nautilus-properties-window.c
@@ -200,6 +200,10 @@ struct _NautilusPropertiesWindow
     GtkWidget *change_permissions_button_box;
     GtkWidget *change_permissions_button;
 
+    /* Open With tab Widgets */
+
+    GtkWidget *open_with_box;
+
     GroupChange *group_change;
     OwnerChange *owner_change;
 
@@ -4995,18 +4999,12 @@ create_open_with_page (NautilusPropertiesWindow *window)
     }
 
     vbox = nautilus_mime_application_chooser_new (files, mime_type);
+    gtk_box_pack_start (GTK_BOX (window->open_with_box), vbox, TRUE, TRUE, 0);
 
-    gtk_widget_show (vbox);
+    gtk_widget_show_all (window->open_with_box);
     g_free (mime_type);
     g_list_free (files);
-
     g_object_set_data_full (G_OBJECT (vbox), "help-uri", g_strdup ("help:gnome-help/files-open"), g_free);
-    gtk_notebook_append_page (window->notebook,
-                              vbox, gtk_label_new (_("Open With")));
-    gtk_container_child_set (GTK_CONTAINER (window->notebook),
-                             vbox,
-                             "tab-expand", TRUE,
-                             NULL);
 }
 
 
@@ -5825,6 +5823,8 @@ nautilus_properties_window_class_init (NautilusPropertiesWindowClass *klass)
     gtk_widget_class_bind_template_child (widget_class, NautilusPropertiesWindow, free_value);
     gtk_widget_class_bind_template_child (widget_class, NautilusPropertiesWindow, total_capacity_value);
     gtk_widget_class_bind_template_child (widget_class, NautilusPropertiesWindow, file_system_value);
+
+    gtk_widget_class_bind_template_child (widget_class, NautilusPropertiesWindow, open_with_box);
 }
 
 static void
diff --git a/src/resources/ui/nautilus-properties-window.ui b/src/resources/ui/nautilus-properties-window.ui
index 5b9416470..67a6fbad7 100644
--- a/src/resources/ui/nautilus-properties-window.ui
+++ b/src/resources/ui/nautilus-properties-window.ui
@@ -1168,6 +1168,30 @@
                 <property name="tab_fill">False</property>
               </packing>
             </child>
+            <child>
+              <object class="GtkBox" id="open_with_box">
+                <property name="can_focus">False</property>
+                <property name="orientation">vertical</property>
+                <child>
+                  <placeholder/>
+                </child>
+              </object>
+              <packing>
+                <property name="position">2</property>
+                <property name="tab_expand">True</property>
+              </packing>
+            </child>
+            <child type="tab">
+              <object class="GtkLabel">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Open With</property>
+              </object>
+              <packing>
+                <property name="position">2</property>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
             <child>
               <placeholder/>
             </child>


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