From: Jean-Philippe Bruyère Date: Sat, 27 Mar 2021 13:09:36 +0000 (+0100) Subject: multiline init bug, use foreground for cursor color, remove cursorColor property X-Git-Tag: v0.9.5-beta~49 X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=af95e55f8adc6778ac60580e180f286314acc053;p=jp%2Fcrow.git multiline init bug, use foreground for cursor color, remove cursorColor property --- 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);