aboutsummaryrefslogtreecommitdiffstatsci
diff options
context:
space:
mode:
-rw-r--r--Crow/src/Text/TextChange.cs3
-rw-r--r--Crow/src/Widgets/Button.cs4
-rw-r--r--Crow/src/Widgets/Label.cs4
-rw-r--r--Crow/src/Widgets/Widget.cs7
4 files changed, 11 insertions, 7 deletions
diff --git a/Crow/src/Text/TextChange.cs b/Crow/src/Text/TextChange.cs
index 636c732b..deecc5e5 100644
--- a/Crow/src/Text/TextChange.cs
+++ b/Crow/src/Text/TextChange.cs
@@ -16,5 +16,8 @@ namespace Crow.Text
Length = length;
ChangedText = changedText;
}
+ public TextChange Inverse (string src)
+ => new TextChange (Start, string.IsNullOrEmpty (ChangedText) ? 0 : ChangedText.Length,
+ Length == 0 ? "" : src.AsSpan (Start, Length).ToString ());
}
}
diff --git a/Crow/src/Widgets/Button.cs b/Crow/src/Widgets/Button.cs
index ce514ce0..b7b9326b 100644
--- a/Crow/src/Widgets/Button.cs
+++ b/Crow/src/Widgets/Button.cs
@@ -113,8 +113,10 @@ namespace Crow
void Command_ValueChanged (object sender, ValueChangeEventArgs e)
{
string mName = e.MemberName;
- if (mName == "CanExecute")
+ if (mName == "CanExecute") {
mName = "IsEnabled";
+ RegisterForRedraw ();
+ }
NotifyValueChanged (mName, e.NewValue);
}
diff --git a/Crow/src/Widgets/Label.cs b/Crow/src/Widgets/Label.cs
index 9429a516..9183f7d8 100644
--- a/Crow/src/Widgets/Label.cs
+++ b/Crow/src/Widgets/Label.cs
@@ -417,7 +417,7 @@ namespace Crow
}
RectangleD lineRect = new RectangleD (
- Width.IsFit && !Multiline ? cb.X : (int)getX (cb.Width, lines[i]) + cb.X,
+ (int)getX (cb.Width, lines[i]) + cb.X,
y + cb.Top, lines[i].LengthInPixel, lineHeight);
if (encodedBytes > 0) {
@@ -535,7 +535,7 @@ namespace Crow
return;
TextLine ls = lines[loc.Line];
ReadOnlySpan<char> curLine = _text.GetLine (ls);
- double cPos = Width.IsFit && !Multiline ? 0 : getX (clientWidth, ls);
+ double cPos = getX (clientWidth, ls);
if (loc.Column >= 0) {
//int encodedBytes = Crow.Text.Encoding2.ToUtf8 (curLine.Slice (0, loc.Column), bytes);
diff --git a/Crow/src/Widgets/Widget.cs b/Crow/src/Widgets/Widget.cs
index 519d7019..8e44759c 100644
--- a/Crow/src/Widgets/Widget.cs
+++ b/Crow/src/Widgets/Widget.cs
@@ -889,10 +889,9 @@ namespace Crow
isVisible = value;
- if (Visible)
- RegisterForLayouting (LayoutingType.Sizing);
- else
+ if (!Visible)
unshownPostActions ();
+ RegisterForLayouting (LayoutingType.Sizing);
NotifyValueChangedAuto (isVisible);
}
@@ -1846,7 +1845,7 @@ namespace Crow
}
void paintDisabled(Context gr, Rectangle rb){
gr.Operator = Operator.Xor;
- gr.SetSource (0.6, 0.6, 0.6, 0.3);
+ gr.SetSource (0.1, 0.1, 0.1, 0.8);
gr.Rectangle (rb);
gr.Fill ();
gr.Operator = Operator.Over;