Merge lp:~zarnimng/pantheon-files/fix-1617035-remove-preview-tab into lp:~elementary-apps/pantheon-files/trunk

Proposed by Zarni Wang
Status: Merged
Approved by: Zisu Andrei
Approved revision: 2299
Merged at revision: 2298
Proposed branch: lp:~zarnimng/pantheon-files/fix-1617035-remove-preview-tab
Merge into: lp:~elementary-apps/pantheon-files/trunk
Diff against target: 79 lines (+1/-43)
2 files modified
src/View/AbstractPropertiesDialog.vala (+1/-2)
src/View/PropertiesWindow.vala (+0/-41)
To merge this branch: bzr merge lp:~zarnimng/pantheon-files/fix-1617035-remove-preview-tab
Reviewer Review Type Date Requested Status
Zisu Andrei (community) Needs Fixing
Review via email: mp+303994@code.launchpad.net

Commit message

Remove "Preview" pane in the properties window

To post a comment you must log in.
Revision history for this message
Zisu Andrei (matzipan) wrote :

Hey Zarni,

That was quick. Maybe it's also worth removing the PREVIEW field in the PanelType enum in src/View/AbstractPropertiesDialog.vala

review: Needs Fixing
2299. By Zarni Wang

Removes PanelType.PREVIEW

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/View/AbstractPropertiesDialog.vala'
2--- src/View/AbstractPropertiesDialog.vala 2016-07-03 17:40:02 +0000
3+++ src/View/AbstractPropertiesDialog.vala 2016-08-25 20:51:33 +0000
4@@ -31,8 +31,7 @@
5
6 protected enum PanelType {
7 INFO,
8- PERMISSIONS,
9- PREVIEW
10+ PERMISSIONS
11 }
12
13 public AbstractPropertiesDialog (string _title, Gtk.Window parent) {
14
15=== modified file 'src/View/PropertiesWindow.vala'
16--- src/View/PropertiesWindow.vala 2016-07-03 17:40:02 +0000
17+++ src/View/PropertiesWindow.vala 2016-08-25 20:51:33 +0000
18@@ -23,7 +23,6 @@
19 namespace Marlin.View {
20
21 public class PropertiesWindow : AbstractPropertiesDialog {
22- private Granite.Widgets.ImgEventBox evbox;
23 private Granite.Widgets.XsEntry perm_code;
24 private bool perm_code_should_update = true;
25 private Gtk.Label l_perm;
26@@ -207,28 +206,6 @@
27 }
28 }
29
30- /* Preview */
31- if (count == 1 && goffile.flags != 0) {
32- /* Retrieve the low quality (existent) thumbnail.
33- * This will be shown to prevent resizing the properties window
34- * when the large preview is retrieved.
35- */
36- Gdk.Pixbuf small_preview;
37-
38- if (view.is_in_recent ()) {
39- small_preview = goffile.get_icon_pixbuf (256, true, GOF.FileIconFlags.NONE);
40- } else {
41- small_preview = goffile.get_icon_pixbuf (256, true, GOF.FileIconFlags.USE_THUMBNAILS);
42- }
43-
44- /* Request the creation of the large thumbnail */
45- Marlin.Thumbnailer.get ().queue_file (goffile, null, /* LARGE */ true);
46- var preview_box = new Gtk.Box (Gtk.Orientation.VERTICAL, 0);
47-
48- construct_preview_panel (preview_box, small_preview);
49- add_section (stack, _("Preview"), PanelType.PREVIEW.to_string (), preview_box);
50- }
51-
52 show_all ();
53 update_widgets_state ();
54 }
55@@ -1167,24 +1144,6 @@
56 return choice;
57 }
58
59- private void construct_preview_panel (Gtk.Box box, Gdk.Pixbuf? small_preview) {
60- evbox = new Granite.Widgets.ImgEventBox (Gtk.Orientation.HORIZONTAL);
61- if (small_preview != null)
62- evbox.set_from_pixbuf (small_preview);
63- box.pack_start (evbox, false, true, 0);
64-
65- goffile.icon_changed.connect (() => {
66- var large_preview_path = goffile.get_preview_path ();
67- if (large_preview_path != null)
68- try {
69- var large_preview = new Gdk.Pixbuf.from_file (large_preview_path);
70- evbox.set_from_pixbuf (large_preview);
71- } catch (Error e) {
72- warning (e.message);
73- }
74- });
75- }
76-
77 private Icon ensure_icon (AppInfo app) {
78 Icon icon = app.get_icon ();
79 if (icon == null)

Subscribers

People subscribed via source and target branches

to all changes: