GNOME Bugzilla – Bug 706466
gtksourcecompletioninfo should inherit font from gtksourceview
Last modified: 2013-08-27 04:08:02 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!
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.
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
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.
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.
Review of attachment 252980 [details] [review]: looks good to me
Fixed in 84b4a6a113701f2ce8e668b209c498fc19e8714e.