After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 780692 - Titles are no longer displayed in the album grid
Titles are no longer displayed in the album grid
Status: RESOLVED FIXED
Product: gnome-photos
Classification: Applications
Component: general
3.24.x
Other All
: Normal normal
: ---
Assigned To: GNOME photos maintainer(s)
GNOME photos maintainer(s)
: 785050 (view as bug list)
Depends on: 786197
Blocks:
 
 
Reported: 2017-03-29 16:32 UTC by Allan Day
Modified: 2017-08-18 10:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
view-container: Display titles for collections (1.06 KB, patch)
2017-04-06 06:59 UTC, Umang Jain
needs-work Details | Review
Display titles in album grid (1.57 KB, patch)
2017-04-08 06:38 UTC, Umang Jain
none Details | Review
GdMainIconBoxChild: Fix layout of primary and secondary text (3.12 KB, patch)
2017-04-08 06:40 UTC, Umang Jain
needs-work Details | Review
base-item, view-container: Display names only for collections (2.20 KB, patch)
2017-08-13 07:47 UTC, Debarshi Ray
committed Details | Review
main-icon-box-child: Show the labels only if there's some text (3.44 KB, patch)
2017-08-13 08:54 UTC, Debarshi Ray
committed Details | Review
base-item, view-container: Display names only for collections (3.45 KB, patch)
2017-08-18 10:38 UTC, Debarshi Ray
committed Details | Review

Description Allan Day 2017-03-29 16:32:25 UTC
Albums lost their titles in the port to the FlowBox grid. I think you do want to be able to see the title of the album without having to open it.
Comment 1 Umang Jain 2017-04-06 06:59:23 UTC
Created attachment 349339 [details] [review]
view-container: Display titles for collections
Comment 2 Debarshi Ray 2017-04-06 08:30:21 UTC
Review of attachment 349339 [details] [review]:

Thanks for the patch, Umang.

::: src/photos-view-container.c
@@ +146,3 @@
+
+      if  (self->mode == PHOTOS_WINDOW_MODE_COLLECTIONS)
+        gd_main_box_set_show_primary_text (GD_MAIN_BOX (self->view), TRUE);

This is a bit more involved. Doing just this means that collections will have a title in "Albums", but not when searching; and that individual images will also have titles when browsing the contents of a collection.

What we need to do is:

(a) Ensure that PhotosBaseItems have a primary-text only for collections. See photos_base_item_main_box_item_get_primary_text

(b) Enable show-primary-text for all the GdMainBoxes.

(c) Fix the theming and layout of GdMainIconBoxChild. I expect some roughness because the show-primary-text=TRUE code paths were not excercised so far.
Comment 3 Umang Jain 2017-04-08 06:38:32 UTC
Created attachment 349517 [details] [review]
Display titles in album grid

Fixes (a) and partially (b)

As in (b), when we try to enable primary-text for all GdMainBoxes , there's a empty space left on image thumbs (overview mode). That's because a GtkBox is added inside the grid (refer to libgd patch attached next).
Comment 4 Umang Jain 2017-04-08 06:40:50 UTC
Created attachment 349518 [details] [review]
GdMainIconBoxChild: Fix layout of primary and secondary text

Add a GtkBox which will contain primary and secondary text, into the Grid.

Designers might step in for more visual fixes (border-width of GtkBox or padding?)
Comment 5 Debarshi Ray 2017-07-18 09:48:12 UTC
*** Bug 785050 has been marked as a duplicate of this bug. ***
Comment 6 Debarshi Ray 2017-08-13 07:37:42 UTC
Review of attachment 349517 [details] [review]:

::: src/photos-base-item.c
@@ +699,3 @@
 
+  priv = photos_base_item_get_instance_private (self);
+  g_return_val_if_fail (priv->collection, NULL);

We also need to change the PROP_PRIMARY_TEXT case in photos_base_item_get_property. It can no longer return priv->name directly. It needs to return the value from this method, instead.

Secondly, g_return_* are assertions to be used to guard against programming errors, which should never happen. While I agree that want to show the title only for collections, it should still be possible to access GdMainBoxItem:primary-text for non-collections without hitting an assertion. We cannot assume that not showing the title means that the property will never be accessed for any other purpose.
Comment 7 Debarshi Ray 2017-08-13 07:47:27 UTC
Created attachment 357504 [details] [review]
base-item, view-container: Display names only for collections

I took the liberty to fix it up.
Comment 8 Debarshi Ray 2017-08-13 07:54:15 UTC
Review of attachment 349518 [details] [review]:

::: libgd/gd-main-icon-box-child.c
@@ +206,3 @@
+      GtkWidget *box;
+
+      box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);

Umm... I don't understand this. In comment 3 you seemed to imply that the presence of a GtkBox was the cause of extra padding along the bottom edge, but now you are actually adding a GtkBox.

I think we should simply hide the GtkLabels if there is no label to shown in them.
Comment 9 Debarshi Ray 2017-08-13 08:54:57 UTC
Created attachment 357506 [details] [review]
main-icon-box-child: Show the labels only if there's some text

Something like this might be better. What do you think?
Comment 10 Umang Jain 2017-08-13 15:59:41 UTC
> Created attachment 357506 [details] [review] [review]
> main-icon-box-child: Show the labels only if there's some text
> 
> Something like this might be better. What do you think?

This looks good.

Also, doesn't it make sense to bind "show-primary-text" property to the "visible" property of the primary_label?
Comment 11 Debarshi Ray 2017-08-14 12:15:41 UTC
(In reply to Umang Jain from comment #10)
> Also, doesn't it make sense to bind "show-primary-text" property to the
> "visible" property of the primary_label?

The problem is that of scalability. The GtkList/FlowBox widgets create as many row/grid widgets as there are items. So, if there are a thousand items to be displayed, it will create thousand of them. Having so many widgets is already a problem - it stretches GTK+ to its limit, hits memory limits, etc..

Hence, it is better not to have unused widgets lying around. That's why we re-create the entire widget without the GtkLabels whenever show-primary-text changes. Recreating the layout like that has a cost, but show-primary-text is not expected to change 20 times a second, so it shouldn't be a disaster.

In fact, you have now given me a better idea. Instead of hiding the GtkLabel when the primary-text becomes NULL or "", I think we should simply destroy the GtkLabel. Just like we do for show-primary-text.

Do you want to work on it, and modify my patch in that direction?
Comment 12 Debarshi Ray 2017-08-18 10:38:30 UTC
Created attachment 357878 [details] [review]
base-item, view-container: Display names only for collections