Skip to content

Commit afb656e

Browse files
committed
Added custom scrollbar to avalonEdit text editor
1 parent 8f9f752 commit afb656e

3 files changed

Lines changed: 23 additions & 11 deletions

File tree

CutCode.sln

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ VisualStudioVersion = 16.0.31515.178
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CutCode", "CutCode\CutCode.csproj", "{05099602-B5CB-4056-A265-035AD8982699}"
77
EndProject
8+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ICSharpCode.AvalonEdit", "..\..\AvalonEdit\ICSharpCode.AvalonEdit\ICSharpCode.AvalonEdit.csproj", "{FF99C7A0-5362-49B3-886D-1AE27AF6BA4E}"
9+
EndProject
810
Global
911
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1012
Debug|Any CPU = Debug|Any CPU
@@ -27,6 +29,18 @@ Global
2729
{05099602-B5CB-4056-A265-035AD8982699}.Release|iPhone.Build.0 = Release|Any CPU
2830
{05099602-B5CB-4056-A265-035AD8982699}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
2931
{05099602-B5CB-4056-A265-035AD8982699}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
32+
{FF99C7A0-5362-49B3-886D-1AE27AF6BA4E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
33+
{FF99C7A0-5362-49B3-886D-1AE27AF6BA4E}.Debug|Any CPU.Build.0 = Debug|Any CPU
34+
{FF99C7A0-5362-49B3-886D-1AE27AF6BA4E}.Debug|iPhone.ActiveCfg = Debug|Any CPU
35+
{FF99C7A0-5362-49B3-886D-1AE27AF6BA4E}.Debug|iPhone.Build.0 = Debug|Any CPU
36+
{FF99C7A0-5362-49B3-886D-1AE27AF6BA4E}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
37+
{FF99C7A0-5362-49B3-886D-1AE27AF6BA4E}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
38+
{FF99C7A0-5362-49B3-886D-1AE27AF6BA4E}.Release|Any CPU.ActiveCfg = Release|Any CPU
39+
{FF99C7A0-5362-49B3-886D-1AE27AF6BA4E}.Release|Any CPU.Build.0 = Release|Any CPU
40+
{FF99C7A0-5362-49B3-886D-1AE27AF6BA4E}.Release|iPhone.ActiveCfg = Release|Any CPU
41+
{FF99C7A0-5362-49B3-886D-1AE27AF6BA4E}.Release|iPhone.Build.0 = Release|Any CPU
42+
{FF99C7A0-5362-49B3-886D-1AE27AF6BA4E}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
43+
{FF99C7A0-5362-49B3-886D-1AE27AF6BA4E}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
3044
EndGlobalSection
3145
GlobalSection(SolutionProperties) = preSolution
3246
HideSolutionNode = FALSE

CutCode/CutCode.csproj

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,15 @@
5252
</ItemGroup>
5353

5454
<ItemGroup>
55-
<PackageReference Include="AvalonEdit" Version="6.1.2.30" />
5655
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
57-
<PackageReference Include="sqlite-net-pcl" Version="1.7.335" />
56+
<PackageReference Include="sqlite-net-pcl" Version="1.8.116" />
5857
<PackageReference Include="Stylet" Version="1.3.6" />
5958
</ItemGroup>
6059

60+
<ItemGroup>
61+
<ProjectReference Include="..\..\..\AvalonEdit\ICSharpCode.AvalonEdit\ICSharpCode.AvalonEdit.csproj" />
62+
</ItemGroup>
63+
6164
<ItemGroup>
6265
<Resource Include="Resources\Fonts\FiraCode-Regular.ttf" />
6366
<Resource Include="Resources\Fonts\Poppins-Regular.ttf" />

CutCode/Views/AddView.xaml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
55
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
66
xmlns:local="clr-namespace:CutCode"
7-
xmlns:avalonedit="http://icsharpcode.net/sharpdevelop/avalonedit"
87
d:DataContext="{d:DesignInstance local:AddViewModel}"
98
xmlns:s="https://github.com/canton7/Stylet"
109
mc:Ignorable="d">
@@ -104,24 +103,20 @@
104103
</Grid>
105104
</Border>
106105

107-
<Border Grid.Row="2" BorderThickness="0" Background="{Binding richtextBoxBackground}" Margin="10,15,12,5" CornerRadius="8"
108-
HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
106+
<Border Grid.Row="2" BorderThickness="0" Background="{Binding richtextBoxBackground}" Margin="10,15,12,5" CornerRadius="8">
109107
<local:BindableAvalonEditor
110-
xmlns:avalonEdit="http://icsharpcode.net/sharpdevelop/avalonedit"
108+
VerticalAlignment="Stretch"
111109
Background="Transparent"
112110
Foreground="{Binding textBoxForeground}"
113111
BorderThickness="0"
114112
Margin="5,9,0,0"
115-
VerticalAlignment="Stretch"
116-
HorizontalAlignment="Stretch"
117113
FontFamily="{StaticResource firacode}"
118114
FontSize="14"
119115
ShowLineNumbers="True"
120-
121116
LineNumbersForeground="{Binding textBoxForeground}"
122117
ScrollViewer.CanContentScroll="True"
123-
ScrollViewer.HorizontalScrollBarVisibility="Auto"
124-
ScrollViewer.VerticalScrollBarVisibility="Auto"
118+
ScrollViewer.HorizontalScrollBarVisibility="Visible"
119+
ScrollViewer.VerticalScrollBarVisibility="Visible"
125120
Text="{Binding code}"
126121
SyntaxHighlighting="{Binding CurrentLang, Converter={StaticResource HighlightingDefinitionConverter}}"/>
127122
</Border>

0 commit comments

Comments
 (0)