diff options
author | Matt Ward <matt.ward@microsoft.com> | 2019-10-23 17:15:00 +0300 |
---|---|---|
committer | Matt Ward <ward.matt@gmail.com> | 2019-10-24 11:32:58 +0300 |
commit | a393bbb4f1fb5f6e93c336e8a70e4ed5c5213c8d (patch) | |
tree | ac5e9ff31687955f182c37669b1c56b37fea6715 /Xwt.Gtk/Xwt.GtkBackend | |
parent | 7f9c83b99aec59a0e4fc3cdb51feb10d339b4f66 (diff) |
Fix hyperlinks not highlighted in labels
Using markup to define a hyperlink in a label was not highlighting
the hyperlink with blue text and the underline. The problem was that
the FastPangoAttrList was not being applied to the label.
Diffstat (limited to 'Xwt.Gtk/Xwt.GtkBackend')
-rw-r--r-- | Xwt.Gtk/Xwt.GtkBackend/Util.cs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Xwt.Gtk/Xwt.GtkBackend/Util.cs b/Xwt.Gtk/Xwt.GtkBackend/Util.cs index 5706a44e..f63aa2cc 100644 --- a/Xwt.Gtk/Xwt.GtkBackend/Util.cs +++ b/Xwt.Gtk/Xwt.GtkBackend/Util.cs @@ -283,6 +283,7 @@ namespace Xwt.GtkBackend internal static TextIndexer ApplyFormattedText(this Gtk.Label label, FormattedText text) { + TextIndexer indexer = null; var list = new FastPangoAttrList (); if (text != null) { if (label.IsRealized) { @@ -293,14 +294,12 @@ namespace Xwt.GtkBackend if (!color.Equals (Gdk.Color.Zero)) list.DefaultLinkColor = color; } - var indexer = new TextIndexer (text.Text); + indexer = new TextIndexer (text.Text); list.AddAttributes (indexer, text.Attributes); - - return indexer; } gtk_label_set_attributes (label.Handle, list.Handle); - return null; + return indexer; } } } |