Commit e19c39e7 authored by Paolo Borelli's avatar Paolo Borelli

Use GtkGrid in the replace dialog.

parent 1ae30a3b
......@@ -48,7 +48,7 @@
struct _GeditReplaceDialogPrivate
{
GtkWidget *table;
GtkWidget *grid;
GtkWidget *search_label;
GtkWidget *search_entry;
GtkWidget *search_text_entry;
......@@ -226,7 +226,7 @@ gedit_replace_dialog_init (GeditReplaceDialog *dlg)
root_objects,
&error_widget,
"replace_dialog_content", &content,
"table", &dlg->priv->table,
"grid", &dlg->priv->grid,
"search_label", &dlg->priv->search_label,
"replace_with_label", &dlg->priv->replace_label,
"match_case_checkbutton", &dlg->priv->match_case_checkbutton,
......@@ -251,36 +251,32 @@ gedit_replace_dialog_init (GeditReplaceDialog *dlg)
return;
}
gtk_table_set_row_spacings (GTK_TABLE (dlg->priv->table), 12);
dlg->priv->search_entry = gedit_history_entry_new ("search-for-entry",
TRUE);
dlg->priv->search_entry = gedit_history_entry_new ("search-for-entry", TRUE);
gtk_widget_set_size_request (dlg->priv->search_entry, 300, -1);
gedit_history_entry_set_escape_func
(GEDIT_HISTORY_ENTRY (dlg->priv->search_entry),
(GeditHistoryEntryEscapeFunc) gedit_utils_escape_search_text);
gtk_widget_set_hexpand (GTK_WIDGET (dlg->priv->search_entry), TRUE);
dlg->priv->search_text_entry = gedit_history_entry_get_entry
(GEDIT_HISTORY_ENTRY (dlg->priv->search_entry));
gtk_entry_set_activates_default (GTK_ENTRY (dlg->priv->search_text_entry),
TRUE);
gtk_table_attach_defaults (GTK_TABLE (dlg->priv->table),
dlg->priv->search_entry,
1, 2, 0, 1);
dlg->priv->replace_entry = gedit_history_entry_new ("replace-with-entry",
TRUE);
gtk_entry_set_activates_default (GTK_ENTRY (dlg->priv->search_text_entry), TRUE);
gtk_grid_attach_next_to (GTK_GRID (dlg->priv->grid),
dlg->priv->search_entry,
dlg->priv->search_label,
GTK_POS_RIGHT, 1, 1);
dlg->priv->replace_entry = gedit_history_entry_new ("replace-with-entry", TRUE);
gedit_history_entry_set_escape_func
(GEDIT_HISTORY_ENTRY (dlg->priv->replace_entry),
(GeditHistoryEntryEscapeFunc) gedit_utils_escape_search_text);
gtk_widget_set_hexpand (GTK_WIDGET (dlg->priv->replace_entry), TRUE);
dlg->priv->replace_text_entry = gedit_history_entry_get_entry
(GEDIT_HISTORY_ENTRY (dlg->priv->replace_entry));
gtk_entry_set_activates_default (GTK_ENTRY (dlg->priv->replace_text_entry),
TRUE);
gtk_table_attach_defaults (GTK_TABLE (dlg->priv->table),
dlg->priv->replace_entry,
1, 2, 1, 2);
gtk_entry_set_activates_default (GTK_ENTRY (dlg->priv->replace_text_entry), TRUE);
gtk_grid_attach_next_to (GTK_GRID (dlg->priv->grid),
dlg->priv->replace_entry,
dlg->priv->replace_label,
GTK_POS_RIGHT, 1, 1);
gtk_label_set_mnemonic_widget (GTK_LABEL (dlg->priv->search_label),
dlg->priv->search_entry);
......
......@@ -96,13 +96,13 @@
<property name="orientation">vertical</property>
<property name="spacing">18</property>
<child>
<object class="GtkTable" id="table">
<object class="GtkGrid" id="grid">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="row_spacing">12</property>
<property name="column_spacing">12</property>
<property name="n_rows">2</property>
<property name="n_columns">2</property>
<property name="column_spacing">12</property>
<property name="row_spacing">12</property>
<child>
<object class="GtkLabel" id="search_label">
<property name="visible">True</property>
......@@ -112,8 +112,10 @@
<property name="use_underline">True</property>
</object>
<packing>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
......@@ -125,10 +127,10 @@
<property name="use_underline">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
......@@ -158,6 +160,7 @@
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
</object>
<packing>
......@@ -174,6 +177,7 @@
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
</object>
<packing>
......@@ -190,6 +194,7 @@
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
</object>
<packing>
......@@ -206,6 +211,7 @@
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
</object>
......
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