GNOME Bugzilla – Bug 733311
Selection icon goes over favorite icon
Last modified: 2018-01-23 09:22:39 UTC
Created attachment 280963 [details] Selection icon covers favorite icon Clearly visible on screenshot!
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.
Let's move the favorite emblem to the bottom left corner.
(In reply to Debarshi Ray from comment #2) > Let's move the favorite emblem to the bottom left corner. Sure.
Hey, I would like to work on this bug. Can you assign it to me? Thank you Amit Barve
(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!
(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!
Thanks a lot for quick reply. I have started working on it. Will keep you informed!
can anyone help me how to proceed! this is my first bug, so idk how it works thanks!
There is some prior art on how to achieve this in gnome-boxes (thanks zeenix & kekun). See bug 745757
Created attachment 314256 [details] [review] base-item: Move favorite icon on bottom left
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.
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.
-- 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.