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