Merge lp:~elementary-apps/pantheon-photos/sidebar-info-to-top 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: 3040
Proposed branch: lp:~elementary-apps/pantheon-photos/sidebar-info-to-top
Merge into: lp:~pantheon-photos/pantheon-photos/trunk
Diff against target: 162 lines (+29/-22)
4 files modified
src/sidebar/EditableTitle.vala (+1/-0)
src/sidebar/metadata/BasicProperties.vala (+27/-5)
src/sidebar/metadata/LibraryProperties.vala (+0/-16)
src/sidebar/metadata/MetadataSidebar.vala (+1/-1)
To merge this branch: bzr merge lp:~elementary-apps/pantheon-photos/sidebar-info-to-top
Reviewer Review Type Date Requested Status
Photos Devs Pending
Review via email: mp+310130@code.launchpad.net

Commit message

EditableTitle.vala: Give the label h3

BasicProperties.vala: Add the title entry to the top of this box

LibraryProperties.vala: Remove the title entry from this box

MetadataSidebar.vala: Move basic properties to the top

Description of the change

Another step in the evil plan for world domination!

To post a comment you must log in.
3039. By Danielle Foré

move image info to top

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/sidebar/EditableTitle.vala'
2--- src/sidebar/EditableTitle.vala 2016-11-06 03:44:50 +0000
3+++ src/sidebar/EditableTitle.vala 2016-11-06 16:56:42 +0000
4@@ -61,6 +61,7 @@
5
6 title = new Gtk.Label (title_name);
7 title.ellipsize = Pango.EllipsizeMode.END;
8+ title.get_style_context ().add_class ("h3");
9 title.hexpand = true;
10 ((Gtk.Misc) title).xalign = 0;
11
12
13=== modified file 'src/sidebar/metadata/BasicProperties.vala'
14--- src/sidebar/metadata/BasicProperties.vala 2016-11-05 23:13:53 +0000
15+++ src/sidebar/metadata/BasicProperties.vala 2016-11-06 16:56:42 +0000
16@@ -5,15 +5,17 @@
17 */
18
19 private class BasicProperties : Properties {
20- protected string title;
21 private time_t start_time = time_t ();
22 private time_t end_time = time_t ();
23 private Dimensions dimensions;
24+ private EditableTitle title_entry;
25+ private MediaSource? source;
26 private int photo_count;
27 private int event_count;
28 private int video_count;
29 private string exposure;
30 private string focal_length;
31+ private string title;
32 private string aperture;
33 private string iso;
34 private double clip_duration;
35@@ -48,7 +50,7 @@
36 protected override void get_single_properties (DataView view) {
37 base.get_single_properties (view);
38
39- DataSource source = view.get_source ();
40+ source = view.get_source () as MediaSource;
41
42 title = source.get_name ();
43
44@@ -194,9 +196,19 @@
45 protected override void internal_update_properties (Page page) {
46 base.internal_update_properties (page);
47
48- // display the title if a Tag page
49- if (title == "" && page is TagPage)
50- title = ((TagPage) page).get_tag ().get_user_visible_name ();
51+ if (title != "") {
52+ title_entry = new EditableTitle (null);
53+ title_entry.tooltip_text = _("Title");
54+
55+ if (title != null) {
56+ title_entry.text = title;
57+ }
58+
59+ title_entry.changed.connect (title_entry_changed);
60+ attach (title_entry, 0, 0, 2, 1);
61+
62+ line_count++;
63+ }
64
65 if (photo_count >= 0 || video_count >= 0) {
66 string label = _ ("Items:");
67@@ -301,6 +313,16 @@
68 }
69 }
70
71+ public override void save_changes_to_source () {
72+ if (source != null && title != null && title != source.get_name ()) {
73+ AppWindow.get_command_manager ().execute (new EditTitleCommand (source, title));
74+ }
75+ }
76+
77+ private void title_entry_changed () {
78+ title = title_entry.text;
79+ }
80+
81 private class ExifItem : Gtk.FlowBoxChild {
82 public ExifItem (string icon_name, string tooltip_text, string data) {
83 can_focus = false;
84
85=== modified file 'src/sidebar/metadata/LibraryProperties.vala'
86--- src/sidebar/metadata/LibraryProperties.vala 2016-11-06 16:49:31 +0000
87+++ src/sidebar/metadata/LibraryProperties.vala 2016-11-06 16:56:42 +0000
88@@ -7,11 +7,9 @@
89 private class LibraryProperties : Properties {
90 private MediaSource? media_source;
91 private string comment;
92- private EditableTitle title_entry;
93 private Gtk.Entry tags_entry;
94 private PlaceHolderTextView comment_entry;
95 private bool is_media;
96- private string title;
97 private string tags;
98
99 public LibraryProperties () {
100@@ -30,7 +28,6 @@
101 protected override void clear_properties () {
102 base.clear_properties ();
103 comment = "";
104- title = "";
105 tags = "";
106 is_media = false;
107 }
108@@ -52,7 +49,6 @@
109 Flaggable? flaggable = media_source as Flaggable;
110 if (media_source != null && flaggable != null) {
111 tags = get_initial_tag_text (media_source);
112- title = media_source.get_name ();
113 comment = media_source.get_comment ();
114 is_media = true;
115 }
116@@ -62,12 +58,6 @@
117 base.internal_update_properties (page);
118
119 if (is_media) {
120- title_entry = new EditableTitle (null);
121- if (title != null)
122- title_entry.text = title;
123- title_entry.changed.connect (title_entry_changed);
124- add_entry_line (_("Title"), title_entry);
125-
126 comment_entry = new PlaceHolderTextView (comment, _("Comment"));
127 comment_entry.set_wrap_mode (Gtk.WrapMode.WORD);
128 comment_entry.set_size_request (-1, 50);
129@@ -88,10 +78,6 @@
130 }
131 }
132
133- private void title_entry_changed () {
134- title = title_entry.text;
135- }
136-
137 private void tags_entry_changed () {
138 tags = tags_entry.get_text ();
139 }
140@@ -104,8 +90,6 @@
141 public override void save_changes_to_source () {
142 if (media_source != null && is_media) {
143 comment = comment_entry.get_text ().strip ();
144- if (title != null && title != media_source.get_name ())
145- AppWindow.get_command_manager ().execute (new EditTitleCommand (media_source, title));
146 if (comment != null && comment != media_source.get_comment ())
147 AppWindow.get_command_manager ().execute (new EditCommentCommand (media_source, comment));
148 Gee.ArrayList<Tag>? new_tags = tag_entry_to_array ();
149
150=== modified file 'src/sidebar/metadata/MetadataSidebar.vala'
151--- src/sidebar/metadata/MetadataSidebar.vala 2016-11-04 20:38:30 +0000
152+++ src/sidebar/metadata/MetadataSidebar.vala 2016-11-06 16:56:42 +0000
153@@ -38,8 +38,8 @@
154 grid.row_spacing = 12;
155 grid.margin = 12;
156
157+ properties_collection.append (new BasicProperties ());
158 properties_collection.append (new LibraryProperties ());
159- properties_collection.append (new BasicProperties ());
160 properties_collection.append (new ExtendedProperties ());
161
162 foreach (var properties in properties_collection) {

Subscribers

People subscribed via source and target branches