Skip to content

Commit 2c1e2aa

Browse files
committed
Update to Avalonia 11
1 parent 870f53a commit 2c1e2aa

File tree

5 files changed

+18
-39
lines changed

5 files changed

+18
-39
lines changed

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<PropertyGroup>
33
<LangVersion>latest</LangVersion>
44
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
5-
<AvaloniaVersion>11.0.0-rc1.1</AvaloniaVersion>
5+
<AvaloniaVersion>11.0.0</AvaloniaVersion>
66
<TextMateSharpVersion>1.0.55</TextMateSharpVersion>
77
<VersionSuffix>beta</VersionSuffix>
88
</PropertyGroup>

src/AvaloniaEdit.Demo/AvaloniaEdit.Demo.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
<ItemGroup>
3434
<PackageReference Include="Avalonia" Version="$(AvaloniaVersion)" />
3535
<PackageReference Include="Avalonia.Desktop" Version="$(AvaloniaVersion)" />
36-
<PackageReference Include="Avalonia.Themes.Fluent" Version="$(AvaloniaVersion)"/>
36+
<PackageReference Include="Avalonia.Themes.Fluent" Version="$(AvaloniaVersion)"/>
3737
<ProjectReference Include="..\AvaloniaEdit\AvaloniaEdit.csproj" />
3838
<ProjectReference Include="..\AvaloniaEdit.TextMate\AvaloniaEdit.TextMate.csproj" />
3939
</ItemGroup>

src/AvaloniaEdit.TextMate/AvaloniaEdit.TextMate.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</ItemGroup>
1313

1414
<ItemGroup>
15-
<PackageReference Include="Avalonia" Version="$(AvaloniaVersion)" />
15+
<PackageReference Include="Avalonia" Version="$(AvaloniaVersion)" />
1616
<PackageReference Include="TextMateSharp" Version="$(TextMateSharpVersion)" />
1717
<PackageReference Include="TextMateSharp.Grammars" Version="$(TextMateSharpVersion)" />
1818
</ItemGroup>

src/AvaloniaEdit/Editing/TextArea.cs

Lines changed: 13 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,21 +1134,16 @@ public void RaiseScrollInvalidated(EventArgs e)
11341134
_logicalScrollable?.RaiseScrollInvalidated(e);
11351135
}
11361136

1137-
private class TextAreaTextInputMethodClient : ITextInputMethodClient
1137+
private class TextAreaTextInputMethodClient : TextInputMethodClient
11381138
{
1139-
private ITextEditable _textEditable;
11401139
private TextArea _textArea;
11411140

11421141
public TextAreaTextInputMethodClient()
11431142
{
11441143

11451144
}
11461145

1147-
public event EventHandler CursorRectangleChanged;
1148-
public event EventHandler TextViewVisualChanged;
1149-
public event EventHandler SurroundingTextChanged;
1150-
1151-
public Rect CursorRectangle
1146+
public override Rect CursorRectangle
11521147
{
11531148
get
11541149
{
@@ -1170,13 +1165,13 @@ public Rect CursorRectangle
11701165
}
11711166
}
11721167

1173-
public Visual TextViewVisual => _textArea;
1168+
public override Visual TextViewVisual => _textArea;
11741169

1175-
public bool SupportsPreedit => false;
1170+
public override bool SupportsPreedit => false;
11761171

1177-
public bool SupportsSurroundingText => true;
1172+
public override bool SupportsSurroundingText => true;
11781173

1179-
public TextInputMethodSurroundingText SurroundingText
1174+
public override string SurroundingText
11801175
{
11811176
get
11821177
{
@@ -1187,26 +1182,15 @@ public TextInputMethodSurroundingText SurroundingText
11871182

11881183
var lineIndex = _textArea.Caret.Line;
11891184

1190-
var position = _textArea.Caret.Position;
1191-
11921185
var documentLine = _textArea.Document.GetLineByNumber(lineIndex);
11931186

11941187
var text = _textArea.Document.GetText(documentLine.Offset, documentLine.Length);
11951188

1196-
return new TextInputMethodSurroundingText
1197-
{
1198-
AnchorOffset = 0,
1199-
CursorOffset = position.Column,
1200-
Text = text
1201-
};
1189+
return text;
12021190
}
12031191
}
12041192

1205-
public ITextEditable TextEditable
1206-
{
1207-
get => _textEditable;
1208-
set => _textEditable = value;
1209-
}
1193+
public override TextSelection Selection { get; set; }
12101194

12111195
public void SetTextArea(TextArea textArea)
12121196
{
@@ -1224,19 +1208,19 @@ public void SetTextArea(TextArea textArea)
12241208
_textArea.SelectionChanged += TextArea_SelectionChanged;
12251209
}
12261210

1227-
TextViewVisualChanged?.Invoke(this, EventArgs.Empty);
1211+
RaiseTextViewVisualChanged();
12281212

1229-
CursorRectangleChanged?.Invoke(this, EventArgs.Empty);
1213+
RaiseCursorRectangleChanged();
12301214
}
12311215

12321216
private void Caret_PositionChanged(object sender, EventArgs e)
12331217
{
1234-
CursorRectangleChanged?.Invoke(this, e);
1218+
RaiseCursorRectangleChanged();
12351219
}
12361220

12371221
private void TextArea_SelectionChanged(object sender, EventArgs e)
12381222
{
1239-
SurroundingTextChanged?.Invoke(this, e);
1223+
RaiseSurroundingTextChanged();
12401224
}
12411225

12421226
public void SelectInSurroundingText(int start, int end)
@@ -1253,15 +1237,10 @@ public void SelectInSurroundingText(int start, int end)
12531237
new TextViewPosition(selection.StartPosition.Line, end));
12541238
}
12551239

1256-
public void SetPreeditText(string text)
1240+
public override void SetPreeditText(string text)
12571241
{
12581242

12591243
}
1260-
1261-
public void SetComposingRegion(TextRange? region)
1262-
{
1263-
//ToDo
1264-
}
12651244
}
12661245
}
12671246

test/AvaloniaEdit.Tests/AvaloniaEdit.Tests.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
<ItemGroup>
88
<PackageReference Include="Avalonia" Version="$(AvaloniaVersion)" />
9-
<PackageReference Include="Avalonia.Themes.Fluent" Version="$(AvaloniaVersion)" />
10-
<PackageReference Include="Avalonia.Themes.Simple" Version="$(AvaloniaVersion)" />
9+
<PackageReference Include="Avalonia.Themes.Fluent" Version="$(AvaloniaVersion)" />
10+
<PackageReference Include="Avalonia.Themes.Simple" Version="$(AvaloniaVersion)" />
1111
<PackageReference Include="Avalonia.Headless.NUnit" Version="$(AvaloniaVersion)" />
1212
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
1313
<PackageReference Include="Moq" Version="4.18.4" />

0 commit comments

Comments
 (0)