76
80
name_renderer.yalign = 0.5f;
79
protected void connect_tree_signals () {
83
protected override void connect_tree_signals () {
80
84
tree.get_selection ().changed.connect (on_view_selection_changed);
82
tree.realize.connect ((w) => {
84
tree.columns_autosize ();
86
protected override void disconnect_tree_signals () {
87
tree.get_selection ().changed.disconnect (on_view_selection_changed);
88
90
protected override Gtk.Widget? create_view () {
131
133
tree.get_selection ().unselect_all ();
134
public override void select_path (Gtk.TreePath? path) {
136
/* Avoid using this function with "cursor_follows = true" to select large numbers of files one by one
137
* It would take an exponentially long time. Use "select_files" function in parent class.
139
public override void select_path (Gtk.TreePath? path, bool cursor_follows = false) {
135
140
if (path != null) {
136
141
var selection = tree.get_selection ();
137
/* Unlike for IconView, set_cursor unselects previously selected paths (Gtk bug?),
138
* so we have to remember them and reselect afterwards */
139
GLib.List<Gtk.TreePath> selected_paths = null;
140
selection.selected_foreach ((m, p, i) => {
141
selected_paths.prepend (p);
143
/* Ensure cursor follows last selection */
144
tree.set_cursor (path, null, false); /* This selects path but unselects rest! */
145
142
selection.select_path (path);
146
selected_paths.@foreach ((p) => {
147
selection.select_path (p);
143
if (cursor_follows) {
144
/* Unlike for IconView, set_cursor unselects previously selected paths (Gtk bug?),
145
* so we have to remember them and reselect afterwards */
146
GLib.List<Gtk.TreePath> selected_paths = null;
147
selection.selected_foreach ((m, p, i) => {
148
selected_paths.prepend (p);
150
/* Ensure cursor follows last selection */
151
tree.set_cursor (path, null, false); /* This selects path but unselects rest! */
153
selected_paths.@foreach ((p) => {
154
selection.select_path (p);
151
159
public override void unselect_path (Gtk.TreePath? path) {