Merge lp:~elementary-apps/pantheon-photos/remove-title-option into lp:~pantheon-photos/pantheon-photos/trunk

Proposed by Danielle Foré
Status: Rejected
Rejected by: Corentin Noël
Proposed branch: lp:~elementary-apps/pantheon-photos/remove-title-option
Merge into: lp:~pantheon-photos/pantheon-photos/trunk
Diff against target: 311 lines (+6/-113)
8 files modified
data/ui/media.ui (+0/-1)
schemas/org.pantheon.photos.gschema.xml (+0/-6)
src/CheckerboardLayout.vala (+6/-37)
src/MediaPage.vala (+0/-24)
src/Page.vala (+0/-6)
src/PhotoPage.vala (+0/-6)
src/camera/ImportPage.vala (+0/-32)
src/config/GSettingsEngine.vala (+0/-1)
To merge this branch: bzr merge lp:~elementary-apps/pantheon-photos/remove-title-option
Reviewer Review Type Date Requested Status
Corentin Noël Disapprove
Review via email: mp+315740@code.launchpad.net

Commit message

Remove option to hide photo titles

Description of the change

We don't allow hiding item titles in other views (Files, Videos, Music)

To post a comment you must log in.
Revision history for this message
Corentin Noël (tintou) wrote :

This option should maybe disappear from the DConf but I don't think it's a good idea to show per-photo names, it might be a "convenient" alternative to show a popover with the photo name if you really want to but the name is still available when clicking on a photo.
I think people have to name albums but no single photos.

review: Disapprove

Unmerged revisions

3139. By Danielle Foré

