[nautilus/wip/apoos-maximus/gsoc2020: 12/25] properties-window: Add "Open With" tab to template




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

    properties-window: Add "Open With" tab to template
    
    This commit only creates outer container of the Open With tab.
    
    Inner widgets are ported in the next commit.

 src/nautilus-properties-window.c               | 15 +++++++--------
 src/resources/ui/nautilus-properties-window.ui | 24 ++++++++++++++++++++++++
 2 files changed, 31 insertions(+), 8 deletions(-)
---
diff --git a/src/nautilus-properties-window.c b/src/nautilus-properties-window.c
index b38aa61ef..904565263 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);
 }
 
 
@@ -5832,6 +5830,7 @@ nautilus_properties_window_class_init (NautilusPropertiesWindowClass *klass)
     gtk_widget_class_bind_template_child (widget_class, NautilusPropertiesWindow, spacer_8);
     gtk_widget_class_bind_template_child (widget_class, NautilusPropertiesWindow, 
change_permissions_button_box);
     gtk_widget_class_bind_template_child (widget_class, NautilusPropertiesWindow, change_permissions_button);
+    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 37a5c6315..f2caa3259 100644
--- a/src/resources/ui/nautilus-properties-window.ui
+++ b/src/resources/ui/nautilus-properties-window.ui
@@ -1167,6 +1167,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]