Merge lp:~elementary-apps/pantheon-photos/sidebar-size-label into lp:~pantheon-photos/pantheon-photos/trunk

Proposed by Danielle Foré
Status: Merged
Approved by: Felipe Escoto
Approved revision: no longer in the source branch.
Merged at revision: 3042
Proposed branch: lp:~elementary-apps/pantheon-photos/sidebar-size-label
Merge into: lp:~pantheon-photos/pantheon-photos/trunk
Prerequisite: lp:~elementary-apps/pantheon-photos/sidebar-info-to-top
Diff against target: 82 lines (+8/-11)
2 files modified
src/sidebar/metadata/BasicProperties.vala (+8/-5)
src/sidebar/metadata/ExtendedProperties.vala (+0/-6)
To merge this branch: bzr merge lp:~elementary-apps/pantheon-photos/sidebar-size-label
Reviewer Review Type Date Requested Status
Felipe Escoto (community) Approve
Review via email: mp+310141@code.launchpad.net

Commit message

BasicProperties.vala: Add filesize and combine it with dimensions a la Files

ExtendedProperties.vala: Remove filesize

Description of the change

Mimics the design of Files overlaybar and places size info in a single line separated by an em dash

Relies on the info on top branch because we need source to be a mediasource

To post a comment you must log in.
Revision history for this message
Felipe Escoto (philip.scott) wrote :

Looks good! Just waiting for the sidebar-info-to-top :)

review: Approve
3040. By Danielle Foré

put size info on a single line

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/sidebar/metadata/BasicProperties.vala'
2--- src/sidebar/metadata/BasicProperties.vala 2016-11-06 16:56:17 +0000
3+++ src/sidebar/metadata/BasicProperties.vala 2016-11-06 18:22:00 +0000
4@@ -21,6 +21,7 @@
5 private double clip_duration;
6 private string raw_developer;
7 private string raw_assoc;
8+ private uint64 filesize;
9
10 public BasicProperties () {
11 }
12@@ -35,6 +36,7 @@
13 start_time = 0;
14 end_time = 0;
15 dimensions = Dimensions (0, 0);
16+ filesize = 0;
17 focal_length = "";
18 photo_count = -1;
19 event_count = -1;
20@@ -52,6 +54,7 @@
21
22 source = view.get_source () as MediaSource;
23
24+ filesize = source.get_master_filesize ();
25 title = source.get_name ();
26
27 if (source is PhotoSource || source is PhotoImportSource) {
28@@ -263,12 +266,12 @@
29 }
30
31 if (dimensions.has_area ()) {
32- string label = _ ("Size:");
33+ var size_label = new Gtk.Label ("%s — %d × %d".printf (format_size ((int64) filesize), dimensions.width, dimensions.height));
34+ size_label.use_markup = true;
35+ size_label.xalign = 0;
36+ attach (size_label, 0, (int) line_count, 2, 1);
37
38- if (dimensions.has_area ()) {
39- add_line (label, "%d × %d".printf (dimensions.width, dimensions.height));
40- label = "";
41- }
42+ line_count++;
43 }
44
45 if (clip_duration > 0.0) {
46
47=== modified file 'src/sidebar/metadata/ExtendedProperties.vala'
48--- src/sidebar/metadata/ExtendedProperties.vala 2016-11-06 17:15:40 +0000
49+++ src/sidebar/metadata/ExtendedProperties.vala 2016-11-06 18:22:00 +0000
50@@ -8,7 +8,6 @@
51 private const string NO_VALUE = "";
52 // Photo stuff
53 private string file_path;
54- private uint64 filesize;
55 private string camera_make;
56 private string camera_model;
57 private string flash;
58@@ -42,7 +41,6 @@
59 file_path = "";
60 development_path = "";
61 is_raw = false;
62- filesize = 0;
63 camera_make = "";
64 camera_model = "";
65 flash = "";
66@@ -69,7 +67,6 @@
67 MediaSource media = (MediaSource) source;
68 file_path = media.get_master_file ().get_path ();
69 development_path = media.get_file ().get_path ();
70- filesize = media.get_master_filesize ();
71
72 // as of right now, all extended properties other than filesize, filepath & comment aren't
73 // applicable to non-photo media types, so if the current media source isn't a photo,
74@@ -127,9 +124,6 @@
75 } else {
76 add_line (_("Location:"), (file_path != "" && file_path != null) ? file_path.replace ("&", "&") : NO_VALUE);
77
78- add_line (_ ("File size:"), (filesize > 0) ?
79- format_size ((int64) filesize) : NO_VALUE);
80-
81 if (is_raw)
82 add_line (_ ("Developer:"), development_path);
83

Subscribers

People subscribed via source and target branches