Commit Graph

12 Commits

Author SHA1 Message Date
Matthias Clasen
6e178aede2 Use GdkRGBA for text attributes
Now that GtkTextAttributes is private, we can clean this struct
up a bit. The first step is to switch from GdkColor to GdkRGBA,
and adapt all users.
2016-11-01 13:58:10 -04:00
Timm Bäder
a5867ffe71 Remove some more GdkColor properties 2016-10-20 20:12:08 +02:00
Matthias Clasen
c6838fbff0 GtkTextView: Support font features
Add a ::font-features attribute to GtkTextTag, and support
font features when inserting Pango markup into a text buffer.
2015-07-29 21:42:58 -04:00
Christian Hergert
28063ee2e4 textview: add support for underline and strikethrough colors
This commit adds the GtkTextTag:underline-rgba and :strikethrough-rgba
properties and the necessary plumbing to apply these colors in GtkTextLayout.
With this change, you can alter the color of underlines including those
of type PANGO_UNDERLINE_ERROR.

You might want to alter the underline color to differentiate between
spelling and grammer mistakes. In code editors, it is convenient to
differentiate between errors and warnings.

Note that the GtkTextAppearance struct is public ABI and has no spare
room for new fields, so we are resorting to some tricky packing to store
the colors in the unused pixel field of the fg_color and bg_color structs.
This packing is accomplished by the macros in gtktextattributesprivate.h.

Signed-off-by: Christian Hergert <christian@hergert.me>

https://bugzilla.gnome.org/show_bug.cgi?id=402168
2015-03-17 23:24:13 -04:00
Matthias Clasen
d184088cae GtkTextView: Add fallback and letter-spacing support
Add support for the Pango attributes controlling font fallback
and letter spacing to GtkTextTag.

https://bugzilla.gnome.org/show_bug.cgi?id=740954
2014-12-04 00:09:44 -05:00
Matthias Clasen
49cf5142ba Deprecate GdkColor
It has been replaced by GdkRGBA. Time to make it official.
http://bugzilla.gnome.org/show_bug.cgi?id=636695
2014-05-22 09:09:55 -04:00
William Jon McCann
469d333aa2 docs: use Returns: consistently
Instead of Return value:
2014-02-19 18:56:05 -05:00
Sébastien Wilmet
3a8f70dd1e gtktextattributes: include the right headers
Some function prototypes in gtktexttagprivate.h are implemented in
gtktextattributes.c.

https://bugzilla.gnome.org/show_bug.cgi?id=697048
2013-04-01 21:12:49 +02:00
Michael Natterer
5c4f2ef0c1 gtk: move _gtk_modules_has_mixed_deps() to gtkmodlesprivate.h
and remove gtkmainprivate.h completely.
2011-10-23 13:57:07 +02:00
Tristan Van Berkom
cefb950110 Added internal GdkRGBA support for GtkTextTag::paragraph-background-rgba
Added the remaining implementation bits for rendering paragraph backgrounds
with rgba values and updated the test case.
2011-05-06 17:05:34 -04:00
Tristan Van Berkom
d399a4acab Added GdkRGBA properties to GtkTextTag.
This now allows text view to render text with alpha values in
the text foreground and backgrounds, the work is almost complete,
currently the error-underline-color is still a GdkColor style property
and since we use only GdkRGBA for rendering it needs to be converted
and applied, probably a new rgba version of the style property should
also be introduced.

This commit adds tests/testtextview that must be run from the tests/
directory to show translucent text in action.
2011-05-06 17:05:10 -04:00
Benjamin Otte
b43bafff52 textview: Move text attributes code into its own .c file 2011-01-11 16:46:59 +01:00