remove option to hide titles

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'data/ui/media.ui'
2--- data/ui/media.ui 2016-09-20 00:44:41 +0000
3+++ data/ui/media.ui 2017-01-27 03:10:46 +0000
4@@ -3,7 +3,6 @@
5 <menuitem name="DisplaySidebar" action="CommonDisplaySidebar" />
6 <menuitem name="DisplayMetadataSidebar" action="CommonDisplayMetadataSidebar" />
7 <separator />
8- <menuitem name="ViewTitle" action="ViewTitle" />
9 <menuitem name="ViewComment" action="ViewComment" />
10 <menuitem name="ViewTags" action="ViewTags" />
11 <separator />
12
13=== modified file 'schemas/org.pantheon.photos.gschema.xml'
14--- schemas/org.pantheon.photos.gschema.xml 2016-09-20 02:34:17 +0000
15+++ schemas/org.pantheon.photos.gschema.xml 2017-01-27 03:10:46 +0000
16@@ -47,12 +47,6 @@
17 <description>True if the Search/Filter Toolbar is to be displayed, false otherwise.</description>
18 </key>
19
20- <key name="display-photo-titles" type="b">
21- <default>false</default>
22- <summary>display photo titles</summary>
23- <description>True if photo titles are to be displayed beneath thumbnails in collection views, false otherwise.</description>
24- </key>
25-
26 <key name="display-photo-comments" type="b">
27 <default>false</default>
28 <summary>display photo comments</summary>
29
30=== modified file 'src/CheckerboardLayout.vala'
31--- src/CheckerboardLayout.vala 2017-01-26 22:15:26 +0000
32+++ src/CheckerboardLayout.vala 2017-01-27 03:10:46 +0000
33@@ -110,8 +110,6 @@
34
35 public abstract class CheckerboardItem : ThumbnailView {
36 // Collection properties CheckerboardItem understands
37- // SHOW_TITLES (bool)
38- public const string PROP_SHOW_TITLES = "show-titles";
39 // SHOW_COMMENTS (bool)
40 public const string PROP_SHOW_COMMENTS = "show-comments";
41 // SHOW_SUBTITLES (bool)
42@@ -129,7 +127,6 @@
43
44 private bool exposure = false;
45 private CheckerboardItemText? title = null;
46- private bool title_visible = true;
47 private CheckerboardItemText? comment = null;
48 private bool comment_visible = true;
49 private CheckerboardItemText? subtitle = null;
50@@ -179,11 +176,8 @@
51 return;
52
53 title = new CheckerboardItemText (text, alignment, marked_up);
54-
55- if (title_visible) {
56- recalc_size ("set_title");
57- notify_view_altered ();
58- }
59+ recalc_size ("set_title");
60+ notify_view_altered ();
61 }
62
63 public void clear_title () {
64@@ -191,20 +185,7 @@
65 return;
66
67 title = null;
68-
69- if (title_visible) {
70- recalc_size ("clear_title");
71- notify_view_altered ();
72- }
73- }
74-
75- private void set_title_visible (bool visible) {
76- if (title_visible == visible)
77- return;
78-
79- title_visible = visible;
80-
81- recalc_size ("set_title_visible");
82+ recalc_size ("clear_title");
83 notify_view_altered ();
84 }
85
86@@ -284,16 +265,10 @@
87 }
88
89 protected override void notify_membership_changed (DataCollection? collection) {
90- bool title_visible = (bool) get_collection_property (PROP_SHOW_TITLES, true);
91 bool comment_visible = (bool) get_collection_property (PROP_SHOW_COMMENTS, true);
92 bool subtitle_visible = (bool) get_collection_property (PROP_SHOW_SUBTITLES, false);
93
94 bool altered = false;
95- if (this.title_visible != title_visible) {
96- this.title_visible = title_visible;
97- altered = true;
98- }
99-
100 if (this.comment_visible != comment_visible) {
101 this.comment_visible = comment_visible;
102 altered = true;
103@@ -314,14 +289,9 @@
104
105 protected override void notify_collection_property_set (string name, Value? old, Value val) {
106 switch (name) {
107- case PROP_SHOW_TITLES:
108- set_title_visible ((bool) val);
109- break;
110-
111 case PROP_SHOW_COMMENTS:
112 set_comment_visible ((bool) val);
113 break;
114-
115 case PROP_SHOW_SUBTITLES:
116 set_subtitle_visible ((bool) val);
117 break;
118@@ -398,8 +368,7 @@
119 Dimensions old_requisition = requisition;
120
121 // only add in the text heights if they're displayed
122- int title_height = (title != null && title_visible)
123- ? title.get_height () + LABEL_PADDING : 0;
124+ int title_height = (title != null) ? title.get_height () + LABEL_PADDING : 0;
125 int comment_height = (comment != null && comment_visible)
126 ? comment.get_height () + LABEL_PADDING : 0;
127 int subtitle_height = (subtitle != null && subtitle_visible)
128@@ -508,7 +477,7 @@
129 style_context.add_class (Gtk.STYLE_CLASS_LABEL);
130 // title and subtitles are LABEL_PADDING below bottom of pixbuf
131 int text_y = allocation.y + FRAME_WIDTH + pixbuf_dim.height + FRAME_WIDTH + LABEL_PADDING;
132- if (title != null && title_visible) {
133+ if (title != null) {
134 // get the layout sized so its with is no more than the pixbuf's
135 // resize the text width to be no more than the pixbuf's
136 title.allocation.x = allocation.x + FRAME_WIDTH;
137@@ -613,7 +582,7 @@
138 }
139
140 public bool query_tooltip (int x, int y, Gtk.Tooltip tooltip) {
141- if (title != null && title_visible && coord_in_rectangle (x, y, title.allocation))
142+ if (title != null && coord_in_rectangle (x, y, title.allocation))
143 return query_tooltip_on_text (title, tooltip);
144
145 if (comment != null && comment_visible && coord_in_rectangle (x, y, comment.allocation))
146
147=== modified file 'src/MediaPage.vala'
148--- src/MediaPage.vala 2017-01-26 23:05:03 +0000
149+++ src/MediaPage.vala 2017-01-27 03:10:46 +0000
150@@ -165,8 +165,6 @@
151 get_view ().items_altered.connect (on_media_altered);
152
153 get_view ().freeze_notifications ();
154- get_view ().set_property (CheckerboardItem.PROP_SHOW_TITLES,
155- Config.Facade.get_instance ().get_display_photo_titles ());
156 get_view ().set_property (CheckerboardItem.PROP_SHOW_COMMENTS,
157 Config.Facade.get_instance ().get_display_photo_comments ());
158 get_view ().set_property (Thumbnail.PROP_SHOW_TAGS,
159@@ -258,11 +256,6 @@
160 protected override Gtk.ToggleActionEntry[] init_collect_toggle_action_entries () {
161 Gtk.ToggleActionEntry[] toggle_actions = base.init_collect_toggle_action_entries ();
162
163- Gtk.ToggleActionEntry titles = { "ViewTitle", null, _("_Titles"), "<Ctrl><Shift>T",
164- _("Display the title of each photo"), on_display_titles, Config.Facade.get_instance ().get_display_photo_titles ()
165- };
166- toggle_actions += titles;
167-
168 Gtk.ToggleActionEntry comments = { "ViewComment", null, _("_Comments"), "<Ctrl><Shift>C",
169 _("Display the comment of each photo"), on_display_comments, Config.Facade.get_instance ().get_display_photo_comments ()
170 };
171@@ -480,7 +473,6 @@
172
173 // set display options to match Configuration toggles (which can change while switched away)
174 get_view ().freeze_notifications ();
175- set_display_titles (Config.Facade.get_instance ().get_display_photo_titles ());
176 set_display_comments (Config.Facade.get_instance ().get_display_photo_comments ());
177 set_display_tags (Config.Facade.get_instance ().get_display_photo_tags ());
178 get_view ().thaw_notifications ();
179@@ -599,14 +591,6 @@
180 }
181 }
182
183- protected virtual void on_display_titles (Gtk.Action action) {
184- bool display = ((Gtk.ToggleAction) action).get_active ();
185-
186- set_display_titles (display);
187-
188- Config.Facade.get_instance ().set_display_photo_titles (display);
189- }
190-
191 protected virtual void on_display_comments (Gtk.Action action) {
192 bool display = ((Gtk.ToggleAction) action).get_active ();
193
194@@ -673,14 +657,6 @@
195 }
196 }
197
198- protected override void set_display_titles (bool display) {
199- base.set_display_titles (display);
200-
201- Gtk.ToggleAction? action = get_action ("ViewTitle") as Gtk.ToggleAction;
202- if (action != null)
203- action.set_active (display);
204- }
205-
206 protected override void set_display_comments (bool display) {
207 base.set_display_comments (display);
208
209
210=== modified file 'src/Page.vala'
211--- src/Page.vala 2017-01-12 18:13:48 +0000
212+++ src/Page.vala 2017-01-27 03:10:46 +0000
213@@ -1992,12 +1992,6 @@
214 }
215 }
216
217- protected virtual void set_display_titles (bool display) {
218- get_view ().freeze_notifications ();
219- get_view ().set_property (CheckerboardItem.PROP_SHOW_TITLES, display);
220- get_view ().thaw_notifications ();
221- }
222-
223 protected virtual void set_display_comments (bool display) {
224 get_view ().freeze_notifications ();
225 get_view ().set_property (CheckerboardItem.PROP_SHOW_COMMENTS, display);
226
227=== modified file 'src/PhotoPage.vala'
228--- src/PhotoPage.vala 2017-01-26 15:35:50 +0000
229+++ src/PhotoPage.vala 2017-01-27 03:10:46 +0000
230@@ -2649,12 +2649,6 @@
231 return actions;
232 }
233
234- protected override Gtk.ToggleActionEntry[] init_collect_toggle_action_entries () {
235- Gtk.ToggleActionEntry[] toggle_actions = base.init_collect_toggle_action_entries ();
236-
237- return toggle_actions;
238- }
239-
240 protected override InjectionGroup[] init_collect_injection_groups () {
241 InjectionGroup[] groups = base.init_collect_injection_groups ();
242
243
244=== modified file 'src/camera/ImportPage.vala'
245--- src/camera/ImportPage.vala 2017-01-26 15:35:50 +0000
246+++ src/camera/ImportPage.vala 2017-01-27 03:10:46 +0000
247@@ -890,17 +890,6 @@
248 ui_filenames.add ("import.ui");
249 }
250
251- protected override Gtk.ToggleActionEntry[] init_collect_toggle_action_entries () {
252- Gtk.ToggleActionEntry[] toggle_actions = base.init_collect_toggle_action_entries ();
253-
254- Gtk.ToggleActionEntry titles = { "ViewTitle", null, _("_Titles"), "<Ctrl><Shift>T",
255- _("Display the title of each photo"), on_display_titles, Config.Facade.get_instance ().get_display_photo_titles ()
256- };
257- toggle_actions += titles;
258-
259- return toggle_actions;
260- }
261-
262 protected override Gtk.ActionEntry[] init_collect_action_entries () {
263 Gtk.ActionEntry[] actions = base.init_collect_action_entries ();
264
265@@ -980,19 +969,6 @@
266 search_filter.refresh ();
267 }
268
269- private void on_display_titles (Gtk.Action action) {
270- bool display = ((Gtk.ToggleAction) action).get_active ();
271-
272- set_display_titles (display);
273- Config.Facade.get_instance ().set_display_photo_titles (display);
274- }
275-
276- public override void switched_to () {
277- set_display_titles (Config.Facade.get_instance ().get_display_photo_titles ());
278-
279- base.switched_to ();
280- }
281-
282 public override void ready () {
283 try_refreshing_camera (false);
284 hide_imported_filter.refresh ();
285@@ -1806,14 +1782,6 @@
286 on_view_changed ();
287 }
288
289- public override void set_display_titles (bool display) {
290- base.set_display_titles (display);
291-
292- Gtk.ToggleAction? action = get_action ("ViewTitle") as Gtk.ToggleAction;
293- if (action != null)
294- action.set_active (display);
295- }
296-
297 // Gets the search view filter for this page.
298 public override SearchViewFilter get_search_view_filter () {
299 return search_filter;
300
301=== modified file 'src/config/GSettingsEngine.vala'
302--- src/config/GSettingsEngine.vala 2017-01-26 22:15:26 +0000
303+++ src/config/GSettingsEngine.vala 2017-01-27 03:10:46 +0000
304@@ -123,7 +123,6 @@
305 key_names[ConfigurableProperty.DISPLAY_METADATA_SIDEBAR] = "display-metadata-sidebar";
306 key_names[ConfigurableProperty.DISPLAY_SEARCH_BAR] = "display-search-bar";
307 key_names[ConfigurableProperty.DISPLAY_PHOTO_TAGS] = "display-photo-tags";
308- key_names[ConfigurableProperty.DISPLAY_PHOTO_TITLES] = "display-photo-titles";
309 key_names[ConfigurableProperty.DISPLAY_PHOTO_COMMENTS] = "display-photo-comments";
310 key_names[ConfigurableProperty.DISPLAY_EVENT_COMMENTS] = "display-event-comments";
311 key_names[ConfigurableProperty.EVENT_PHOTOS_SORT_ASCENDING] = "event-photos-sort-ascending";

Subscribers

People subscribed via source and target branches