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 761626 - tool-filter-button: Selected icon is not centered on the image
tool-filter-button: Selected icon is not centered on the image
Status: RESOLVED FIXED
Product: gnome-photos
Classification: Applications
Component: general
3.19.x
Other All
: Normal normal
: ---
Assigned To: GNOME photos maintainer(s)
GNOME photos maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2016-02-06 11:23 UTC by Umang Jain
Modified: 2016-02-11 15:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
tool-filter-button: Center the selected arrow by adjusting overlay (2.72 KB, patch)
2016-02-09 05:42 UTC, Umang Jain
none Details | Review
tool-filter-button: Center the selected icon (2.81 KB, patch)
2016-02-11 14:41 UTC, Debarshi Ray
committed Details | Review

Description Umang Jain 2016-02-06 11:23:56 UTC
The currently selected filter is depicted by a right tick mark arrow on the filter button. If you look closely, it is not actually centered on the corresponding filter button.

Start by looking at the function:  photos_tool_filter_button_init ()
Comment 1 Umang Jain 2016-02-09 05:42:22 UTC
Created attachment 320683 [details] [review]
tool-filter-button: Center the selected arrow by adjusting overlay
Comment 2 Umang Jain 2016-02-09 05:50:49 UTC
Debarshi Ray, I quickly want to test the patch first (apply -> build -> run photos) then please take a look at the patch's code.

I don't consider this as a final patch. It's more like a hack (according to me).
There's a comment in the patch. Please comment about it in the review.
Comment 3 Debarshi Ray 2016-02-11 14:41:20 UTC
Review of attachment 320683 [details] [review]:

Thanks for the patch, Umang.

::: src/photos-tool-filter-button.c
@@ +131,1 @@
   shader = photos_widget_shader_new (image);

We need to explicitly show the image since it is no longer the "image" of the button. GtkButton will only mark the overlay as visible but won't recurse into it.

@@ +315,3 @@
 
+  photos_tool_filter_button_init (self);
+  photos_tool_filter_button_toggled (self);

Umm... why is this needed?

@@ +316,3 @@
+  photos_tool_filter_button_init (self);
+  photos_tool_filter_button_toggled (self);
+  gtk_container_add (GTK_CONTAINER (self->overlay), image);

We have to manually remove the older image that is inside the overlay.

@@ +317,3 @@
+  photos_tool_filter_button_toggled (self);
+  gtk_container_add (GTK_CONTAINER (self->overlay), image);
+  gtk_button_set_image (GTK_BUTTON (self->button), self->overlay);

Ditto about showing the image.
Comment 4 Debarshi Ray 2016-02-11 14:41:53 UTC
Created attachment 320885 [details] [review]
tool-filter-button: Center the selected icon

Addressed the above issues.