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 725571 - unable to change the color and opacity of annotation window
unable to change the color and opacity of annotation window
Status: RESOLVED FIXED
Product: evince
Classification: Core
Component: pdf annotations
3.11.x
Other Linux
: Normal normal
: ---
Assigned To: Evince Maintainers
Evince Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-03-03 13:32 UTC by shammi kumar
Modified: 2014-06-22 22:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Connecting to the right signal so that the color of the annotation window is changed (1.02 KB, patch)
2014-06-19 11:02 UTC, giselle
needs-work Details | Review
Emitting both signals in set_rgba (1.16 KB, patch)
2014-06-19 14:59 UTC, giselle
committed Details | Review
Fix the opacity issue (2.76 KB, patch)
2014-06-20 14:03 UTC, giselle
committed Details | Review

Description shammi kumar 2014-03-03 13:32:30 UTC
It seems that we can't change the annotation-window's color and opacity by doing changes in annotation-properties, although we change both(color and opacity) for the annotation-icon.
Comment 1 giselle 2014-06-19 11:02:00 UTC
Created attachment 278754 [details] [review]
Connecting to the right signal so that the color of the annotation window is changed

I looked into the opacity issue as well. Although it is possible to change the opacity of a widget, I think this option should not be available for annotation text. I say this because poppler does not support opacity for this type of annotation (only annotation markup has opacity). This means that the information could not be saved to the pdf and once the user opens the document again, the window will still be opaque. What do you think? I can create a patch removing the opacity option from the properties window for annotation text if you agree.
Comment 2 Carlos Garcia Campos 2014-06-19 11:22:02 UTC
Review of attachment 278754 [details] [review]:

Thanks for the patch, it looks good, but I think the actual fix would be to emit the notify::color signal when ev_annotation_set_rgba() is called. Note that the callback ev_annotation_window_color_changed() is using color, not rgba, so it's not consistent. You should also explain a bit the bug you are fixing in the commit message, the real problem is that notify::color is not emitted when the color is changed with the rgba interface.
Comment 3 Carlos Garcia Campos 2014-06-19 11:23:44 UTC
(In reply to comment #1)
> Created an attachment (id=278754) [details] [review]
> Connecting to the right signal so that the color of the annotation window is
> changed
> 
> I looked into the opacity issue as well. Although it is possible to change the
> opacity of a widget, I think this option should not be available for annotation
> text. I say this because poppler does not support opacity for this type of
> annotation (only annotation markup has opacity). This means that the
> information could not be saved to the pdf and once the user opens the document
> again, the window will still be opaque. What do you think? I can create a patch
> removing the opacity option from the properties window for annotation text if
> you agree.

MarkupAnnotation is not a class but an interface, and text annotations are also markup annotations and they implement the interface.
Comment 4 giselle 2014-06-19 11:51:05 UTC
(In reply to comment #2)
> Review of attachment 278754 [details] [review]:
> 
> Thanks for the patch, it looks good, but I think the actual fix would be to
> emit the notify::color signal when ev_annotation_set_rgba() is called. Note
> that the callback ev_annotation_window_color_changed() is using color, not
> rgba, so it's not consistent. You should also explain a bit the bug you are
> fixing in the commit message, the real problem is that notify::color is not
> emitted when the color is changed with the rgba interface.

Thank you for the quick feedback! 
Since ev_annotation_get_color is deprecated, I could also change everything to rgba and it would be consistent, is this ok?
Comment 5 Carlos Garcia Campos 2014-06-19 14:38:54 UTC
Yes, but that would be a different bug. So, I would first fix this bug, by emitting notify::color in ev_annotation_set_rgba() and then file a new bug report to use rgba instead of color everywhere.
Comment 6 giselle 2014-06-19 14:59:32 UTC
Created attachment 278768 [details] [review]
Emitting both signals in set_rgba

Ok, here's the patch. I will create a patch for changing to rgba later and in the meantime I am looking into the opacity issue. Thanks!
Comment 7 Carlos Garcia Campos 2014-06-19 15:39:45 UTC
Review of attachment 278768 [details] [review]:

Thanks!
Comment 8 giselle 2014-06-20 14:03:00 UTC
Created attachment 278835 [details] [review]
Fix the opacity issue

For the opacity problem the only thing missing was to connect the "opacity" signal to the annotation window and implement the functions that actually change the property for the widgets used.
Comment 9 Carlos Garcia Campos 2014-06-20 15:35:35 UTC
Review of attachment 278835 [details] [review]:

LGTM, thanks!
Comment 10 giselle 2014-06-22 22:13:21 UTC
Review of attachment 278768 [details] [review]:

Pushed.
Comment 11 giselle 2014-06-22 22:13:48 UTC
Review of attachment 278835 [details] [review]:

Pushed.
Comment 12 giselle 2014-06-22 22:21:11 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.