mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Bug 796945 - Search Search Criteria window does not scroll when added criteria exceed a certain amount
Add the criteria grid to a viewport and scroll window as suggested in bug report. Also needed to add the hiding of the new scroll window as required.
This commit is contained in:
@@ -73,6 +73,7 @@ struct _GNCSearchWindow
|
||||
GtkWidget *grouping_combo;
|
||||
GtkWidget *match_all_label;
|
||||
GtkWidget *criteria_table;
|
||||
GtkWidget *criteria_scroll_window;
|
||||
GtkWidget *result_hbox;
|
||||
|
||||
/* The "results" sub-window widgets */
|
||||
@@ -548,6 +549,7 @@ static void
|
||||
gnc_search_dialog_reset_widgets (GNCSearchWindow *sw)
|
||||
{
|
||||
gboolean sens = (sw->q != NULL);
|
||||
gboolean crit_list_vis = FALSE;
|
||||
|
||||
gtk_widget_set_sensitive(GTK_WIDGET(sw->narrow_rb), sens);
|
||||
gtk_widget_set_sensitive(GTK_WIDGET(sw->add_rb), sens);
|
||||
@@ -560,17 +562,12 @@ gnc_search_dialog_reset_widgets (GNCSearchWindow *sw)
|
||||
}
|
||||
|
||||
if (sw->crit_list)
|
||||
{
|
||||
gtk_widget_set_sensitive(sw->grouping_combo, TRUE);
|
||||
gtk_widget_hide(sw->match_all_label);
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_widget_set_sensitive(sw->grouping_combo, FALSE);
|
||||
gtk_widget_show(sw->match_all_label);
|
||||
}
|
||||
}
|
||||
crit_list_vis = TRUE;
|
||||
|
||||
gtk_widget_set_sensitive(sw->grouping_combo, crit_list_vis);
|
||||
gtk_widget_set_visible (sw->criteria_scroll_window, crit_list_vis);
|
||||
gtk_widget_set_visible (sw->match_all_label, !crit_list_vis);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gnc_search_dialog_crit_ok (GNCSearchWindow *sw)
|
||||
@@ -691,6 +688,7 @@ remove_element (GtkWidget *button, GNCSearchWindow *sw)
|
||||
{
|
||||
gtk_widget_set_sensitive(sw->grouping_combo, FALSE);
|
||||
gtk_widget_show(sw->match_all_label);
|
||||
gtk_widget_hide(sw->criteria_scroll_window);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -986,6 +984,7 @@ gnc_search_dialog_add_criterion (GNCSearchWindow *sw)
|
||||
/* no match-all situation anymore */
|
||||
gtk_widget_set_sensitive(sw->grouping_combo, TRUE);
|
||||
gtk_widget_hide(sw->match_all_label);
|
||||
gtk_widget_show(sw->criteria_scroll_window);
|
||||
}
|
||||
/* create a new criterion element */
|
||||
new_sct = gnc_search_core_type_new_type_name
|
||||
@@ -1154,6 +1153,7 @@ gnc_search_dialog_init_widgets (GNCSearchWindow *sw, const gchar *title)
|
||||
|
||||
/* Grab the search-table widget */
|
||||
sw->criteria_table = GTK_WIDGET(gtk_builder_get_object (builder, "criteria_table"));
|
||||
sw->criteria_scroll_window = GTK_WIDGET(gtk_builder_get_object (builder, "criteria_scroll_window"));
|
||||
|
||||
/* Set the type label */
|
||||
label = GTK_WIDGET(gtk_builder_get_object (builder, "type_label"));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.20.0 -->
|
||||
<!-- Generated with glade 3.20.4 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.10"/>
|
||||
<object class="GtkDialog" id="search_dialog">
|
||||
@@ -235,36 +235,51 @@
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkGrid" id="criteria_table">
|
||||
<object class="GtkScrolledWindow" id="criteria_scroll_window">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="border_width">3</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="hscrollbar_policy">never</property>
|
||||
<property name="shadow_type">etched-in</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
<object class="GtkViewport" id="criteria_viewport">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="shadow_type">etched-in</property>
|
||||
<child>
|
||||
<object class="GtkGrid" id="criteria_table">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="border_width">3</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
@@ -284,8 +299,8 @@
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
@@ -298,6 +313,7 @@
|
||||
<object class="GtkBox" id="hboxXXX">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="valign">start</property>
|
||||
<child>
|
||||
<object class="GtkAlignment" id="alignment2">
|
||||
<property name="visible">True</property>
|
||||
@@ -441,8 +457,8 @@
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
Reference in New Issue
Block a user