Commit 4d312be1 authored by APOORV SACHAN's avatar APOORV SACHAN 🦋

properties-window : Obtain window and notebook from template

The outer most container, GtkWindow down to GtkNotebook
have been obtained using Template. The basic and permissions
tab along with their content  are built and inserted programaically.
Basic and Permissions will be ported to use templates in future commits.
parent cb706825
Pipeline #182310 passed with stage
in 8 minutes and 24 seconds
......@@ -5047,11 +5047,8 @@ create_properties_window (StartupData *startup_data)
{
NautilusPropertiesWindow *window;
GList *l;
GtkWidget *content_box;
window = NAUTILUS_PROPERTIES_WINDOW (gtk_widget_new (NAUTILUS_TYPE_PROPERTIES_WINDOW,
"type-hint", GDK_WINDOW_TYPE_HINT_DIALOG,
"modal", TRUE,
NULL));
window->original_files = nautilus_file_list_copy (startup_data->original_files);
......@@ -5133,17 +5130,6 @@ create_properties_window (StartupData *startup_data)
0);
}
/* Create the notebook tabs. */
content_box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
window->notebook = GTK_NOTEBOOK (gtk_notebook_new ());
gtk_notebook_set_show_border (window->notebook, FALSE);
gtk_container_add (GTK_CONTAINER (window), content_box);
gtk_widget_show (GTK_WIDGET (window->notebook));
gtk_box_pack_start (GTK_BOX (content_box),
GTK_WIDGET (window->notebook),
TRUE, TRUE, 0);
gtk_widget_show (GTK_WIDGET (content_box));
/* Create the pages. */
create_basic_page (window);
......@@ -5778,19 +5764,27 @@ select_image_button_callback (GtkWidget *widget,
}
static void
nautilus_properties_window_class_init (NautilusPropertiesWindowClass *class)
nautilus_properties_window_class_init (NautilusPropertiesWindowClass *klass)
{
GtkBindingSet *binding_set;
GtkWidgetClass *widget_class;
GObjectClass *oclass;
widget_class = GTK_WIDGET_CLASS (klass);
oclass = G_OBJECT_CLASS (klass);
oclass->finalize = real_finalize;
widget_class->destroy = real_destroy;
binding_set = gtk_binding_set_by_class (klass);
gtk_binding_entry_add_signal (binding_set, GDK_KEY_Escape, 0, "close", 0);
G_OBJECT_CLASS (class)->finalize = real_finalize;
GTK_WIDGET_CLASS (class)->destroy = real_destroy;
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/nautilus/ui/nautilus-properties-window.ui");
binding_set = gtk_binding_set_by_class (class);
gtk_binding_entry_add_signal (binding_set, GDK_KEY_Escape, 0,
"close", 0);
gtk_widget_class_bind_template_child (widget_class, NautilusPropertiesWindow, notebook);
}
static void
nautilus_properties_window_init (NautilusPropertiesWindow *window)
{
gtk_widget_init_template (GTK_WIDGET (window));
}
/* fm-properties-window.h - interface for window that lets user modify
/* fm-properties-window.h - interface for window that lets user modify
icon properties
Copyright (C) 2000 Eazel, Inc.
......
......@@ -20,6 +20,7 @@
<file>gtk/help-overlay.ui</file>
<file>ui/nautilus-batch-rename-dialog.ui</file>
<file>ui/nautilus-batch-rename-dialog-menu.ui</file>
<file>ui/nautilus-properties-window.ui</file>
<file alias="gtk/ui/nautilusgtkplacesview.ui">../gtk/nautilusgtkplacesview.ui</file>
<file alias="gtk/ui/nautilusgtkplacesviewrow.ui">../gtk/nautilusgtkplacesviewrow.ui</file>
<file alias="icons/thumbnail_frame.png">../../icons/thumbnail_frame.png</file>
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.2 -->
<interface>
<requires lib="gtk+" version="3.20"/>
<template class="NautilusPropertiesWindow" parent="GtkWindow">
<property name="can_focus">False</property>
<property name="modal">True</property>
<property name="type_hint">dialog</property>
<child type="titlebar">
<placeholder/>
</child>
<child>
<object class="GtkBox" id="content_box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkNotebook" id="notebook">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="show_border">False</property>
<child>
<placeholder/>
</child>
<child type="tab">
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child type="tab">
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child type="tab">
<placeholder/>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
</object>
</child>
</template>
</interface>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment