Merge lp:~victored/pantheon-files/no-menubar into lp:~elementary-apps/pantheon-files/trunk
- no-menubar
- Merge into trunk
Proposed by
Victor Martinez
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Danielle Foré | ||||
Approved revision: | 1165 | ||||
Merged at revision: | 1191 | ||||
Proposed branch: | lp:~victored/pantheon-files/no-menubar | ||||
Merge into: | lp:~elementary-apps/pantheon-files/trunk | ||||
Diff against target: |
1667 lines (+101/-921) 11 files modified
libwidgets/Animations.vala (+2/-2) libwidgets/CMakeLists.txt (+1/-0) schemas/org.pantheon.files.gschema.xml (+0/-32) src/CMakeLists.txt (+0/-2) src/View/Chrome/TopMenu.vala (+4/-2) src/View/ContextView.vala (+0/-481) src/View/OverlayBar.vala (+13/-13) src/View/PropertiesWindow.vala (+20/-10) src/View/ViewContainer.vala (+12/-41) src/View/Window.vala (+35/-252) src/pantheon-files-ui.xml (+14/-86) |
||||
To merge this branch: | bzr merge lp:~victored/pantheon-files/no-menubar | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Danielle Foré | Approve | ||
Review via email: mp+163418@code.launchpad.net |
Commit message
- Remove dead code related to the context view
- Don't allow a menubar to be displayed inside the window. Menu support has been kept so that a global menu can still be used.
Description of the change
This branch doesn't allow any menubar to be displayed inside Files' window.
* Also drops dead code related to the already-removed context view/sidebar.
To post a comment you must log in.
- 1164. By Victor Martinez
-
drop unnecessary built-in theming
- 1165. By Victor Martinez
-
Merge trunk
Revision history for this message
Victor Martinez (victored) wrote : | # |
Thanks for the review Daniel,
I cannot reproduce that issue here.
Did you install the updated pantheon-
Revision history for this message
Danielle Foré (danrabbit) wrote : | # |
Ah Victor, you're correct. If I actually install it it works perfectly.
Today is a good day to piss off some more people. Approve ;)
review:
Approve
Revision history for this message
Victor Martinez (victored) wrote : | # |
haha let me go get my shield
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === renamed file 'src/View/Animations.vala' => 'libwidgets/Animations.vala' |
2 | --- src/View/Animations.vala 2011-12-23 02:45:45 +0000 |
3 | +++ libwidgets/Animations.vala 2013-05-13 19:45:28 +0000 |
4 | @@ -1,6 +1,6 @@ |
5 | namespace Marlin.Animation { |
6 | - |
7 | - static void smooth_adjustment_to (Gtk.Adjustment adj, int final) |
8 | + |
9 | + public static void smooth_adjustment_to (Gtk.Adjustment adj, int final) |
10 | { |
11 | var initial = adj.value; |
12 | var to_do = final - initial; |
13 | |
14 | === modified file 'libwidgets/CMakeLists.txt' |
15 | --- libwidgets/CMakeLists.txt 2013-04-22 07:45:04 +0000 |
16 | +++ libwidgets/CMakeLists.txt 2013-05-13 19:45:28 +0000 |
17 | @@ -35,6 +35,7 @@ |
18 | link_directories(${LIB_PATHS}) |
19 | |
20 | vala_precompile(VALA_C ${PKGNAME} |
21 | + Animations.vala |
22 | LocationBar.vala |
23 | BreadcrumbsElements.vala |
24 | BreadcrumbsEntry.vala |
25 | |
26 | === modified file 'schemas/org.pantheon.files.gschema.xml' |
27 | --- schemas/org.pantheon.files.gschema.xml 2013-05-12 21:15:15 +0000 |
28 | +++ schemas/org.pantheon.files.gschema.xml 2013-05-13 19:45:28 +0000 |
29 | @@ -14,11 +14,6 @@ |
30 | <value value="5" nick="larger"/> |
31 | <value value="6" nick="largest"/> |
32 | </enum> |
33 | - <enum id="contextviewmode"> |
34 | - <value value="0" nick="horizontal"/> |
35 | - <value value="1" nick="vertical"/> |
36 | - <value value="2" nick="auto"/> |
37 | - </enum> |
38 | <enum id="dateformatmode"> |
39 | <value value="0" nick="iso"/> |
40 | <value value="1" nick="locale"/> |
41 | @@ -26,16 +21,6 @@ |
42 | </enum> |
43 | |
44 | <schema path="/org/pantheon/files/preferences/" id="org.pantheon.files.preferences"> |
45 | - <key type="b" name="auto-theme"> |
46 | - <default>false</default> |
47 | - <summary>Auto-theme</summary> |
48 | - <description>Automaticly theme Marlin's specific widgets</description> |
49 | - </key> |
50 | - <key type="b" name="show-menubar"> |
51 | - <default>false</default> |
52 | - <summary>Show the menubar</summary> |
53 | - <description>Show the menubar</description> |
54 | - </key> |
55 | <key type="b" name="show-sidebar"> |
56 | <default>true</default> |
57 | <summary>Show the sidebar</summary> |
58 | @@ -46,11 +31,6 @@ |
59 | <summary>Show hidden files</summary> |
60 | <description>If set to true, hidden files will also be shown (files starting with a "." for example)</description> |
61 | </key> |
62 | - <key type="b" name="start-with-contextview"> |
63 | - <default>false</default> |
64 | - <summary>Show the context view pane</summary> |
65 | - <description>Show the context view pane</description> |
66 | - </key> |
67 | <key type="b" name="rgba-colormap"> |
68 | <default>false</default> |
69 | <summary>enable rgba window</summary> |
70 | @@ -92,13 +72,6 @@ |
71 | <summary>interpret desktop files</summary> |
72 | <description>If true the desktop files would be interpreted, a desktop file can represent an executable, a directory etc. (their filename, type and some other properties would be the target ones)</description> |
73 | </key> |
74 | - <key name="contextview-orientation" enum="contextviewmode"> |
75 | - <default>'auto'</default> |
76 | - <summary>Context View Panel orientation</summary> |
77 | - <description> |
78 | - Auto Context View Panel orientation means the panel would be horizontal or vertical depending on the size of your window. |
79 | - </description> |
80 | - </key> |
81 | <key name="default-viewmode" enum="viewmode"> |
82 | <default>'icon'</default> |
83 | <summary>Default viewmode when browsing</summary> |
84 | @@ -106,11 +79,6 @@ |
85 | The default viewmode to be used when opening a new tab or window |
86 | </description> |
87 | </key> |
88 | - <key type="b" name="toolbar-primary-css-style"> |
89 | - <default>true</default> |
90 | - <summary>toolbar css style</summary> |
91 | - <description>Set the toolbar css style to primary-toolbar.</description> |
92 | - </key> |
93 | <key type="as" name="toolbar-items"> |
94 | <default>[ 'Back', 'Forward', 'ViewSwitcher', 'LocationEntry']</default> |
95 | <summary>List of actions present in the toolbar</summary> |
96 | |
97 | === modified file 'src/CMakeLists.txt' |
98 | --- src/CMakeLists.txt 2013-05-13 09:26:42 +0000 |
99 | +++ src/CMakeLists.txt 2013-05-13 19:45:28 +0000 |
100 | @@ -48,12 +48,10 @@ |
101 | View/Resources.vala |
102 | View/DbusTags.vala |
103 | View/ViewContainer.vala |
104 | - View/ContextView.vala |
105 | View/OverlayBar.vala |
106 | View/PropertiesWindow.vala |
107 | View/Browser.vala |
108 | View/ViewMode.vala |
109 | - View/Animations.vala |
110 | View/LocationBar.vala |
111 | View/Chrome/TopMenu.vala |
112 | View/Chrome/ViewSwicher.vala |
113 | |
114 | === modified file 'src/View/Chrome/TopMenu.vala' |
115 | --- src/View/Chrome/TopMenu.vala 2013-02-22 15:03:12 +0000 |
116 | +++ src/View/Chrome/TopMenu.vala 2013-05-13 19:45:28 +0000 |
117 | @@ -35,8 +35,8 @@ |
118 | public TopMenu (Window window) |
119 | { |
120 | win = window; |
121 | - if (Preferences.settings.get_boolean("toolbar-primary-css-style")) |
122 | - get_style_context().add_class (Gtk.STYLE_CLASS_PRIMARY_TOOLBAR); |
123 | + |
124 | + get_style_context ().add_class (Gtk.STYLE_CLASS_PRIMARY_TOOLBAR); |
125 | |
126 | compact_menu = (Gtk.Menu) win.ui.get_widget("/CompactMenu"); |
127 | toolbar_menu = (Gtk.Menu) win.ui.get_widget("/ToolbarMenu"); |
128 | @@ -44,6 +44,8 @@ |
129 | app_menu = new Granite.Widgets.AppMenu (compact_menu); |
130 | setup_items(); |
131 | show(); |
132 | + |
133 | + app_menu.show_all (); |
134 | } |
135 | |
136 | public override bool popup_context_menu (int x, int y, int button) { |
137 | |
138 | === removed file 'src/View/ContextView.vala' |
139 | --- src/View/ContextView.vala 2013-01-19 23:24:06 +0000 |
140 | +++ src/View/ContextView.vala 1970-01-01 00:00:00 +0000 |
141 | @@ -1,481 +0,0 @@ |
142 | -// |
143 | -// ContextView.vala |
144 | -// |
145 | -// Authors: |
146 | -// Mathijs Henquet <mathijs.henquet@gmail.com> |
147 | -// ammonkey <am.monkeyd@gmail.com> |
148 | -// |
149 | -// Copyright (c) 2011 Mathijs Henquet |
150 | -// |
151 | -// This program is free software: you can redistribute it and/or modify |
152 | -// it under the terms of the GNU General Public License as published by |
153 | -// the Free Software Foundation, either version 3 of the License, or |
154 | -// (at your option) any later version. |
155 | -// |
156 | -// This program is distributed in the hope that it will be useful, |
157 | -// but WITHOUT ANY WARRANTY; without even the implied warranty of |
158 | -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
159 | -// GNU General Public License for more details. |
160 | -// |
161 | -// You should have received a copy of the GNU General Public License |
162 | -// along with this program. If not, see <http://www.gnu.org/licenses/>. |
163 | - |
164 | -using Gtk; |
165 | -using Gdk; |
166 | -using Cairo; |
167 | -using Gee; |
168 | -using Granite.Widgets; |
169 | - |
170 | -namespace Marlin.View { |
171 | - |
172 | - public class ContextView : Gtk.EventBox |
173 | - { |
174 | - public const int height = 48; |
175 | - public const int width = 190; |
176 | - public const int key_value_padding = 8; |
177 | - public const int key_value_width = 90; |
178 | - public Gtk.Menu toolbar_menu; |
179 | - |
180 | - public int panel_size{ |
181 | - get{ |
182 | - switch (orientation){ |
183 | - case Gtk.Orientation.HORIZONTAL: |
184 | - return height; |
185 | - case Gtk.Orientation.VERTICAL: |
186 | - default: |
187 | - return width; |
188 | - } |
189 | - } |
190 | - } |
191 | - |
192 | - private Window window; |
193 | - private Gdk.Pixbuf? pixbuf { |
194 | - set{ |
195 | - if (value != null) |
196 | - evbox.set_from_pixbuf (value); |
197 | - } |
198 | - } |
199 | - |
200 | - private ImgEventBox evbox; |
201 | - private Label label; |
202 | - private Gee.List<Pair<string, string>> info; |
203 | - private uint timeout = 0; |
204 | - private uint timeout_update = 0; |
205 | - private bool first_alloc = true; |
206 | - private Allocation cv_alloc; /* last allocation of the contextview */ |
207 | - private bool should_sync; |
208 | - |
209 | - private GOF.File? last_gof = null; |
210 | - private ulong icon_changed_callback = 0; |
211 | - private unowned GLib.List<GOF.File>? last_selection = null; |
212 | - |
213 | - private Orientation _orientation = Gtk.Orientation.HORIZONTAL; |
214 | - public Orientation orientation { |
215 | - set{ |
216 | - if(timeout != 0){ |
217 | - Source.remove(timeout); |
218 | - timeout = 0; |
219 | - } |
220 | - first_alloc = true; |
221 | - |
222 | - _orientation = value; |
223 | - change_css_class (); |
224 | - /* reset pane position to original values */ |
225 | - window.main_box.set_position (window.main_box.max_position - panel_size); |
226 | - //SPOTTED! |
227 | - update(last_selection); |
228 | - } |
229 | - get{ |
230 | - return _orientation; |
231 | - } |
232 | - } |
233 | - |
234 | - public Orientation parent_orientation { |
235 | - set{ |
236 | - orientation = convert_parent_orientation(value); |
237 | - } |
238 | - } |
239 | - |
240 | - private Orientation convert_parent_orientation (Orientation o) { |
241 | - switch (o){ |
242 | - case Gtk.Orientation.HORIZONTAL: |
243 | - return Gtk.Orientation.VERTICAL; |
244 | - case Gtk.Orientation.VERTICAL: |
245 | - default: |
246 | - return Gtk.Orientation.HORIZONTAL; |
247 | - } |
248 | - } |
249 | - |
250 | - /* TODO remove should_sync? */ |
251 | - public ContextView (Window window, bool _should_sync, |
252 | - Gtk.Orientation parent_orientation = Gtk.Orientation.VERTICAL) |
253 | - { |
254 | - this.window = window; |
255 | - _orientation = convert_parent_orientation(parent_orientation); |
256 | - |
257 | - should_sync = _should_sync; |
258 | - if (should_sync) { |
259 | - window.selection_changed.connect (update); |
260 | - window.item_hovered.connect (update_hovered); |
261 | - change_css_class (); |
262 | - } |
263 | - |
264 | - label = new Label(""); |
265 | - var font_style = new Pango.FontDescription(); |
266 | - font_style.set_size(14 * 1000); |
267 | - label.override_font(font_style); |
268 | - //label.ellipsize = Pango.EllipsizeMode.MIDDLE; |
269 | - label.set_line_wrap (true); |
270 | - label.set_line_wrap_mode (Pango.WrapMode.CHAR); |
271 | - label.set_width_chars (10); |
272 | - label.set_padding(key_value_padding, -1); |
273 | - |
274 | - evbox = new ImgEventBox(Orientation.HORIZONTAL); |
275 | - |
276 | - info = new LinkedList<Pair<string, string>>(); |
277 | - |
278 | - toolbar_menu = (Gtk.Menu) window.ui.get_widget("/ToolbarMenu"); |
279 | - button_press_event.connect(right_click); |
280 | - size_allocate.connect(size_allocate_changed); |
281 | - } |
282 | - |
283 | - private void change_css_class () { |
284 | - var ctx = window.main_box.get_style_context(); |
285 | - |
286 | - if (orientation == Orientation.VERTICAL) { |
287 | - ctx.remove_class("contextview-horizontal"); |
288 | - ctx.add_class("contextview-vertical"); |
289 | - } else { |
290 | - ctx.remove_class("contextview-vertical"); |
291 | - ctx.add_class("contextview-horizontal"); |
292 | - } |
293 | - |
294 | - window.main_box.reset_style (); |
295 | - } |
296 | - |
297 | -#if VALA_0_14 |
298 | - private void size_allocate_changed (Gtk.Allocation s) |
299 | -#else |
300 | - private void size_allocate_changed (Widget w, Gdk.Rectangle s) |
301 | -#endif |
302 | - { |
303 | - /* first allocations can be tricky ignore all allocations different |
304 | - than the panel requested size at first */ |
305 | - if (first_alloc) { |
306 | - if (orientation == Orientation.VERTICAL && |
307 | - s.width > 1 && s.width <= panel_size) |
308 | - first_alloc = false; |
309 | - if (orientation == Orientation.HORIZONTAL && |
310 | - s.height > 1 && s.height <= panel_size) |
311 | - first_alloc = false; |
312 | - } |
313 | - /*if (first_alloc && !should_sync) |
314 | - return;*/ |
315 | - |
316 | - //amtest |
317 | - /*stdout.printf ("::::: %d %d :: %d %d\n", cv_alloc.width, cv_alloc.height, |
318 | - s.width, s.height);*/ |
319 | - if ((orientation == Orientation.VERTICAL && cv_alloc.width != s.width) || |
320 | - (orientation == Orientation.HORIZONTAL && cv_alloc.height != s.height)) { |
321 | - //stdout.printf ("$$$$$$$$$$$ img alloc %d\n", s.width); |
322 | - /* TODO don't create/destroy the contextview in miller */ |
323 | - //message ("zz"); |
324 | - if(timeout != 0){ |
325 | - Source.remove(timeout); |
326 | - timeout = 0; |
327 | - } |
328 | - timeout = Timeout.add(300, () => { |
329 | - //message ("wwwwwwwwwwwww"); |
330 | - update_icon(); |
331 | - timeout = 0; |
332 | - |
333 | - return false; |
334 | - }); |
335 | - } |
336 | - |
337 | - } |
338 | - |
339 | - public bool right_click(Gdk.EventButton event) |
340 | - { |
341 | - if(event.button == 3) |
342 | - { |
343 | - Eel.pop_up_context_menu(toolbar_menu, 0, 0, event); |
344 | - return true; |
345 | - } |
346 | - return false; |
347 | - } |
348 | - |
349 | - private void update_icon() |
350 | - { |
351 | - Allocation alloc; |
352 | - int icon_size_req; |
353 | - |
354 | - if (last_gof == null) |
355 | - return; |
356 | - |
357 | - //window.get_size(out w_width, out w_height); |
358 | - get_allocation(out alloc); |
359 | - cv_alloc = alloc; |
360 | - //stdout.printf ("$$$$$$$$$ real alloc %d %d\n", alloc.width, alloc.height); |
361 | - |
362 | - /* fixing a minimum and maximum value */ |
363 | - if (orientation == Orientation.VERTICAL) { |
364 | - /* add a little 16px padding for normal icons */ |
365 | - if (last_gof.info.has_attribute (FileAttribute.THUMBNAIL_PATH) && |
366 | - last_gof.info.get_attribute_byte_string (FileAttribute.THUMBNAIL_PATH) != null) { |
367 | - icon_size_req = alloc.width.clamp (height, 256); |
368 | - } else { |
369 | - icon_size_req = alloc.width.clamp (height, width-16); |
370 | - } |
371 | - } else { |
372 | - icon_size_req = alloc.height.clamp (height, 256); |
373 | - } |
374 | - |
375 | - /*if (last_gof.thumbnail_path != null) { |
376 | - //pixbuf = yield Pixbuf from_stream_at_scale_async (); |
377 | - pixbuf = new Pixbuf.from_file (last_gof.thumbnail_path); |
378 | - }*/ |
379 | - |
380 | - //pixbuf = last_gof.get_icon_pixbuf (icon_size_req, false, GOF.FileIconFlags.USE_THUMBNAILS); |
381 | - string preview = last_gof.get_preview_path(); |
382 | - bool use_previewed = false; |
383 | - if(preview != null) |
384 | - { |
385 | - try |
386 | - { |
387 | - pixbuf = new Gdk.Pixbuf.from_file_at_size (preview, icon_size_req, -1); // FIXME need cache |
388 | - use_previewed = true; |
389 | - } |
390 | - catch(Error e) |
391 | - { |
392 | - } |
393 | - } |
394 | - else if(last_gof.get_thumbnail_path() != null && last_gof.flags == GOF.File.ThumbState.READY) |
395 | - { |
396 | - Marlin.Thumbnailer.get().queue_file(last_gof, null, true); |
397 | - } |
398 | - if(!use_previewed) |
399 | - { |
400 | - var micon = last_gof.get_icon (128, GOF.FileIconFlags.USE_THUMBNAILS); |
401 | - pixbuf = micon.get_pixbuf_at_size (icon_size_req); |
402 | - } |
403 | - |
404 | - |
405 | - /* TODO ask tumbler a LARGE thumb for size > 128 */ |
406 | - /*if (should_sync && (icon_size_req > w_width/2 || icon_size_req > w_height/2)) |
407 | - window.main_box.set_position (window.main_box.max_position - icon_size_req);*/ |
408 | - } |
409 | - |
410 | - public void update (GLib.List<GOF.File>? selection = null) { |
411 | - if (icon_changed_callback > 0) { |
412 | - Source.remove((uint) icon_changed_callback); |
413 | - icon_changed_callback = 0; |
414 | - } |
415 | - |
416 | - if (selection != null && selection.data != null && selection.data is GOF.File) { |
417 | - last_gof = selection.data as GOF.File; |
418 | - last_selection = selection; |
419 | - } else { |
420 | - last_gof = null; |
421 | - /* if empty selection then pass the currentslot folder */ |
422 | - if (window.current_tab != null) { |
423 | - var aslot = window.current_tab.get_active_slot (); |
424 | - if (aslot != null) |
425 | - last_gof = aslot.directory.file; |
426 | - } |
427 | - last_selection = null; |
428 | - } |
429 | - if (last_gof == null) |
430 | - return; |
431 | - if (last_gof.info == null) |
432 | - return; |
433 | - |
434 | - timed_update (); |
435 | - } |
436 | - |
437 | - public void update_hovered (GOF.File? file) { |
438 | - if (file != null) { |
439 | - last_gof = file; |
440 | - timed_update (); |
441 | - } else { |
442 | - update (last_selection); |
443 | - } |
444 | - } |
445 | - |
446 | - private void timed_update () { |
447 | - if(timeout_update != 0){ |
448 | - Source.remove(timeout_update); |
449 | - timeout_update = 0; |
450 | - } |
451 | - timeout_update = Timeout.add(60, () => { |
452 | - real_update (); |
453 | - timeout_update = 0; |
454 | - |
455 | - return false; |
456 | - }); |
457 | - } |
458 | - |
459 | - private void real_update () { |
460 | - //warning ("ctx pane update"); |
461 | - return_if_fail (last_gof != null && last_gof.info != null); |
462 | - |
463 | - /* don't update icon if we are in column view as the preview pane is |
464 | - built/destroyed foreach selection changed */ |
465 | - if (should_sync) |
466 | - update_icon(); |
467 | - icon_changed_callback = last_gof.icon_changed.connect (() => { |
468 | - if (should_sync) |
469 | - update_icon (); |
470 | - }); |
471 | - |
472 | - info.clear(); |
473 | - var raw_type = last_gof.info.get_file_type(); |
474 | - |
475 | - /* TODO hide infos for ListView mode: we don't want the COLUMNS infos to show if |
476 | - we are in listview: size, type, modified */ |
477 | - info.add(new Pair<string, string>(_("Name") + (": "), last_gof.info.get_name ())); |
478 | - info.add(new Pair<string, string>(_("Type") + (": "), last_gof.formated_type)); |
479 | - |
480 | - if (last_gof.info.get_is_symlink()) |
481 | - info.add(new Pair<string, string>(_("Target") + (": "), last_gof.info.get_symlink_target ())); |
482 | - if(raw_type != FileType.DIRECTORY) |
483 | - info.add(new Pair<string, string>(_("Size") + (": "), last_gof.format_size)); |
484 | - /* localized time depending on MARLIN_PREFERENCES_DATE_FORMAT locale, iso .. */ |
485 | - info.add(new Pair<string, string>(_("Modified") + (": "), last_gof.formated_modified)); |
486 | - info.add(new Pair<string, string>(_("Owner") + (": "), last_gof.info.get_attribute_string(FileAttribute.OWNER_USER_REAL))); |
487 | - |
488 | - label.label = last_gof.info.get_name (); |
489 | - |
490 | - update_info_panel(); |
491 | - show(); |
492 | - } |
493 | - |
494 | - public void update_info_panel(){ |
495 | - if(orientation == Gtk.Orientation.HORIZONTAL) |
496 | - construct_info_panel_horizontal(info); |
497 | - else |
498 | - construct_info_panel_vertical(info); |
499 | - } |
500 | - |
501 | - private void construct_info_panel_vertical(Gee.List<Pair<string, string>> item_info){ |
502 | - var box = new Box (Gtk.Orientation.VERTICAL, 0); |
503 | - |
504 | - set_size_request (width, -1); |
505 | - |
506 | - /*var blank_box = new VBox(false, 0); |
507 | - blank_box.set_size_request (-1, 20); |
508 | - box.pack_start(blank_box, false, false, 0);*/ |
509 | - |
510 | - if (evbox != null) { |
511 | - if (evbox.parent != null) |
512 | - evbox.parent.remove(evbox); |
513 | - evbox.orientation = convert_parent_orientation(orientation); |
514 | - box.pack_start(evbox, false, true, 0); |
515 | - } |
516 | - if (label != null) { |
517 | - if (label.parent != null) |
518 | - label.parent.remove(label); |
519 | - label.set_selectable(true); |
520 | - label.set_tooltip_text (last_gof.info.get_name ()); |
521 | - box.pack_start(label, false, false); |
522 | - } |
523 | - |
524 | - var sep = new Gtk.Separator(Gtk.Orientation.HORIZONTAL); |
525 | - sep.set_margin_top (4); |
526 | - sep.set_margin_bottom (10); |
527 | - box.pack_start(sep, false, false); |
528 | - |
529 | - var information = new Grid(); |
530 | - information.row_spacing = 3; |
531 | - var alignment_ = new Gtk.Alignment(0.5f, 0, 0, 0); |
532 | - |
533 | - int n = 0; |
534 | - foreach(var pair in item_info){ |
535 | - /* skip the firs parameter "name" for vertical panel */ |
536 | - if (n>0) { |
537 | - |
538 | - var lval = new Gtk.Label (pair.value); |
539 | - var lkey = new Gtk.Label (pair.key); |
540 | - lval.set_selectable(true); |
541 | - lkey.set_sensitive (false); |
542 | - lkey.set_alignment (1, 0); |
543 | - lval.set_alignment (0, 0); |
544 | - //lval.set_ellipsize(Pango.EllipsizeMode.MIDDLE); |
545 | - lval.set_line_wrap (true); |
546 | - lval.set_width_chars (10); |
547 | - |
548 | - information.attach(lkey, 0, n, 1, 1); |
549 | - information.attach(lval, 1, n, 1, 1); |
550 | - } |
551 | - n++; |
552 | - } |
553 | - alignment_.add(information); |
554 | - box.pack_start(alignment_); |
555 | - |
556 | - box.show_all(); |
557 | - set_content(box); |
558 | - } |
559 | - |
560 | - private void construct_info_panel_horizontal(Gee.List<Pair<string, string>> item_info){ |
561 | - var box = new Box (Gtk.Orientation.HORIZONTAL, 0); |
562 | - |
563 | - set_size_request (-1, height); |
564 | - if (evbox != null) { |
565 | - if (evbox.parent != null) |
566 | - evbox.parent.remove(evbox); |
567 | - evbox.orientation = convert_parent_orientation(orientation); |
568 | - box.pack_start(evbox, false, true, 0); |
569 | - } |
570 | - |
571 | - var alignment = new Gtk.Alignment(0, 0.5f, 0, 0); |
572 | - var grid = new Grid (); |
573 | - grid.set_orientation (Gtk.Orientation.HORIZONTAL); |
574 | - alignment.add (grid); |
575 | - box.add (alignment); |
576 | - |
577 | - var i = 0; |
578 | - foreach(var pair in item_info){ |
579 | - var left = (int) i/2 + i/2; |
580 | - var top = i % 2; |
581 | - //warning ("left %d top %d", left, top); |
582 | - |
583 | - var lkey = new Gtk.Label (pair.key); |
584 | - //lkey.set_size_request (65, -1); |
585 | - lkey.set_state_flags (Gtk.StateFlags.INSENSITIVE, false); |
586 | - //lkey.set_justify(Justification.RIGHT); |
587 | - lkey.set_alignment(1, 0); |
588 | - grid.attach (lkey, left, top, 1, 1); |
589 | - |
590 | - var lval = new Label (pair.value); |
591 | - lval.set_selectable(true); |
592 | - lval.set_margin_right (10); |
593 | - lval.set_alignment(0, 0); |
594 | - lval.set_width_chars (10); |
595 | - lval.set_ellipsize (Pango.EllipsizeMode.END); |
596 | - grid.attach (lval, left+1, top, 1, 1); |
597 | - i++; |
598 | - } |
599 | - |
600 | - box.show_all(); |
601 | - set_content(box); |
602 | - } |
603 | - |
604 | - private void set_content(Widget w){ |
605 | - var lw = get_child(); |
606 | - if (lw != null) |
607 | - remove(lw); |
608 | - add(w); |
609 | - } |
610 | - } |
611 | - |
612 | - class Pair<F, G>{ |
613 | - public F key; |
614 | - public G value; |
615 | - |
616 | - public Pair(F key, G value){ |
617 | - this.key = key; |
618 | - this.value = value; |
619 | - } |
620 | - } |
621 | -} |
622 | - |
623 | |
624 | === modified file 'src/View/OverlayBar.vala' |
625 | --- src/View/OverlayBar.vala 2013-01-01 22:34:19 +0000 |
626 | +++ src/View/OverlayBar.vala 2013-05-13 19:45:28 +0000 |
627 | @@ -1,20 +1,20 @@ |
628 | -/* |
629 | +/* |
630 | * Copyright (C) 2012 ammonkey <am.monkeyd@gmail.com> |
631 | - * |
632 | + * |
633 | * This program is free software: you can redistribute it and/or modify |
634 | * it under the terms of the GNU General Public License as published by |
635 | * the Free Software Foundation, either version 3 of the License, or |
636 | * (at your option) any later version. |
637 | - * |
638 | + * |
639 | * This program is distributed in the hope that it will be useful, |
640 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
641 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
642 | * GNU General Public License for more details. |
643 | - * |
644 | + * |
645 | * You should have received a copy of the GNU General Public License |
646 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
647 | * |
648 | - */ |
649 | + */ |
650 | |
651 | using Gtk; |
652 | |
653 | @@ -40,14 +40,14 @@ |
654 | public bool showbar { |
655 | set { |
656 | _showbar = value; |
657 | - visible = count > 0 && value; |
658 | + visible = value && count > 0; |
659 | } |
660 | get { |
661 | return _showbar; |
662 | } |
663 | } |
664 | |
665 | - public OverlayBar (Marlin.View.Window win) |
666 | + public OverlayBar (Marlin.View.Window win) |
667 | { |
668 | window = win; |
669 | |
670 | @@ -166,13 +166,13 @@ |
671 | private GOF.File? goffile = null; |
672 | //private unowned GLib.List<GOF.File>? last_selection = null; |
673 | |
674 | - private void update (GLib.List<GOF.File>? files = null) |
675 | + private void update (GLib.List<GOF.File>? files = null) |
676 | { |
677 | //last_selection = files; |
678 | real_update (files); |
679 | } |
680 | |
681 | - private void update_hovered (GOF.File? file) |
682 | + private void update_hovered (GOF.File? file) |
683 | { |
684 | if (file != null) { |
685 | GLib.List<GOF.File> list = null; |
686 | @@ -187,7 +187,7 @@ |
687 | } |
688 | } |
689 | |
690 | - private void real_update (GLib.List<GOF.File>? files = null) |
691 | + private void real_update (GLib.List<GOF.File>? files = null) |
692 | { |
693 | count = 0; |
694 | folders_count = 0; |
695 | @@ -202,7 +202,7 @@ |
696 | /* list contain only one element */ |
697 | if (files.next == null) { |
698 | goffile = files.data; |
699 | - } |
700 | + } |
701 | scan_list (files); |
702 | update_status (); |
703 | |
704 | @@ -212,7 +212,7 @@ |
705 | } |
706 | } |
707 | |
708 | - private void update_status () |
709 | + private void update_status () |
710 | { |
711 | if (count == 1) { |
712 | if (!goffile.is_folder ()) { |
713 | @@ -252,7 +252,7 @@ |
714 | } |
715 | } |
716 | |
717 | - private void scan_list (List<GOF.File> files) |
718 | + private void scan_list (List<GOF.File> files) |
719 | { |
720 | foreach (var gof in files) { |
721 | if (gof.is_folder ()) { |
722 | |
723 | === modified file 'src/View/PropertiesWindow.vala' |
724 | --- src/View/PropertiesWindow.vala 2013-01-28 19:20:16 +0000 |
725 | +++ src/View/PropertiesWindow.vala 2013-05-13 19:45:28 +0000 |
726 | @@ -24,6 +24,16 @@ |
727 | |
728 | public class Marlin.View.PropertiesWindow : Granite.Widgets.LightWindow |
729 | { |
730 | + private class Pair<F, G> { |
731 | + public F key; |
732 | + public G value; |
733 | + |
734 | + public Pair (F key, G value) { |
735 | + this.key = key; |
736 | + this.value = value; |
737 | + } |
738 | + } |
739 | + |
740 | private Gee.LinkedList<Pair<string, string>> info; |
741 | private Granite.Widgets.ImgEventBox evbox; |
742 | private Granite.Widgets.XsEntry perm_code; |
743 | @@ -70,10 +80,10 @@ |
744 | Box action_area = new Box (Orientation.VERTICAL, 12); |
745 | border_width = 5; |
746 | sg = new SizeGroup (SizeGroupMode.HORIZONTAL); |
747 | - |
748 | + |
749 | add (content_area); |
750 | add (action_area); |
751 | - |
752 | + |
753 | Box content_vbox = new Box (Gtk.Orientation.VERTICAL, 0); |
754 | //var content_vbox = new VBox(false, 12); |
755 | content_area.pack_start (content_vbox); |
756 | @@ -135,16 +145,16 @@ |
757 | construct_preview_panel (preview_box); |
758 | add_section (notebook, _("Preview"), PanelType.PREVIEW, preview_box); |
759 | } |
760 | - |
761 | + |
762 | set_transient_for (parent); |
763 | set_position (WindowPosition.CENTER_ALWAYS); |
764 | set_destroy_with_parent (true); |
765 | - |
766 | + |
767 | content_vbox.show(); |
768 | |
769 | content_area.show_all(); |
770 | show_all(); |
771 | - |
772 | + |
773 | present (); |
774 | } |
775 | |
776 | @@ -363,7 +373,7 @@ |
777 | private void construct_info_panel (Box box, Gee.LinkedList<Pair<string, string>> item_info) { |
778 | var information = new Grid(); |
779 | information.row_spacing = 3; |
780 | - |
781 | + |
782 | var label = new Label (""); |
783 | label.use_markup = true; |
784 | label.set_markup ("<b>" + _("Info:") + "\t\t\t</b>"); //FIXME: find a better solution for this |
785 | @@ -426,7 +436,7 @@ |
786 | combo.changed.connect (combo_open_with_changed); |
787 | |
788 | var key_label = create_label_key (_("Open with:"), Align.CENTER); |
789 | - |
790 | + |
791 | information.attach (key_label, 0, n, 1, 1); |
792 | information.attach (hcombo, 1, n, 1, 1); |
793 | |
794 | @@ -442,15 +452,15 @@ |
795 | uint64 fs_free = info.get_attribute_uint64 (FileAttribute.FILESYSTEM_FREE); |
796 | |
797 | n++; |
798 | - |
799 | + |
800 | debug ("%d", n); |
801 | label = new Label (""); |
802 | label.use_markup = true; |
803 | label.set_markup ("<b>" + _("Usage:") + "\t\t\t</b>"); //FIXME: find a better solution for this |
804 | information.attach (label, 0, n, 1, 1); |
805 | - |
806 | + |
807 | n++; |
808 | - |
809 | + |
810 | var key_label = create_label_key (_("Device usage:"), Align.CENTER); |
811 | information.attach (key_label, 0, n, 1, 1); |
812 | debug ("%d", n); |
813 | |
814 | === modified file 'src/View/ViewContainer.vala' |
815 | --- src/View/ViewContainer.vala 2013-02-19 22:00:20 +0000 |
816 | +++ src/View/ViewContainer.vala 2013-05-13 19:45:28 +0000 |
817 | @@ -45,7 +45,9 @@ |
818 | public ViewContainer (Marlin.View.Window win, GLib.File location, int _view_mode = 0) |
819 | { |
820 | window = win; |
821 | + overlay_statusbar = new OverlayBar (win); |
822 | view_mode = _view_mode; |
823 | + |
824 | /* set active tab */ |
825 | browser = new Browser (); |
826 | label = new Gtk.Label("Loading..."); |
827 | @@ -67,11 +69,7 @@ |
828 | |
829 | /* overlay statusbar */ |
830 | set_events (Gdk.EventMask.ENTER_NOTIFY_MASK | Gdk.EventMask.LEAVE_NOTIFY_MASK); |
831 | - overlay_statusbar = new OverlayBar (win); |
832 | add_overlay (overlay_statusbar); |
833 | - /*var action_showhide_context_pane = (Gtk.ToggleAction) window.main_actions.get_action("Show Hide Context Pane"); |
834 | - overlay_statusbar.showbar = !action_showhide_context_pane.get_active (); |
835 | - action_showhide_context_pane.bind_property ("active", overlay_statusbar, "showbar", BindingFlags.INVERT_BOOLEAN);*/ |
836 | overlay_statusbar.showbar = view_mode != ViewMode.LIST; |
837 | |
838 | path_changed.connect((myfile) => { |
839 | @@ -120,7 +118,7 @@ |
840 | } |
841 | } |
842 | |
843 | - private void plugin_directory_loaded () |
844 | + private void plugin_directory_loaded () |
845 | { |
846 | Object[] data = new Object[2]; |
847 | data[0] = window; |
848 | @@ -134,7 +132,7 @@ |
849 | //file_info_callback = slot.directory.file.info_available.connect((gof) => { |
850 | if(window.current_tab == this) |
851 | window.loading_uri (slot.directory.file.uri, window.sidebar); |
852 | - |
853 | + |
854 | /*Source.remove((uint) file_info_callback); |
855 | });*/ |
856 | } |
857 | @@ -151,31 +149,27 @@ |
858 | |
859 | if (Posix.getuid() == 0) |
860 | tab_name = tab_name + " " + _("(as Administrator)"); |
861 | - |
862 | + |
863 | /* update window title */ |
864 | if(window.current_tab == this) { |
865 | window.set_title(tab_name); |
866 | if (window.top_menu.location_bar != null) |
867 | - window.top_menu.location_bar.path = aslot.directory.file.location.get_parse_name(); |
868 | + window.top_menu.location_bar.path = aslot.directory.file.location.get_parse_name(); |
869 | } |
870 | |
871 | } |
872 | |
873 | - /* handle directory not found, contextview */ |
874 | + /* handle directory not found */ |
875 | public void directory_done_loading () { |
876 | if (!slot.directory.file.exists) { |
877 | content = new DirectoryNotFound (slot.directory, this); |
878 | } else { |
879 | - if (select_childs != null) |
880 | + if (select_childs != null) |
881 | ((FM.Directory.View) slot.view_box).select_glib_files (select_childs); |
882 | } |
883 | - sync_contextview(); |
884 | |
885 | warning ("directory done loading"); |
886 | - //coltest TODO remove |
887 | - /*if (window.contextview != null) |
888 | - window.contextview.update ();*/ |
889 | - |
890 | + |
891 | slot.directory.done_loading.disconnect (directory_done_loading); |
892 | } |
893 | |
894 | @@ -196,7 +190,7 @@ |
895 | /* check if the requested location is a parent of the previous one */ |
896 | if (slot != null) { |
897 | var parent = slot.location.get_parent (); |
898 | - if (parent != null && parent.equal (location)) |
899 | + if (parent != null && parent.equal (location)) |
900 | select_childs.prepend (slot.directory.file.location); |
901 | } |
902 | } |
903 | @@ -243,29 +237,6 @@ |
904 | overlay_statusbar.showbar = nview != ViewMode.LIST; |
905 | } |
906 | |
907 | - public void sync_contextview(){ |
908 | - if (!slot.directory.file.exists) { |
909 | - if (window.contextview != null) { |
910 | - window.main_box.remove (window.contextview); |
911 | - window.contextview = null; |
912 | - } |
913 | - return; |
914 | - } |
915 | - |
916 | - if (window.contextview == null && |
917 | - ((Gtk.ToggleAction) window.main_actions.get_action("Show Hide Context Pane")).get_active()) |
918 | - { |
919 | - window.contextview = new ContextView(window, true, window.main_box.orientation); |
920 | - |
921 | - window.main_box.notify.connect((prop) => { |
922 | - if(window.contextview != null && prop.name == "orientation") |
923 | - window.contextview.parent_orientation = window.main_box.orientation; |
924 | - }); |
925 | - window.main_box.pack2(window.contextview, false, true); |
926 | - window.contextview.show (); |
927 | - } |
928 | - } |
929 | - |
930 | public GOF.Window.Slot? get_active_slot () { |
931 | if (mwcol != null) |
932 | return mwcol.active_slot; |
933 | @@ -306,7 +277,7 @@ |
934 | // You see if I would just use back(n) the reference to n would be passed |
935 | // in the clusure, restulting in a value of n which would always be n=1. So |
936 | // by introducting a new variable I can bypass this anoyance. |
937 | - var item = new Gtk.MenuItem.with_label (path); |
938 | + var item = new Gtk.MenuItem.with_label (path); |
939 | item.activate.connect(() => { back(cn); }); |
940 | back_menu.insert(item, -1); |
941 | } |
942 | @@ -322,7 +293,7 @@ |
943 | var n = 1; |
944 | foreach(var path in list){ |
945 | int cn = n++; // For explenation look up |
946 | - var item = new Gtk.MenuItem.with_label (path); |
947 | + var item = new Gtk.MenuItem.with_label (path); |
948 | item.activate.connect(() => forward(cn)); |
949 | forward_menu.insert(item, -1); |
950 | } |
951 | |
952 | === modified file 'src/View/Window.vala' |
953 | --- src/View/Window.vala 2013-05-12 20:41:24 +0000 |
954 | +++ src/View/Window.vala 2013-05-13 19:45:28 +0000 |
955 | @@ -38,8 +38,6 @@ |
956 | public Marlin.Places.Sidebar sidebar; |
957 | |
958 | public ViewContainer? current_tab; |
959 | - public Granite.Widgets.CollapsiblePaned main_box; |
960 | - public ContextView? contextview = null; |
961 | |
962 | public Gtk.ActionGroup main_actions; |
963 | public Gtk.AccelGroup accel_group; |
964 | @@ -47,24 +45,6 @@ |
965 | public Granite.Widgets.ToolButtonWithMenu button_forward; |
966 | public Granite.Widgets.ToolButtonWithMenu button_back; |
967 | |
968 | - private const int horizontal_contextplane_max_width = 910; |
969 | - private const int horizontal_contextplane_max_height = 380; // after which we will go vertical |
970 | - |
971 | - private Gtk.CssProvider css_provider = null; |
972 | - private bool _auto_theme; |
973 | - public bool auto_theme { |
974 | - set { |
975 | - _auto_theme = value; |
976 | - if (value) |
977 | - load_css_style (); |
978 | - else |
979 | - unload_css_style (); |
980 | - } |
981 | - get { |
982 | - return _auto_theme; |
983 | - } |
984 | - } |
985 | - |
986 | public bool can_go_up{ |
987 | set{ |
988 | main_actions.get_action("Up").set_sensitive(value); |
989 | @@ -82,7 +62,7 @@ |
990 | main_actions.get_action("Back").set_sensitive(value); |
991 | } |
992 | } |
993 | - |
994 | + |
995 | public signal void item_hovered (GOF.File gof_file); |
996 | public signal void selection_changed (GLib.List<GOF.File> gof_file); |
997 | |
998 | @@ -131,8 +111,10 @@ |
999 | ui.insert_action_group(main_actions, 0); |
1000 | ui.ensure_update(); |
1001 | |
1002 | - /* Menubar */ |
1003 | + /* Menubar. We only need a menubar for special cases like global menus or HUD. |
1004 | + We don't need to show it in any other case */ |
1005 | menu_bar = ui.get_widget("/MenuBar"); |
1006 | + menu_bar.no_show_all = true; |
1007 | menu_bar.hide (); |
1008 | |
1009 | /* Topmenu */ |
1010 | @@ -140,10 +122,10 @@ |
1011 | |
1012 | /* Info Bar */ |
1013 | info_bar = new Gtk.InfoBar (); |
1014 | - |
1015 | + |
1016 | var label = new Gtk.Label (_("Files isn't your default file manager.")); |
1017 | label.set_line_wrap (true); |
1018 | - |
1019 | + |
1020 | var expander = new Label (""); |
1021 | expander.hexpand = true; |
1022 | |
1023 | @@ -157,18 +139,18 @@ |
1024 | make_marlin_default_fm (false); |
1025 | show_infobar (false); |
1026 | }); |
1027 | - |
1028 | + |
1029 | var bbox = new Gtk.ButtonBox (Gtk.Orientation.HORIZONTAL); |
1030 | bbox.set_spacing (3); |
1031 | bbox.pack_start (make_default, true, true, 5); |
1032 | bbox.pack_start (ignore, true, true, 5); |
1033 | - |
1034 | + |
1035 | ((Box)info_bar.get_content_area ()).add (label); |
1036 | ((Box)info_bar.get_content_area ()).add (expander); |
1037 | ((Box)info_bar.get_content_area ()).add (bbox); |
1038 | - |
1039 | + |
1040 | show_infobar (!is_marlin_mydefault_fm ()); |
1041 | - |
1042 | + |
1043 | /* Contents */ |
1044 | tabs = new Notebook(); |
1045 | tabs.show_border = false; |
1046 | @@ -180,24 +162,13 @@ |
1047 | sidebar = new Marlin.Places.Sidebar (this); |
1048 | Preferences.settings.bind("sidebar-zoom-level", sidebar, "zoom-level", SettingsBindFlags.DEFAULT); |
1049 | |
1050 | - /* Devide main views into sidebars */ |
1051 | - main_box = new Granite.Widgets.CollapsiblePaned (Orientation.VERTICAL); |
1052 | - main_box.show(); |
1053 | - |
1054 | var lside_pane = new Granite.Widgets.ThinPaned (); |
1055 | lside_pane.show(); |
1056 | |
1057 | lside_pane.pack1(sidebar, false, false); |
1058 | - lside_pane.pack2(main_box, true, true); |
1059 | + lside_pane.pack2(tabs, true, true); |
1060 | |
1061 | sidebar.show (); |
1062 | - main_box.show (); |
1063 | - |
1064 | - main_box.pack1(tabs, true, true); |
1065 | - |
1066 | - ((Gtk.ToggleAction) main_actions.get_action("Show Hide Context Pane")).set_active(Preferences.settings.get_boolean("start-with-contextview")); |
1067 | - |
1068 | - main_box.collapse_mode = Granite.CollapseMode.BOTTOM; |
1069 | |
1070 | /*/ |
1071 | /* Pack up all the view |
1072 | @@ -230,24 +201,16 @@ |
1073 | } |
1074 | show(); |
1075 | |
1076 | - Preferences.settings.bind("show-menubar", menu_bar, "visible", 0); |
1077 | - Preferences.settings.bind("show-menubar", main_actions.get_action("Show Hide Menubar"), "active", 0); |
1078 | - //Preferences.settings.bind("show-menubar", top_menu.compact_menu_button, "visible", SettingsBindFlags.INVERT_BOOLEAN); |
1079 | - Preferences.settings.bind("show-hiddenfiles", main_actions.get_action("Show Hidden Files"), "active", 0); |
1080 | - Preferences.settings.bind("interpret-desktop-files", main_actions.get_action("Show Desktop Files"), "active", SettingsBindFlags.INVERT_BOOLEAN); |
1081 | Preferences.settings.bind("show-sidebar", sidebar, "visible", 0); |
1082 | Preferences.settings.bind("show-sidebar", main_actions.get_action("Show Hide Sidebar"), "active", 0); |
1083 | |
1084 | - /* auto-theme Marlin's specific widgets. */ |
1085 | - Preferences.settings.bind("auto-theme", this, "auto-theme", SettingsBindFlags.DEFAULT); |
1086 | - |
1087 | /*/ |
1088 | /* Connect and abstract signals to local ones |
1089 | /*/ |
1090 | |
1091 | window_state_event.connect ((event) => { |
1092 | if ((bool) event.changed_mask & Gdk.WindowState.MAXIMIZED) { |
1093 | - Preferences.settings.set_boolean("maximized", |
1094 | + Preferences.settings.set_boolean("maximized", |
1095 | (bool) get_window().get_state() & Gdk.WindowState.MAXIMIZED); |
1096 | } |
1097 | return false; |
1098 | @@ -279,9 +242,6 @@ |
1099 | |
1100 | Gtk.Allocation win_alloc; |
1101 | get_allocation (out win_alloc); |
1102 | - resized (win_alloc); |
1103 | - |
1104 | - size_allocate.connect(resized); |
1105 | |
1106 | /* keyboard shortcuts bindings */ |
1107 | if (app.is_first_window ((Gtk.Window) this)) { |
1108 | @@ -297,21 +257,6 @@ |
1109 | |
1110 | } |
1111 | |
1112 | - private void load_css_style () { |
1113 | - css_provider = new Gtk.CssProvider(); |
1114 | - try { |
1115 | - css_provider.load_from_data (CSS_STYLE, -1); |
1116 | - StyleContext.add_provider_for_screen (screen, css_provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION); |
1117 | - } catch (Error e) { |
1118 | - warning ("Could not add css provider. Some widgets will not look as intended. %s", e.message); |
1119 | - } |
1120 | - } |
1121 | - |
1122 | - private void unload_css_style () { |
1123 | - if (css_provider != null) |
1124 | - StyleContext.remove_provider_for_screen (screen, css_provider); |
1125 | - } |
1126 | - |
1127 | private void show_infobar (bool val) { |
1128 | if (val) |
1129 | info_bar.show_all (); |
1130 | @@ -323,7 +268,7 @@ |
1131 | public virtual signal void go_up () { |
1132 | action_go_up (); |
1133 | } |
1134 | - |
1135 | + |
1136 | [Signal (action=true)] |
1137 | public virtual signal void edit_path () { |
1138 | action_edit_path (); |
1139 | @@ -335,7 +280,7 @@ |
1140 | |
1141 | |
1142 | public GOF.Window.Slot? get_active_slot() { |
1143 | - if (current_tab != null) |
1144 | + if (current_tab != null) |
1145 | return current_tab.get_active_slot (); |
1146 | return null; |
1147 | } |
1148 | @@ -363,17 +308,11 @@ |
1149 | current_tab.update_location_state(false); |
1150 | /* update radio action view state */ |
1151 | update_action_radio_view(current_tab.view_mode); |
1152 | - /* sync ContextView */ |
1153 | - current_tab.sync_contextview(); |
1154 | /* sync selection */ |
1155 | if (cur_slot.view_box != null) |
1156 | ((FM.Directory.View) cur_slot.view_box).sync_selection(); |
1157 | /* sync sidebar selection */ |
1158 | loading_uri (current_tab.slot.directory.file.uri, sidebar); |
1159 | - |
1160 | - /* focus the main view */ |
1161 | - //((FM.Directory.View) current_tab.slot.view_box).grab_focus(); |
1162 | - //current_tab.content.grab_focus(); |
1163 | } |
1164 | } |
1165 | } |
1166 | @@ -391,7 +330,7 @@ |
1167 | button.clicked.connect(() => { |
1168 | remove_tab(content); |
1169 | }); |
1170 | - |
1171 | + |
1172 | if (is_close_first ()) { |
1173 | hbox.pack_start (button, false, false, 0); |
1174 | hbox.pack_start (content.label, false, false, 0); |
1175 | @@ -401,7 +340,7 @@ |
1176 | } |
1177 | |
1178 | hbox.show_all(); |
1179 | - |
1180 | + |
1181 | var eventbox = new EventBox(); |
1182 | eventbox.add(hbox); |
1183 | eventbox.set_visible_window(false); |
1184 | @@ -435,41 +374,11 @@ |
1185 | |
1186 | tabs.remove(view_container); |
1187 | } |
1188 | - |
1189 | + |
1190 | public void add_window(File location){ |
1191 | ((Marlin.Application) application).create_window (location, screen); |
1192 | } |
1193 | |
1194 | -#if VALA_0_14 |
1195 | - private void resized(Gtk.Allocation allocation){ |
1196 | -#else |
1197 | - private void resized(Gdk.Rectangle allocation){ |
1198 | -#endif |
1199 | - Orientation current_state = main_box.orientation; |
1200 | - |
1201 | - int ctxview_orientation = Preferences.settings.get_enum("contextview-orientation"); |
1202 | - |
1203 | - Orientation future_state = Orientation.VERTICAL; // Because how Paned class works, this is inverted |
1204 | - switch (ctxview_orientation) { |
1205 | - case 0: |
1206 | - future_state = Orientation.VERTICAL; |
1207 | - break; |
1208 | - case 1: |
1209 | - future_state = Orientation.HORIZONTAL; |
1210 | - break; |
1211 | - case 2: |
1212 | - if(allocation.width > horizontal_contextplane_max_width && |
1213 | - allocation.height > horizontal_contextplane_max_height){ |
1214 | - future_state = Orientation.HORIZONTAL; |
1215 | - } |
1216 | - break; |
1217 | - } |
1218 | - |
1219 | - if(current_state != future_state){ |
1220 | - main_box.orientation = future_state; |
1221 | - } |
1222 | - } |
1223 | - |
1224 | private void undo_actions_set_insensitive () { |
1225 | Gtk.Action action; |
1226 | |
1227 | @@ -491,7 +400,7 @@ |
1228 | action.set_tooltip (_("Undo the last action")); |
1229 | } |
1230 | action.set_sensitive (data != null && data.undo_label != null); |
1231 | - |
1232 | + |
1233 | action = main_actions.get_action ("Redo"); |
1234 | if (data != null && data.redo_label != null && sensitive) { |
1235 | action.set_label (data.redo_label); |
1236 | @@ -531,9 +440,6 @@ |
1237 | if (is_maximized == false) |
1238 | Preferences.settings.set_string("geometry", geometry); |
1239 | Preferences.settings.set_boolean("maximized", is_maximized); |
1240 | - |
1241 | - Preferences.settings.set_boolean("start-with-contextview", |
1242 | - ((Gtk.ToggleAction) main_actions.get_action("Show Hide Context Pane")).get_active()); |
1243 | } |
1244 | |
1245 | public Gtk.ActionGroup get_actiongroup () { |
1246 | @@ -544,18 +450,11 @@ |
1247 | top_menu.setup_items(); |
1248 | } |
1249 | |
1250 | - /* |
1251 | - private void action_toolbar_editor_callback (Gtk.Action action) { |
1252 | - marlin_toolbar_editor_dialog_show (this); |
1253 | - } |
1254 | - */ |
1255 | - |
1256 | private void action_go_up () { |
1257 | current_tab.up(); |
1258 | } |
1259 | |
1260 | private void action_edit_path () { |
1261 | - //top_menu.location_bar.state = false; |
1262 | top_menu.location_bar.get_child ().grab_focus (); |
1263 | } |
1264 | |
1265 | @@ -566,17 +465,16 @@ |
1266 | private void action_go_forward (Gtk.Action action) { |
1267 | current_tab.forward(); |
1268 | } |
1269 | - |
1270 | + |
1271 | private uint t_reload_cb = 0; |
1272 | - |
1273 | + |
1274 | private bool real_reload_callback () { |
1275 | current_tab.reload (); |
1276 | t_reload_cb = 0; |
1277 | return false; |
1278 | } |
1279 | - |
1280 | + |
1281 | private bool is_close_first () { |
1282 | - |
1283 | string path = "/apps/metacity/general/button_layout"; |
1284 | GConf.Client cl = GConf.Client.get_default (); |
1285 | string key; |
1286 | @@ -597,7 +495,7 @@ |
1287 | return false; |
1288 | |
1289 | } |
1290 | - |
1291 | + |
1292 | private bool is_marlin_mydefault_fm () |
1293 | { |
1294 | bool trash_uri_is_default = false; |
1295 | @@ -608,7 +506,7 @@ |
1296 | |
1297 | return foldertype_is_default && trash_uri_is_default; |
1298 | } |
1299 | - |
1300 | + |
1301 | private void make_marlin_default_fm (bool active) |
1302 | { |
1303 | if (active) { |
1304 | @@ -623,7 +521,7 @@ |
1305 | } |
1306 | } else { |
1307 | AppInfo.reset_type_associations ("inode/directory"); |
1308 | - AppInfo.reset_type_associations ("x-scheme-handler/trash"); |
1309 | + AppInfo.reset_type_associations ("x-scheme-handler/trash"); |
1310 | } |
1311 | } |
1312 | |
1313 | @@ -636,43 +534,16 @@ |
1314 | /*private void action_show_hidden_files (Gtk.Action action) { |
1315 | }*/ |
1316 | |
1317 | - private void action_show_hide_contextview (Gtk.Action action) { |
1318 | - if (((Gtk.ToggleAction)action).get_active()) { |
1319 | - current_tab.sync_contextview(); |
1320 | - ((FM.Directory.View) current_tab.slot.view_box).sync_selection(); |
1321 | - } else { |
1322 | - //main_box.remove (contextview); |
1323 | - if (contextview != null) { |
1324 | - contextview.destroy(); |
1325 | - contextview = null; |
1326 | - } |
1327 | - } |
1328 | - } |
1329 | - |
1330 | - |
1331 | - private void action_show_hide_menubar (Gtk.Action action) { |
1332 | - bool vis = true; |
1333 | - menu_bar.get("visible", &vis); |
1334 | - if (vis) |
1335 | - top_menu.app_menu.hide(); |
1336 | - else |
1337 | - top_menu.app_menu.show_all(); |
1338 | - } |
1339 | - |
1340 | - /*private void action_show_hide_sidebar (Gtk.Action action) { |
1341 | - stdout.printf ("TODO\n"); |
1342 | - }*/ |
1343 | - |
1344 | private void action_undo_callback (Gtk.Action action) { |
1345 | update_undo_actions (); |
1346 | undo_manager.undo (null); |
1347 | } |
1348 | - |
1349 | + |
1350 | private void action_redo_callback (Gtk.Action action) { |
1351 | update_undo_actions (); |
1352 | undo_manager.redo (null); |
1353 | } |
1354 | - |
1355 | + |
1356 | private void action_home_callback (Gtk.Action action) { |
1357 | current_tab.path_changed(File.new_for_commandline_arg(Environment.get_home_dir())); |
1358 | } |
1359 | @@ -684,17 +555,17 @@ |
1360 | private void action_go_to_network_callback (Gtk.Action action) { |
1361 | current_tab.path_changed(File.new_for_commandline_arg(Marlin.NETWORK_URI)); |
1362 | } |
1363 | - |
1364 | + |
1365 | private void action_zoom_in_callback (Gtk.Action action) { |
1366 | - if (current_tab != null && current_tab.slot != null) |
1367 | + if (current_tab != null && current_tab.slot != null) |
1368 | ((FM.Directory.View) current_tab.slot.view_box).zoom_in (); |
1369 | } |
1370 | - |
1371 | + |
1372 | private void action_zoom_out_callback (Gtk.Action action) { |
1373 | - if (current_tab != null && current_tab.slot != null) |
1374 | + if (current_tab != null && current_tab.slot != null) |
1375 | ((FM.Directory.View) current_tab.slot.view_box).zoom_out (); |
1376 | } |
1377 | - |
1378 | + |
1379 | void action_next_tab() |
1380 | { |
1381 | if(tabs.page == tabs.get_n_pages() - 1) |
1382 | @@ -708,7 +579,7 @@ |
1383 | } |
1384 | |
1385 | private void action_zoom_normal_callback (Gtk.Action action) { |
1386 | - if (current_tab != null && current_tab.slot != null) |
1387 | + if (current_tab != null && current_tab.slot != null) |
1388 | ((FM.Directory.View) current_tab.slot.view_box).zoom_normal (); |
1389 | } |
1390 | |
1391 | @@ -735,7 +606,7 @@ |
1392 | "translate", Marlin.TRANSLATE_URL, |
1393 | "bug", Marlin.BUG_URL); |
1394 | } |
1395 | - |
1396 | + |
1397 | void show_report() { |
1398 | try { Gtk.show_uri (screen, Marlin.BUG_URL, -1); } |
1399 | catch (Error e) { critical("Can't open the link"); } |
1400 | @@ -836,7 +707,7 @@ |
1401 | /* label, accelerator */ N_("Previous Tab"), "<control>Page_Up", |
1402 | /* tooltip */ "", |
1403 | action_previous_tab }, |
1404 | - /* name, stock id */ { "Connect to Server", null, |
1405 | + /* name, stock id */ { "Connect to Server", null, |
1406 | /* label, accelerator */ N_("Connect to _Server..."), null, |
1407 | /* tooltip */ N_("Connect to a remote computer or shared disk"), |
1408 | action_connect_to_server_callback }, |
1409 | @@ -867,21 +738,6 @@ |
1410 | null, |
1411 | //action_show_hidden_files, |
1412 | true }, |
1413 | - /* name, stock id */ { "Show Desktop Files", null, |
1414 | - /* label, accelerator */ N_("Show _Desktop Files"), "<control>D", |
1415 | - /* tooltip */ N_("Toggle the display of desktop files"), |
1416 | - null, |
1417 | - true }, |
1418 | - /* name, stock id */ { "Show Hide Context Pane", null, |
1419 | - /* label, accelerator */ N_("_Context Pane"), "F7", |
1420 | - /* tooltip */ N_("Change the visibility of the context pane"), |
1421 | - action_show_hide_contextview, |
1422 | - /* is_active */ true }, |
1423 | - /* name, stock id */ { "Show Hide Menubar", null, |
1424 | - /* label, accelerator */ N_("_Menubar"), "F8", |
1425 | - /* tooltip */ N_("Change the visibility of this window's menubar"), |
1426 | - action_show_hide_menubar, |
1427 | - /* is_active */ true }, |
1428 | /* name, stock id */ { "Show Hide Sidebar", null, |
1429 | /* label, accelerator */ N_("_Places"), "F9", |
1430 | /* tooltip */ N_("Change the visibility of this window's side pane"), |
1431 | @@ -900,80 +756,7 @@ |
1432 | { "view-as-columns", null, |
1433 | N_("Columns"), "<control>3", null, |
1434 | ViewMode.MILLER } |
1435 | + |
1436 | }; |
1437 | - |
1438 | - /*enum RowColor { |
1439 | - NONE, |
1440 | - BUTTER, |
1441 | - ORANGE, |
1442 | - CHOCOLATE, |
1443 | - CHAMELEON, |
1444 | - SKYBLUE, |
1445 | - PLUM, |
1446 | - RED, |
1447 | - LIGHTGRAY, |
1448 | - DARKGRAY, |
1449 | - } |
1450 | - |
1451 | - static const Gtk.RadioActionEntry color_radio_entries[] = { |
1452 | - { "set-color-clear", null, |
1453 | - N_("None"), null, null, |
1454 | - RowColor.NONE }, |
1455 | - { "set-color-butter", null, |
1456 | - N_("Butter"), null, null, |
1457 | - RowColor.BUTTER }, |
1458 | - { "set-color-orange", null, |
1459 | - N_("Orange"), null, null, |
1460 | - RowColor.ORANGE }, |
1461 | - { "set-color-chocolate", null, |
1462 | - N_("Chocolate"), null, null, |
1463 | - RowColor.CHOCOLATE }, |
1464 | - { "set-color-chameleon", null, |
1465 | - N_("Green"), null, null, |
1466 | - RowColor.CHAMELEON }, |
1467 | - { "set-color-skyblue", null, |
1468 | - N_("Sky Blue"), null, null, |
1469 | - RowColor.SKYBLUE }, |
1470 | - { "set-color-plum", null, |
1471 | - N_("Plum"), null, null, |
1472 | - RowColor.PLUM }, |
1473 | - { "set-color-red", null, |
1474 | - N_("Scarlet Red"), null, null, |
1475 | - RowColor.RED }, |
1476 | - { "set-color-lightgray", null, |
1477 | - N_("Light Gray"), null, null, |
1478 | - RowColor.LIGHTGRAY }, |
1479 | - { "set-color-darkgray", null, |
1480 | - N_("Dark Gray"), null, null, |
1481 | - RowColor.DARKGRAY } |
1482 | - };*/ |
1483 | - |
1484 | - private const string CSS_STYLE = """ |
1485 | - ExoIconView.view { |
1486 | - background-color: @base_color; |
1487 | - } |
1488 | - |
1489 | - .sidebar, |
1490 | - .sidebar .view { |
1491 | - background-color: @bg_color; |
1492 | - } |
1493 | - |
1494 | - MarlinViewWindow * { |
1495 | - -GtkPaned-handle-size: 1; |
1496 | - } |
1497 | - |
1498 | - /*MarlinViewWindow .pane-separator {*/ |
1499 | - VarkaWidgetsCollapsiblePaned, |
1500 | - VarkaWidgetsCollapsiblePaned.pane-separator { |
1501 | - -GtkPaned-handle-size: 1; |
1502 | - background-color: shade (@bg_color, 0.95); |
1503 | - border-color: @dark_bg_color; |
1504 | - border-style: solid; |
1505 | - border-width: 0; |
1506 | - } |
1507 | - |
1508 | - """; |
1509 | - |
1510 | } |
1511 | } |
1512 | - |
1513 | |
1514 | === modified file 'src/pantheon-files-ui.xml' |
1515 | --- src/pantheon-files-ui.xml 2013-05-12 20:41:24 +0000 |
1516 | +++ src/pantheon-files-ui.xml 2013-05-13 19:45:28 +0000 |
1517 | @@ -16,12 +16,9 @@ |
1518 | <separator/> |
1519 | <menuitem name="Connect to Server" action="Connect to Server"/> |
1520 | <separator/> |
1521 | - <!--<placeholder name="Close Items Placeholder"/>--> |
1522 | <menuitem name="Close" action="Close"/> |
1523 | </menu> |
1524 | <menu name="Edit" action="Edit"> |
1525 | - <!--<placeholder name="Undostack Actions"/> |
1526 | - <separator/>--> |
1527 | <placeholder name="Undostack Actions"> |
1528 | <menuitem name="Undo" action="Undo"/> |
1529 | <menuitem name="Redo" action="Redo"/> |
1530 | @@ -29,81 +26,37 @@ |
1531 | <separator/> |
1532 | <placeholder name="Clipboard Actions"/> |
1533 | <separator/> |
1534 | - <!--<placeholder name="Select Items"/>--> |
1535 | <placeholder name="File Items Placeholder"/> |
1536 | <separator/> |
1537 | <placeholder name="Dangerous File Actions"/> |
1538 | <separator/> |
1539 | - <!--<menuitem name="ToolbarEditor" action="ToolbarEditor"/>--> |
1540 | - <!--<menu action="ColorMenu">--> |
1541 | - <!-- <menuitem action="set-color-clear" /> |
1542 | - <menuitem action="set-color-butter" /> |
1543 | - <menuitem action="set-color-orange" /> |
1544 | - <menuitem action="set-color-chocolate" /> |
1545 | - <menuitem action="set-color-chameleon" /> |
1546 | - <menuitem action="set-color-skyblue" /> |
1547 | - <menuitem action="set-color-plum" /> |
1548 | - <menuitem action="set-color-red" /> |
1549 | - <menuitem action="set-color-lightgray" /> |
1550 | - <menuitem action="set-color-darkgray" />--> |
1551 | - <!--</menu>--> |
1552 | - |
1553 | - <!--<menuitem name="Preferences" action="Preferences"/>--> |
1554 | </menu> |
1555 | <menu action="View"> |
1556 | - <!--<menuitem name="Stop" action="Stop"/>--> |
1557 | <menuitem name="Reload" action="Reload"/> |
1558 | <separator/> |
1559 | - <!--<menuitem name="Show Hide Toolbar" action="Show Hide Toolbar"/>--> |
1560 | - <menuitem name="Show Hide Menubar" action="Show Hide Menubar"/> |
1561 | - <menuitem name="Show Hide Sidebar" action="Show Hide Sidebar"/> |
1562 | - <separator/> |
1563 | - |
1564 | - <menuitem name="Show Desktop Files" action="Show Desktop Files"/> |
1565 | - <!--<separator/>--> |
1566 | + <menuitem name="Show Hide Sidebar" action="Show Hide Sidebar"/> |
1567 | + <separator/> |
1568 | <placeholder name="View Items Placeholder"/> |
1569 | <separator/> |
1570 | - <placeholder name="Zoom Items Placeholder"> |
1571 | - <menuitem name="Zoom In" action="Zoom In"/> |
1572 | - <menuitem name="Zoom Out" action="Zoom Out"/> |
1573 | - <menuitem name="Zoom Normal" action="Zoom Normal"/> |
1574 | - </placeholder> |
1575 | - <!--<separator/> |
1576 | - <placeholder name="Show Hide Clutter"> |
1577 | - <menuitem name="Clutterflow" action="Show Hide Clutter"/> |
1578 | - </placeholder> |
1579 | - <menuitem name="Embed Terminal" action="Show Hide Embed Terminal"/> |
1580 | - <placeholder name="View Choices"> |
1581 | - <separator/> |
1582 | - <placeholder name="Extra Viewer"/> |
1583 | - <separator name="Before Short List"/> |
1584 | - <placeholder name="Short List"/> |
1585 | - </placeholder>--> |
1586 | - <separator/> |
1587 | - <menuitem action="view-as-icons" /> |
1588 | - <menuitem action="view-as-detailed-list" /> |
1589 | - <menuitem action="view-as-columns" /> |
1590 | + <placeholder name="Zoom Items Placeholder"> |
1591 | + <menuitem name="Zoom In" action="Zoom In"/> |
1592 | + <menuitem name="Zoom Out" action="Zoom Out"/> |
1593 | + <menuitem name="Zoom Normal" action="Zoom Normal"/> |
1594 | + </placeholder> |
1595 | + <separator/> |
1596 | + <menuitem action="view-as-icons" /> |
1597 | + <menuitem action="view-as-detailed-list" /> |
1598 | + <menuitem action="view-as-columns" /> |
1599 | </menu> |
1600 | <menu action="Go"> |
1601 | <menuitem name="Up" action="Up"/> |
1602 | <menuitem name="Back" action="Back"/> |
1603 | <menuitem name="Forward" action="Forward"/> |
1604 | <separator/> |
1605 | - <menuitem name="Home" action="Home"/> |
1606 | - <!--<menuitem name="Computer" action="Go to Computer"/>--> |
1607 | - <menuitem name="Go to Trash" action="Go to Trash"/> |
1608 | - <menuitem name="Go to Network" action="Go to Network"/> |
1609 | - <!-- <menuitem name="Go to Location" action="Go to Location"/> |
1610 | - <menuitem name="Search" action="Search"/> |
1611 | - <separator/> |
1612 | - <placeholder name="History Placeholder"/>--> |
1613 | + <menuitem name="Home" action="Home"/> |
1614 | + <menuitem name="Go to Trash" action="Go to Trash"/> |
1615 | + <menuitem name="Go to Network" action="Go to Network"/> |
1616 | </menu> |
1617 | - <!--<menu action="Bookmarks"> |
1618 | - <menuitem name="Add Bookmark" action="Add Bookmark"/> |
1619 | - <menuitem name="Edit Bookmark" action="Edit Bookmarks"/> |
1620 | - <separator/> |
1621 | - <placeholder name="Bookmarks Placeholder"/> |
1622 | - </menu>--> |
1623 | <menu action="Help"> |
1624 | <menuitem name="GetHelp" action="GetHelp"/> |
1625 | <menuitem name="Translate" action="Translate"/> |
1626 | @@ -112,27 +65,9 @@ |
1627 | <menuitem name="About" action="About"/> |
1628 | </menu> |
1629 | </menubar> |
1630 | -<!--<popup name="background"> |
1631 | - <placeholder name="Before Zoom Items"> |
1632 | - <placeholder name="New Window Items"/> |
1633 | - <placeholder name="New Object Items"/> |
1634 | - <separator/> |
1635 | - <placeholder name="Extension Actions"/> |
1636 | - </placeholder> |
1637 | - <separator/> |
1638 | - <placeholder name="Zoom Items"> |
1639 | - <menuitem name="Zoom Normal" action="Zoom Normal"/> |
1640 | - </placeholder> |
1641 | - <separator/> |
1642 | - <placeholder name="After Zoom Items"/> |
1643 | -</popup>--> |
1644 | |
1645 | <popup name="ToolbarMenu" accelerators="false"> |
1646 | - <!--<menuitem name="Show Hide Context Pane" action="Show Hide Context Pane"/>--> |
1647 | - <menuitem name="Show Hide Menubar" action="Show Hide Menubar"/> |
1648 | <menuitem name="Show Hide Sidebar" action="Show Hide Sidebar"/> |
1649 | - <separator/> |
1650 | - <!--<menuitem name="ToolbarEditor" action="ToolbarEditor"/>--> |
1651 | </popup> |
1652 | |
1653 | <popup name="CompactMenu" accelerators="false"> |
1654 | @@ -141,13 +76,6 @@ |
1655 | <separator/> |
1656 | <menuitem name="Connect to Server" action="Connect to Server"/> |
1657 | <separator/> |
1658 | - <!-- |
1659 | - <menuitem name="Undo" action="Undo"/> |
1660 | - <menuitem name="Redo" action="Redo"/> |
1661 | - <separator/> |
1662 | - <menuitem name="Connect to Server" action="Connect to Server"/> |
1663 | - <separator/> |
1664 | - <menuitem name="Reset to Defaults" action="Reset to Defaults"/>--> |
1665 | <menuitem name="About" action="About"/> |
1666 | </popup> |
1667 | </ui> |
Right clicking the toolbar seems to show an empty menu. Otherwise this works.
We should probably retain the toolbar menu item for hide/show source list until we figure out a better way to do this.