Merge lp:~jeremywootten/pantheon-files/fix-1086929-remake into lp:~elementary-apps/pantheon-files/trunk
- fix-1086929-remake
- Merge into trunk
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Cody Garver | ||||
Approved revision: | 1347 | ||||
Merged at revision: | 1373 | ||||
Proposed branch: | lp:~jeremywootten/pantheon-files/fix-1086929-remake | ||||
Merge into: | lp:~elementary-apps/pantheon-files/trunk | ||||
Diff against target: |
457 lines (+154/-17) 9 files modified
libcore/gof-directory-async.vala (+55/-5) libcore/gof-file.c (+1/-1) src/View/ViewContainer.vala (+1/-0) src/fm-columns-view.c (+1/-3) src/fm-directory-view.c (+14/-4) src/fm-directory-view.h (+1/-0) src/gof-window-slot.c (+75/-4) src/gof-window-slot.h (+3/-0) src/marlin-window-columns.c (+3/-0) |
||||
To merge this branch: | bzr merge lp:~jeremywootten/pantheon-files/fix-1086929-remake | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Cody Garver (community) | Approve | ||
David Gomes (community) | Needs Fixing | ||
Review via email: mp+188004@code.launchpad.net |
Commit message
Implement auto-sizing of columns in column view.
Description of the change
This is a remake of my previous branch to implement column auto-sizing in column view (currently owned by elementary Developer Community), which included a lot of extraneous formatting changes. In this branch, any changes to existing code have been minimised and it is based on a later revision of trunk. The functional code is the same as the previous branch.
David Gomes (davidgomes) wrote : | # |
Newline after diff line 37 too.
Jeremy Wootten (jeremywootten) wrote : | # |
OK. So the rule is new line after one-line if statements unless followed
by a brace?
What is the preferred way of aligning 167-169? Align under "g_strconcat"
or the opening paren or elsewhere?
On 27 September 2013 10:52, David Gomes <email address hidden> wrote:
> Review: Needs Fixing
>
> Newline after diff line 58, 82.
>
> 167-169, align those correctly.
>
> Good branch, I can confirm the core code is the same, so we can merge
> this. Plus, it's much much less code, which is good.
> --
>
> https:/
> You are the owner of lp:~jeremywootten/pantheon-files/fix-1086929-remake.
>
--
Jeremy Wootten
GPG Key ID CB585BCD
Key Fingerprint 37C0 3C2A A6D4 E45B BA7C 4328 2DF2 1882 CB58 5BCD
Jeremy Wootten (jeremywootten) wrote : | # |
Re aligning; looking again I guess you mean under the first quote (")?
On 27 September 2013 10:52, David Gomes <email address hidden> wrote:
> Review: Needs Fixing
>
> Newline after diff line 58, 82.
>
> 167-169, align those correctly.
>
> Good branch, I can confirm the core code is the same, so we can merge
> this. Plus, it's much much less code, which is good.
> --
>
> https:/
> You are the owner of lp:~jeremywootten/pantheon-files/fix-1086929-remake.
>
--
Jeremy Wootten
GPG Key ID CB585BCD
Key Fingerprint 37C0 3C2A A6D4 E45B BA7C 4328 2DF2 1882 CB58 5BCD
David Gomes (davidgomes) wrote : | # |
Regarding aligning, yes I mean under the first quote.
The rule concerning new lines is after any if, for/while/
Jeremy Wootten (jeremywootten) wrote : | # |
OK, fixed accordingly.
On 27 September 2013 11:50, David Gomes <email address hidden> wrote:
> Regarding aligning, yes I mean under the first quote.
>
> The rule concerning new lines is after any if, for/while/
> block, except if followed by another "}" (for example in the end of a class
> when you close the class and the namespace and the last function in the
> class). Be it one-line or multiple-ĺines.
> --
>
> https:/
> You are the owner of lp:~jeremywootten/pantheon-files/fix-1086929-remake.
>
--
Jeremy Wootten
GPG Key ID CB585BCD
Key Fingerprint 37C0 3C2A A6D4 E45B BA7C 4328 2DF2 1882 CB58 5BCD
Cody Garver (codygarver) wrote : | # |
I think I found a bug with this. When Trash has some amount of files in it (more than 1, or a certain size, but not sure how much), emptying causes pantheon-files to lock up.
I have experienced this twice, still trying to figure out how to reproduce.
Jeremy Wootten (jeremywootten) wrote : | # |
Just emptied my trash of 1000+ files successfully but it was fairly slow.
It could be that the longest filename (which detemines the column width)
is being updated after every deletion. I'll look into it.
On 2 October 2013 18:02, Cody Garver <email address hidden> wrote:
> I think I found a bug with this. When Trash has some amount of files in it
> (more than 1, or a certain size, but not sure how much), emptying causes
> pantheon-files to lock up.
>
> I have experienced this twice, still trying to figure out how to reproduce.
> --
>
> https:/
> You are the owner of lp:~jeremywootten/pantheon-files/fix-1086929-remake.
>
--
Jeremy Wootten
GPG Key ID CB585BCD
Key Fingerprint 37C0 3C2A A6D4 E45B BA7C 4328 2DF2 1882 CB58 5BCD
- 1346. By Jeremy Wootten
-
Merge changes from trunk rev 1351
- 1347. By Jeremy Wootten
-
Only autosize after all changes to directory done
Jeremy Wootten (jeremywootten) wrote : | # |
Hello Cody, There does seem to be an issue with deleting or copying large
numbers of files (especially image) files - it can be slow and there is no
progress information so the application appears frozen. I have pushed
another revision to this branch that only autosizes the column after all
deletions are done rather than after each deletion. Please review this
revision, thanks.
There are some other efficiencies that can be made but they are not
connected to autosizing so I have not put them in this branch.
On 2 October 2013 18:02, Cody Garver <email address hidden> wrote:
> I think I found a bug with this. When Trash has some amount of files in it
> (more than 1, or a certain size, but not sure how much), emptying causes
> pantheon-files to lock up.
>
> I have experienced this twice, still trying to figure out how to reproduce.
> --
>
> https:/
> You are the owner of lp:~jeremywootten/pantheon-files/fix-1086929-remake.
>
--
Jeremy Wootten
GPG Key ID CB585BCD
Key Fingerprint 37C0 3C2A A6D4 E45B BA7C 4328 2DF2 1882 CB58 5BCD
Cody Garver (codygarver) wrote : | # |
I gathered a big bunch of Trash to do delete tests with and found the problems I previously had with this branch are resolved.
I want to get lp:~jeremywootten/pantheon-files/fix-1178869 merged, do a point release, then merge this branch so it gets some time in trunk for extended testing.
Preview Diff
1 | === modified file 'libcore/gof-directory-async.vala' |
2 | --- libcore/gof-directory-async.vala 2013-09-11 19:36:05 +0000 |
3 | +++ libcore/gof-directory-async.vala 2013-10-09 18:52:53 +0000 |
4 | @@ -28,6 +28,8 @@ |
5 | /* we're looking for particular path keywords like *\/icons* .icons ... */ |
6 | public bool uri_contain_keypath_icons; |
7 | public int uri_keypath_size = 0; |
8 | + public string longest_file_name = ""; //for auto-sizing Miller columns |
9 | + public bool track_longest_name; |
10 | |
11 | public enum State { |
12 | NOT_LOADED, |
13 | @@ -75,7 +77,7 @@ |
14 | file = GOF.File.get (location); |
15 | file.exists = true; |
16 | cancellable = new Cancellable (); |
17 | - |
18 | + track_longest_name = false; |
19 | //query_info_async (file, file_info_available); |
20 | if (file.info == null) |
21 | file.query_update (); |
22 | @@ -139,6 +141,7 @@ |
23 | |
24 | public void load () { |
25 | cancellable.reset (); |
26 | + longest_file_name = ""; |
27 | if (state != State.LOADED) { |
28 | /* clear directory info if it's not fully loaded */ |
29 | if (state == State.LOADING) |
30 | @@ -170,22 +173,36 @@ |
31 | |
32 | bool show_hidden = Preferences.get_default ().pref_show_hidden_files; |
33 | foreach (GOF.File gof in file_hash.get_values ()) { |
34 | - if (gof.info != null && (!gof.is_hidden || show_hidden)) |
35 | + if (gof.info != null && (!gof.is_hidden || show_hidden)) { |
36 | + if (track_longest_name) |
37 | + update_longest_file_name (gof); |
38 | + |
39 | file_loaded (gof); |
40 | + } |
41 | } |
42 | done_loading (); |
43 | } |
44 | } |
45 | |
46 | + private void update_longest_file_name (GOF.File gof) { |
47 | + if (longest_file_name.length < gof.basename.length) |
48 | + longest_file_name = gof.basename; |
49 | + } |
50 | + |
51 | public void load_hiddens () { |
52 | if (state != State.LOADED) { |
53 | load (); |
54 | } else { |
55 | foreach (GOF.File gof in file_hash.get_values ()) { |
56 | - if (gof != null && gof.info != null && gof.is_hidden) |
57 | + if (gof != null && gof.info != null && gof.is_hidden) { |
58 | + if (track_longest_name) |
59 | + update_longest_file_name (gof); |
60 | + |
61 | file_loaded (gof); |
62 | + } |
63 | } |
64 | } |
65 | + done_loading (); |
66 | } |
67 | |
68 | public void update_desktop_files () { |
69 | @@ -232,6 +249,7 @@ |
70 | if (files == null) |
71 | break; |
72 | |
73 | + bool show_hidden = Preferences.get_default ().pref_show_hidden_files; |
74 | foreach (var file_info in files) { |
75 | GLib.File loc = location.get_child ((string) file_info.get_name ()); |
76 | //GOF.File gof; |
77 | @@ -244,8 +262,12 @@ |
78 | //debug ("file: %s", gof.name); |
79 | |
80 | add_to_hash_cache (gof); |
81 | - if (!gof.is_hidden || Preferences.get_default ().pref_show_hidden_files) |
82 | + if (!gof.is_hidden || show_hidden) { |
83 | + if (track_longest_name) |
84 | + update_longest_file_name (gof); |
85 | + |
86 | file_loaded (gof); |
87 | + } |
88 | |
89 | //mutex.lock (); |
90 | files_count++; |
91 | @@ -318,6 +340,11 @@ |
92 | /* add to sorted_dirs */ |
93 | sorted_dirs.insert_sorted (gof, GOF.File.compare_by_display_name); |
94 | } |
95 | + |
96 | + if (track_longest_name && gof.basename.length > longest_file_name.length) { |
97 | + longest_file_name = gof.basename; |
98 | + done_loading (); |
99 | + } |
100 | } |
101 | |
102 | private void file_info_available (GOF.File gof) { |
103 | @@ -408,8 +435,16 @@ |
104 | need_reload (); |
105 | } else { |
106 | list_fchanges.reverse (); |
107 | + bool tln = track_longest_name; |
108 | + /* do not autosize during multiple changes */ |
109 | + track_longest_name = false; |
110 | foreach (var fchange in list_fchanges) |
111 | real_directory_changed (fchange.file, null, fchange.event); |
112 | + |
113 | + if (tln) { |
114 | + track_longest_name = true; |
115 | + load (); |
116 | + } |
117 | } |
118 | } |
119 | list_fchanges_count = 0; |
120 | @@ -438,6 +473,9 @@ |
121 | } |
122 | |
123 | public static void notify_files_removed (List<GLib.File> files) { |
124 | + List<Async> dirs = null; |
125 | + bool found; |
126 | + |
127 | foreach (var loc in files) { |
128 | GOF.File gof = GOF.File.get (loc); |
129 | Async? dir = cache_lookup (gof.directory); |
130 | @@ -445,8 +483,20 @@ |
131 | if (dir != null) { |
132 | //message ("notify removed %s", gof.uri); |
133 | dir.notify_file_removed (gof); |
134 | + found = false; |
135 | + foreach (var d in dirs) { |
136 | + if (d == dir) |
137 | + found = true; |
138 | + } |
139 | + if (!found) |
140 | + dirs.append (dir); |
141 | } |
142 | } |
143 | + |
144 | + foreach (var d in dirs) { |
145 | + if (d.track_longest_name) |
146 | + d.load(); |
147 | + } |
148 | } |
149 | |
150 | public static Async from_gfile (GLib.File file) { |
151 | @@ -578,7 +628,7 @@ |
152 | return null; |
153 | } |
154 | |
155 | - private int icon_size; |
156 | + public int icon_size; |
157 | public void threaded_load_thumbnails (int size) { |
158 | try { |
159 | icon_size = size; |
160 | |
161 | === modified file 'libcore/gof-file.c' |
162 | --- libcore/gof-file.c 2013-08-10 20:20:23 +0000 |
163 | +++ libcore/gof-file.c 2013-10-09 18:52:53 +0000 |
164 | @@ -829,7 +829,7 @@ |
165 | } |
166 | |
167 | file->is_gone = TRUE; |
168 | - g_warning ("end %s", G_STRFUNC); |
169 | + //g_warning ("end %s", G_STRFUNC); |
170 | } |
171 | |
172 | static void gof_file_init (GOFFile *file) { |
173 | |
174 | === modified file 'src/View/ViewContainer.vala' |
175 | --- src/View/ViewContainer.vala 2013-07-21 04:44:33 +0000 |
176 | +++ src/View/ViewContainer.vala 2013-10-09 18:52:53 +0000 |
177 | @@ -207,6 +207,7 @@ |
178 | } |
179 | if (slot != null && slot.directory != null && slot.directory.file.exists) { |
180 | slot.directory.cancel (); |
181 | + slot.directory.track_longest_name = false; |
182 | } |
183 | |
184 | if (nview == ViewMode.MILLER) { |
185 | |
186 | === modified file 'src/fm-columns-view.c' |
187 | --- src/fm-columns-view.c 2013-09-09 03:08:16 +0000 |
188 | +++ src/fm-columns-view.c 2013-10-09 18:52:53 +0000 |
189 | @@ -79,9 +79,7 @@ |
190 | if (gof_directory_async_is_empty (dir)) |
191 | { |
192 | PangoLayout* layout = gtk_widget_create_pango_layout(GTK_WIDGET(view), NULL); |
193 | - gchar *str = g_strconcat("<span size='x-large'>", _("This folder is empty."), "</span>", NULL); |
194 | - pango_layout_set_markup (layout, str, -1); |
195 | - |
196 | + pango_layout_set_markup (layout, FM_DIRECTORY_VIEW (view)->empty_message, -1); |
197 | PangoRectangle extents; |
198 | /* Get hayout height and width */ |
199 | pango_layout_get_extents(layout, NULL, &extents); |
200 | |
201 | === modified file 'src/fm-directory-view.c' |
202 | --- src/fm-directory-view.c 2013-09-29 17:01:20 +0000 |
203 | +++ src/fm-directory-view.c 2013-10-09 18:52:53 +0000 |
204 | @@ -316,6 +316,12 @@ |
205 | g_object_get (view, "zoom-level", &zoom, NULL); |
206 | int size = marlin_zoom_level_to_icon_size (zoom); |
207 | gof_directory_async_threaded_load_thumbnails (view->details->slot->directory, size); |
208 | + /* If in Miller view, autosize the column */ |
209 | + if (view->details->slot->ready_to_autosize) |
210 | + autosize_slot (view->details->slot); |
211 | + else |
212 | + view->details->slot->ready_to_autosize = TRUE; |
213 | + |
214 | //g_signal_emit (view, signals[DIRECTORY_LOADED], 0, directory); |
215 | } |
216 | |
217 | @@ -501,6 +507,10 @@ |
218 | view->details->dir_merge_id = 0; |
219 | view->details->open_with_action_group = NULL; |
220 | view->details->open_with_merge_id = 0; |
221 | + view->empty_message = g_strconcat ("<span size='x-large'>", |
222 | + _("This folder is empty."), |
223 | + "</span>", |
224 | + NULL); |
225 | } |
226 | |
227 | static GObject* |
228 | @@ -2272,7 +2282,7 @@ |
229 | g_return_if_fail (FM_IS_DIRECTORY_VIEW (view)); |
230 | g_return_if_fail (view->model == model); |
231 | |
232 | - g_message ("%s", G_STRFUNC); |
233 | + g_debug ("%s", G_STRFUNC); |
234 | /* Get tree paths of selected files */ |
235 | selected_paths = (*FM_DIRECTORY_VIEW_GET_CLASS (view)->get_selected_paths) (view); |
236 | |
237 | @@ -2307,7 +2317,7 @@ |
238 | g_return_if_fail (FM_IS_DIRECTORY_VIEW (view)); |
239 | g_return_if_fail (view->model == model); |
240 | |
241 | - g_message ("%s", G_STRFUNC); |
242 | + g_debug ("%s", G_STRFUNC); |
243 | /* Check if there was only one file selected before the row was deleted. The |
244 | * path is set by thunar_standard_view_row_deleted() if this is the case */ |
245 | if (G_LIKELY (view->details->selection_before_delete != NULL)) |
246 | @@ -3115,7 +3125,7 @@ |
247 | void |
248 | fm_directory_view_set_active_slot (FMDirectoryView *view) |
249 | { |
250 | - g_warning ("%s %s %s", G_STRFUNC, |
251 | + g_debug ("%s %s %s", G_STRFUNC, |
252 | view->details->slot->mwcols->active_slot->directory->file->uri, |
253 | view->details->slot->directory->file->uri |
254 | ); |
255 | @@ -3124,7 +3134,7 @@ |
256 | if (view->details->slot->mwcols->active_slot == view->details->slot) |
257 | return; |
258 | |
259 | - g_warning ("%s", G_STRFUNC); |
260 | + //g_warning ("%s", G_STRFUNC); |
261 | gof_window_slot_active (view->details->slot); |
262 | |
263 | /* make sure to grab focus as right click menus don't automaticly get it */ |
264 | |
265 | === modified file 'src/fm-directory-view.h' |
266 | --- src/fm-directory-view.h 2013-08-10 20:15:26 +0000 |
267 | +++ src/fm-directory-view.h 2013-10-09 18:52:53 +0000 |
268 | @@ -65,6 +65,7 @@ |
269 | GtkCellRenderer *name_renderer; |
270 | MarlinZoomLevel zoom_level; |
271 | gboolean updates_frozen; |
272 | + const gchar* empty_message; |
273 | |
274 | FMDirectoryViewDetails *details; |
275 | }; |
276 | |
277 | === modified file 'src/gof-window-slot.c' |
278 | --- src/gof-window-slot.c 2013-08-10 20:15:26 +0000 |
279 | +++ src/gof-window-slot.c 2013-10-09 18:52:53 +0000 |
280 | @@ -46,6 +46,7 @@ |
281 | { |
282 | slot->content_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); |
283 | slot->width = 0; |
284 | + slot->ready_to_autosize = FALSE; |
285 | GOF_ABSTRACT_SLOT (slot)->extra_location_widgets = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); |
286 | gtk_box_pack_start (GTK_BOX (slot->content_box), GOF_ABSTRACT_SLOT(slot)->extra_location_widgets, FALSE, FALSE, 0); |
287 | } |
288 | @@ -89,6 +90,7 @@ |
289 | //load_dir_async_cancel(slot->directory); |
290 | g_debug ("%s %s\n", G_STRFUNC, slot->directory->file->uri); |
291 | //g_warning ("%s %s %u\n", G_STRFUNC, slot->directory->file->uri, G_OBJECT (slot->directory)->ref_count); |
292 | + g_signal_handlers_disconnect_by_data (slot->directory, slot); |
293 | g_object_unref(slot->directory); |
294 | g_object_unref(slot->location); |
295 | G_OBJECT_CLASS (parent_class)->finalize (object); |
296 | @@ -131,6 +133,68 @@ |
297 | |
298 | gtk_paned_pack1 (GTK_PANED (hpane), column, FALSE, FALSE); |
299 | gtk_paned_pack2 (GTK_PANED (hpane), box1, TRUE, FALSE); |
300 | + |
301 | + /* If the directory finished loading before slot was ready then autosize the slot now. |
302 | + * Otherwise the slot will be autosized by the directory_done_loading callback |
303 | + * This is necessary because the directory loads faster from the cache than from disk |
304 | + * On first use the directory loads from disk and we reach here before the directory |
305 | + * has finished loading. |
306 | + * On subsequent uses, the directory loads from cache before the slot is ready. |
307 | + * Whichever finishes first sets slot->ready_to_autosize = TRUE |
308 | + * Whichever finds slot->ready_to_autosize = TRUE does the autosizing. |
309 | + */ |
310 | + |
311 | + if (slot->ready_to_autosize) |
312 | + autosize_slot (slot); |
313 | + else |
314 | + slot->ready_to_autosize = TRUE; |
315 | +} |
316 | + |
317 | +void autosize_slot (GOFWindowSlot *slot) |
318 | +{ |
319 | + g_return_if_fail (GOF_IS_WINDOW_SLOT (slot)); |
320 | + g_return_if_fail (slot->view_box != NULL); |
321 | + g_return_if_fail (GTK_IS_WIDGET (slot->view_box)); |
322 | + g_return_if_fail (GOF_DIRECTORY_IS_ASYNC (slot->directory)); |
323 | + g_return_if_fail (slot->mwcols != NULL); |
324 | + |
325 | + PangoLayout* layout = gtk_widget_create_pango_layout (GTK_WIDGET (slot->view_box), NULL); |
326 | + |
327 | + if (gof_directory_async_is_empty (slot->directory)) |
328 | + pango_layout_set_markup (layout, FM_DIRECTORY_VIEW (slot->view_box)->empty_message, -1); |
329 | + else |
330 | + pango_layout_set_markup (layout, |
331 | + g_markup_escape_text (slot->directory->longest_file_name, -1), |
332 | + -1); |
333 | + |
334 | + PangoRectangle extents; |
335 | + pango_layout_get_extents (layout, NULL, &extents); |
336 | + |
337 | + gint column_width = (int) pango_units_to_double(extents.width) |
338 | + + 2 * slot->directory->icon_size |
339 | + + 2 * slot->mwcols->handle_size |
340 | + + 12; |
341 | + |
342 | + gint min_width = slot->mwcols->preferred_column_width / 2; |
343 | + |
344 | + if (column_width < min_width) |
345 | + column_width = min_width; |
346 | + else { |
347 | + //TODO make max_width a setting |
348 | + gint max_width = 2 * slot->mwcols->preferred_column_width; |
349 | + if (column_width > max_width) |
350 | + column_width = max_width; |
351 | + } |
352 | + |
353 | + if (slot->slot_number == 0) |
354 | + gtk_widget_set_size_request (gtk_paned_get_child1 (GTK_PANED (slot->hpane)), column_width, -1); |
355 | + else |
356 | + gtk_paned_set_position (GTK_PANED (slot->hpane), column_width); |
357 | + |
358 | + slot->width = column_width; |
359 | + gtk_widget_show_all (slot->mwcols->colpane); |
360 | + gtk_widget_queue_draw (slot->mwcols->colpane); |
361 | + |
362 | } |
363 | |
364 | void |
365 | @@ -157,9 +221,11 @@ |
366 | g_list_free (slot->mwcols->slot); |
367 | slot->mwcols->slot = l; |
368 | } |
369 | - slot->mwcols->total_width += slot->mwcols->preferred_column_width + 100; |
370 | + |
371 | + marlin_window_columns_add (slot->mwcols, location); |
372 | + |
373 | + slot->mwcols->total_width += slot->width + 100; |
374 | gtk_widget_set_size_request (slot->mwcols->colpane, slot->mwcols->total_width, -1); |
375 | - marlin_window_columns_add (slot->mwcols, location); |
376 | } |
377 | |
378 | GOFWindowSlot * |
379 | @@ -193,6 +259,7 @@ |
380 | gtk_box_pack_start(GTK_BOX (slot->content_box), slot->view_box, TRUE, TRUE, 0); |
381 | |
382 | marlin_view_view_container_set_content ((MarlinViewViewContainer *) slot->ctab, slot->content_box); |
383 | + slot->directory->track_longest_name = FALSE; |
384 | gof_directory_async_load (slot->directory); |
385 | } |
386 | |
387 | @@ -207,6 +274,7 @@ |
388 | "window-slot", slot, NULL)); |
389 | gtk_box_pack_start (GTK_BOX (slot->content_box), slot->view_box, TRUE, TRUE, 0); |
390 | marlin_view_view_container_set_content ((MarlinViewViewContainer *) slot->ctab, slot->content_box); |
391 | + slot->directory->track_longest_name = FALSE; |
392 | gof_directory_async_load (slot->directory); |
393 | } |
394 | |
395 | @@ -224,6 +292,7 @@ |
396 | { |
397 | slot->view_box = GTK_WIDGET (g_object_new (FM_TYPE_COLUMNS_VIEW, |
398 | "window-slot", slot, NULL)); |
399 | + slot->directory->track_longest_name = TRUE; |
400 | gof_directory_async_load (slot->directory); |
401 | } |
402 | |
403 | @@ -233,8 +302,10 @@ |
404 | { |
405 | g_return_if_fail (GOF_IS_WINDOW_SLOT (slot)); |
406 | |
407 | - if (slot->mwcols) |
408 | - marlin_window_columns_active_slot (slot->mwcols, slot); |
409 | + if (slot->mwcols != NULL) { |
410 | + marlin_window_columns_active_slot (slot->mwcols, slot); |
411 | + autosize_slot (slot); |
412 | + } |
413 | } |
414 | |
415 | void |
416 | |
417 | === modified file 'src/gof-window-slot.h' |
418 | --- src/gof-window-slot.h 2013-06-27 19:34:48 +0000 |
419 | +++ src/gof-window-slot.h 2013-10-09 18:52:53 +0000 |
420 | @@ -55,6 +55,8 @@ |
421 | |
422 | MarlinWindowColumns *mwcols; |
423 | guint width; |
424 | + guint slot_number; |
425 | + gboolean ready_to_autosize; |
426 | }; |
427 | |
428 | struct GOFWindowSlotClass { |
429 | @@ -81,5 +83,6 @@ |
430 | |
431 | void gof_window_slot_freeze_updates (GOFWindowSlot *slot); |
432 | void gof_window_slot_unfreeze_updates (GOFWindowSlot *slot); |
433 | +void autosize_slot (GOFWindowSlot *slot); |
434 | |
435 | #endif /* GOF_WINDOW_SLOT_H */ |
436 | |
437 | === modified file 'src/marlin-window-columns.c' |
438 | --- src/marlin-window-columns.c 2013-07-05 18:20:51 +0000 |
439 | +++ src/marlin-window-columns.c 2013-10-09 18:52:53 +0000 |
440 | @@ -110,6 +110,7 @@ |
441 | GOFWindowSlot *slot = mwcols->active_slot; |
442 | |
443 | gof_window_slot_make_column_view (slot); |
444 | + slot->slot_number = 0; |
445 | |
446 | mwcols->colpane = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); |
447 | slot->colpane = mwcols->colpane; |
448 | @@ -156,7 +157,9 @@ |
449 | marlin_window_columns_add (MarlinWindowColumns *mwcols, GFile *location) |
450 | { |
451 | GOFWindowSlot *slot = gof_window_slot_new (location, mwcols->ctab); |
452 | + slot->width = mwcols->preferred_column_width; |
453 | gof_window_slot_make_column_view (slot); |
454 | + slot->slot_number = mwcols->active_slot->slot_number + 1; |
455 | slot->mwcols = mwcols; |
456 | slot->colpane = mwcols->active_slot->colpane; |
457 | gof_window_column_add (slot, slot->view_box); |
Newline after diff line 58, 82.
167-169, align those correctly.
Good branch, I can confirm the core code is the same, so we can merge this. Plus, it's much much less code, which is good.