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 733311 - Selection icon goes over favorite icon
Selection icon goes over favorite icon
Status: RESOLVED OBSOLETE
Product: gnome-photos
Classification: Applications
Component: general
3.13.x
Other All
: Normal normal
: ---
Assigned To: GNOME photos maintainer(s)
GNOME photos maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2014-07-17 12:07 UTC by alex diavatis
Modified: 2018-01-23 09:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Selection icon covers favorite icon (529.21 KB, image/png)
2014-07-17 12:07 UTC, alex diavatis
  Details
Selection Icon covers Favorite Icon (47.10 KB, image/png)
2015-03-01 08:00 UTC, Siddha Ganju
  Details
base-item: Move favorite icon on bottom left (8.53 KB, patch)
2015-10-27 20:08 UTC, Alessandro Bono
reviewed Details | Review

Description alex diavatis 2014-07-17 12:07:15 UTC
Created attachment 280963 [details]
Selection icon covers favorite icon

Clearly visible on screenshot!
Comment 1 Siddha Ganju 2015-03-01 08:00:11 UTC
Created attachment 298200 [details]
Selection Icon covers Favorite Icon

The selection icon still covers the favorite icon. IMHO, either the favorite icon can be moved a little lower into the black border surronding the image, or the selection icon can be moved to the top right.
Comment 2 Debarshi Ray 2015-03-06 17:30:29 UTC
Let's move the favorite emblem to the bottom left corner.
Comment 3 Zeeshan Ali 2015-03-06 17:35:44 UTC
(In reply to Debarshi Ray from comment #2)
> Let's move the favorite emblem to the bottom left corner.

Sure.
Comment 4 Amit Barve 2015-05-08 05:11:20 UTC
Hey,

I would like to work on this bug.
Can you assign it to me?

Thank you
Amit Barve
Comment 5 Pranav Kant 2015-05-08 12:24:22 UTC
(In reply to Amit  Barve from comment #4)
> Hey,
> 
> I would like to work on this bug.
> Can you assign it to me?
> 
> Thank you
> Amit Barve

You can start working on it straight away. Once you show some progress, we will assign it to you.

Good luck!
Comment 6 Zeeshan Ali 2015-05-08 12:44:45 UTC
(In reply to Pranav Kant from comment #5)
> (In reply to Amit  Barve from comment #4)
> > Hey,
> > 
> > I would like to work on this bug.
> > Can you assign it to me?
> > 
> > Thank you
> > Amit Barve
> 
> You can start working on it straight away. Once you show some progress, we
> will assign it to you.

Also assignment doesn't really mean anything in a community project. Whoever does it, does it!
Comment 7 Amit Barve 2015-05-08 12:55:03 UTC
Thanks a lot for quick reply.
I have started working on it. Will keep you informed!
Comment 8 Sagar Kar 2015-10-05 11:55:41 UTC
can anyone help me how to proceed! this is my first bug, so idk how it works
thanks!
Comment 9 Debarshi Ray 2015-10-23 11:17:06 UTC
There is some prior art on how to achieve this in gnome-boxes (thanks zeenix & kekun). See bug 745757
Comment 10 Alessandro Bono 2015-10-27 20:08:00 UTC
Created attachment 314256 [details] [review]
base-item: Move favorite icon on bottom left
Comment 11 Debarshi Ray 2015-10-29 14:41:25 UTC
Review of attachment 314256 [details] [review]:

Thanks for the patch, Alessandro. It is a direct adaptation of the gnome-boxes patch from bug 745757, which is nice.

On the other hand, it does deviate from what we were doing in libgd/gnome-documents/gnome-photos till now. We already have a minor fork of gd_create_symbolic_icon in gnome-photos (see below), which is non-ideal. So, if we are going to change how we draw emblems it would be nice to grab this opportunity share as much as possible between gnome-boxes, gnome-documents and gnome-photos by either upstreaming it to GTK+ or putting it in libgd.

::: src/photos-base-item.c
@@ +260,3 @@
+    }
+
+  emblem = gtk_icon_info_load_symbolic (icon_info, &SMALL_EMBLEM_COLOR, NULL, NULL, NULL, NULL, &error);

Unless we use gtk_icon_info_load_symbolic_for_context, we lose the ability to theme the emblems with CSS like we do in gnome-documents and gnome-photos. See below.

::: src/photos-utils.c
@@ -239,2 @@
-GIcon *
-photos_utils_create_symbolic_icon (const gchar *name, gint base_size)

A bit of history:

This function is almost a copy of gd_create_symbolic_icon from libgd, which was originally written with gnome-documents in mind. The following minor changes were made:

a) libgd hard codes the documents-icon-bg style class, while we use photos-icon-bg. Back when the libgd style classes lived in adwaita-proper, we needed different style classes and this was a quick solution. Now that we carry our own CSS, we could just re-define documents-icon-bg (or choose a better name) in gnome-photos in whichever way we want and eliminate this issue.

b) In commit 2511cc5bb1ab5 we reduced the size of the emblems to 16 pixels because they were too big and obstructed too much of the thumbnails.

c) In commit 3e7b1ab74f8b1 we moved the emblems a bit more to the lower left corner.

I should have spent some time to merge the two copies, but I didn't. Sorry about that.

@@ -269,3 @@
-  gtk_widget_path_unref (path);
-
-  gtk_style_context_add_class (style, "photos-icon-bg");

The photos-icon-bg style class adds a drop shadow in gnome-photos, while documents-icon-bg uses blue background with rounded corners.

A drop-shadow was added to make the white emblems work on light coloured thumbnails.
Comment 12 Debarshi Ray 2015-10-30 12:27:47 UTC
Here is an idea ...

Our problem is that given a GEmblemedIcon, looking up the GtkIconInfo from the theme and loading the corresponding GdkPixbuf doesn't give us a chance to specify the position of the emblems [1].

The problem with copy/pasting the gnome-boxes code is that we lose the CSS theming bit.

We can solve both issues on a short-term basis (ie. something that can go into libgd) without getting bogged down into why GEmblemedIcon doesn't let us specify the position.

We already have the GdkPixbuf representing the thumbnail (ie. priv->original_icon), and the GIcon returned by create_symbolic_icon is in reality a GdkPixbuf. So, we can replace the bits where we create a GEmblemedIcon, lookup the GtkIconInfo, etc. with a function that looks like this:
  GdkPixbuf *gd_add_emblems_to_image (GdkPixbuf *source_image,
                                      GList *emblem_images,
                                      GtkCornerType corner_type)

This gd_add_emblems_to_image will just have the logic to call gdk_pixbuf_composite with the right parameters based on the corner_type.

[1] The position is hard-coded inside the gtk_icon_info_load_icon call.
Comment 13 GNOME Infrastructure Team 2018-01-23 09:22:39 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gnome-photos/issues/19.