]> O.S.I.I.S - jp/crow.git/commitdiff
multiline init bug, use foreground for cursor color, remove cursorColor property
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Sat, 27 Mar 2021 13:09:36 +0000 (14:09 +0100)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Sat, 27 Mar 2021 13:09:36 +0000 (14:09 +0100)
Crow/src/Widgets/Label.cs

index f99908fb4869c5d723900e489686133b1d96065d..066793d08e096424dc28976a677e32ffd31e90f8 100644 (file)
@@ -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
-               /// <summary>
-               /// Background color for selected text inside this label.
-               /// </summary>
-               [DefaultValue ("White")]
-               public virtual Color CursorColor {
-                       get { return cursorColor; }
-                       set {
-                               if (cursorColor == value)
-                                       return;
-                               cursorColor = value;
-                               NotifyValueChangedAuto (cursorColor);
-                               RegisterForRedraw ();
-                       }
-               }
+
 
                /// <summary>
                /// 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);