From af95e55f8adc6778ac60580e180f286314acc053 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jean-Philippe=20Bruy=C3=A8re?= Date: Sat, 27 Mar 2021 14:09:36 +0100 Subject: [PATCH] multiline init bug, use foreground for cursor color, remove cursorColor property --- Crow/src/Widgets/Label.cs | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/Crow/src/Widgets/Label.cs b/Crow/src/Widgets/Label.cs index f99908fb..066793d0 100644 --- a/Crow/src/Widgets/Label.cs +++ b/Crow/src/Widgets/Label.cs @@ -35,8 +35,7 @@ namespace Crow #region private and protected fields protected string _text; TextAlignment _textAlignment; - bool _multiline; - Color cursorColor; + bool _multiline; Color selBackground; Color selForeground; @@ -94,20 +93,7 @@ namespace Crow protected FontExtents fe; protected TextExtents te; #endregion - /// - /// Background color for selected text inside this label. - /// - [DefaultValue ("White")] - public virtual Color CursorColor { - get { return cursorColor; } - set { - if (cursorColor == value) - return; - cursorColor = value; - NotifyValueChangedAuto (cursorColor); - RegisterForRedraw (); - } - } + /// /// Background color for selected text inside this label. @@ -194,7 +180,7 @@ namespace Crow if (value == _multiline) return; _multiline = value; - lines = new LineCollection (_multiline ? 4 : 1); + getLines (); NotifyValueChangedAuto (_multiline); RegisterForGraphicUpdate(); } @@ -521,7 +507,7 @@ namespace Crow //} Rectangle c = ScreenCoordinates (textCursor.Value + Slot.Position + ClientRectangle.Position); ctx.ResetClip (); - ctx.SetSource (cursorColor); + Foreground.SetAsSource (IFace, ctx, c); ctx.LineWidth = 1.0; ctx.MoveTo (0.5 + c.X, c.Y); ctx.LineTo (0.5 + c.X, c.Bottom); -- 2.47.3