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 706466 - gtksourcecompletioninfo should inherit font from gtksourceview
gtksourcecompletioninfo should inherit font from gtksourceview
Status: RESOLVED FIXED
Product: gtksourceview
Classification: Platform
Component: General
unspecified
Other Linux
: Normal normal
: ---
Assigned To: GTK Sourceview maintainers
GTK Sourceview maintainers
Depends on:
Blocks:
 
 
Reported: 2013-08-21 07:51 UTC by Christian Hergert
Modified: 2013-08-27 04:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
completion: use textview font on proposal cell renderer (2.01 KB, patch)
2013-08-24 05:48 UTC, Christian Hergert
accepted-commit_now Details | Review

Description Christian Hergert 2013-08-21 07:51:53 UTC
Currently, the font is not inherited so that if you have a monospace font in your gtksourceview, the gtksourcecompletioninfo window may still have a sans font.

This looks a bit jarring since you now need to mentally interpret two fonts.

However, I'm testing with gtk_widget_override_font() on the sourceview, if there is a better way to do this that will solve this bug, I'd be happy to use that.

thanks!
Comment 1 Sébastien Wilmet 2013-08-21 12:54:00 UTC
If you use the CompletionInfo standalone, set the font to the child widget.

If you use the CompletionInfo through GtkSourceCompletion, try a markup for the CompletionProposal. I think you can change the font with the markup. If it's not possible, use a custom widget with gtk_source_completion_provider_get_info_widget().

I think it's better to not change the font by default.
Comment 2 Paolo Borelli 2013-08-21 14:39:23 UTC
maybe we can set a css class and then you can use font: inherit? Or actually we could even inherit by default, but still set a css class and in case one wants to set a different font or even font: initial

This is actually how the context menu of GtkTextView works in gtk 3.10, so I think using the same strategy could be a good solution
Comment 3 Christian Hergert 2013-08-22 20:13:33 UTC
Using <tt></tt> is easy enough, but that doesn't guarantee that your font-size matches. And if the point is to actually match fonts, then we would want that inherited from the parent sourceview.
Comment 4 Christian Hergert 2013-08-24 05:48:05 UTC
Created attachment 252980 [details] [review]
completion: use textview font on proposal cell renderer

This patch tracks the PangoFontDescription from the textview and maps that to the cellrenderer used for proposals. This means that we can continue to use proportional fonts if we like on other cells.

We could set the default for the widget as well if we like, but I figured this was minimal enough.
Comment 5 Paolo Borelli 2013-08-25 08:09:26 UTC
Review of attachment 252980 [details] [review]:

looks good to me
Comment 6 Christian Hergert 2013-08-27 04:08:02 UTC
Fixed in 84b4a6a113701f2ce8e668b209c498fc19e8714e.