diff options
author | Apoorv Sachan <apoorv.99.sachan@gmail.com> | 2020-07-04 18:59:06 +0530 |
---|---|---|
committer | António Fernandes <antoniojpfernandes@gmail.com> | 2020-08-05 13:48:10 +0000 |
commit | f64ea0a528b09ab67fd1d39d1f59ea31a515f0ac (patch) | |
tree | f37bf4c00e19063a28cccf095e72af61309756ca | |
parent | ed700c6fc2c5684d7c89ee95cae593d04218e66f (diff) | |
download | nautilus-f64ea0a528b09ab67fd1d39d1f59ea31a515f0ac.tar.gz |
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.
-rw-r--r-- | src/nautilus-properties-window.c | 19 | ||||
-rw-r--r-- | src/resources/ui/nautilus-properties-window.ui | 24 |
2 files changed, 33 insertions, 10 deletions
diff --git a/src/nautilus-properties-window.c b/src/nautilus-properties-window.c index c691d3a61..1224cae94 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; @@ -4971,7 +4975,7 @@ should_show_open_with (NautilusPropertiesWindow *window) } static void -create_open_with_page (NautilusPropertiesWindow *window) +setup_open_with_page (NautilusPropertiesWindow *window) { GtkWidget *vbox; char *mime_type; @@ -4995,18 +4999,11 @@ 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); 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); } @@ -5109,7 +5106,8 @@ create_properties_window (StartupData *startup_data) if (should_show_open_with (window)) { - create_open_with_page (window); + setup_open_with_page (window); + gtk_widget_show (window->open_with_box); } /* append pages from available views */ @@ -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 @@ -1168,6 +1168,30 @@ </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> <child type="tab"> |