Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/xwt.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Ward <matt.ward@microsoft.com>2019-10-23 17:15:00 +0300
committerMatt Ward <ward.matt@gmail.com>2019-10-24 11:32:58 +0300
commita393bbb4f1fb5f6e93c336e8a70e4ed5c5213c8d (patch)
treeac5e9ff31687955f182c37669b1c56b37fea6715 /Xwt.Gtk
parent7f9c83b99aec59a0e4fc3cdb51feb10d339b4f66 (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')
-rw-r--r--Xwt.Gtk/Xwt.GtkBackend/Util.cs7
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;
}
}
}