Commit 6179996a authored by Martyn Russell's avatar Martyn Russell

tracker-needle: Don't show find-in buttons where unused

parent 939c0b71
......@@ -58,7 +58,7 @@
</packing>
</child>
<child>
<object class="GtkSeparatorToolItem" id="toolbutton2">
<object class="GtkSeparatorToolItem" id="separator_secondary">
<property name="visible">True</property>
</object>
<packing>
......
......@@ -32,6 +32,7 @@ public class TrackerNeedle {
private ToggleToolButton view_list;
private ToggleToolButton view_icons;
private ToggleToolButton view_details;
private SeparatorToolItem separator_secondary;
private ToggleToolButton find_in_contents;
private ToggleToolButton find_in_titles;
private Entry search;
......@@ -92,6 +93,8 @@ public class TrackerNeedle {
view_details = builder.get_object ("toolbutton_view_details") as ToggleToolButton;
view_details.toggled.connect (view_toggled);
separator_secondary = builder.get_object ("separator_secondary") as SeparatorToolItem;
find_in_contents = builder.get_object ("toolbutton_find_in_contents") as ToggleToolButton;
find_in_contents.toggled.connect (find_in_toggled);
......@@ -443,6 +446,7 @@ public class TrackerNeedle {
private void view_toggled () {
bool rows;
bool show_find_in;
rows = view_list.active || view_details.active;
......@@ -460,23 +464,25 @@ public class TrackerNeedle {
treeview.set_grid_lines (Gtk.TreeViewGridLines.NONE);
treeview.get_column (2).visible = false;
treeview.set_headers_visible (false);
find_in_contents.sensitive = false;
find_in_titles.sensitive = false;
show_find_in = false;
} else {
treeview.set_grid_lines (Gtk.TreeViewGridLines.VERTICAL);
treeview.get_column (2).visible = true;
treeview.set_headers_visible (true);
find_in_contents.sensitive = true;
find_in_titles.sensitive = true;
show_find_in = true;
}
} else {
sw_iconview.show_all ();
sw_treeview.hide ();
find_in_contents.sensitive = true;
find_in_titles.sensitive = true;
show_find_in = true;
debug ("View toggled to 'icons'");
}
// Show/Hide secondary widgets
separator_secondary.visible = show_find_in;
find_in_contents.visible = show_find_in;
find_in_titles.visible = show_find_in;
search_run ();
current_view = rows;
}
......
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