Skip to content

Commit 4f4eadb

Browse files
committed
* 添加Promotion;
1 parent 337927b commit 4f4eadb

4 files changed

Lines changed: 77 additions & 38 deletions

File tree

31.3 KB
Loading

src/Nlnet.Sharp.Magic.App/MainWindow.axaml

Lines changed: 67 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
xmlns:sharp="clr-namespace:Nlnet.Sharp"
88
xmlns:travel="clr-namespace:Nlnet.Sharp.Icon.Travel;assembly=Nlnet.Sharp.Magic.App.Iconfont"
99
Title="{Binding Source={x:Static sharp:AssemblyVersionProvider.Version}, StringFormat=Nlnet Sharp Iconfont Generator | v{0}}"
10-
Width="800"
10+
Width="830"
1111
Height="500"
1212
FontSize="18"
1313
Icon="Assets/Magic.ico"
@@ -83,6 +83,7 @@
8383
<StackPanel Margin="0,20" />
8484
</ItemsPanelTemplate>
8585
</TabControl.ItemsPanel>
86+
8687
<TabControl.ContentTemplate>
8788
<DataTemplate>
8889
<ScrollViewer Content="{Binding}" />
@@ -91,14 +92,46 @@
9192

9293
<TabItem Header="About">
9394
<StackPanel Spacing="20">
94-
<Image Width="120"
95-
HorizontalAlignment="Left"
96-
Source="Assets/Magic.Clean.png" />
95+
<Grid ColumnDefinitions="Auto,40,*,20,Auto">
96+
<Image Height="120"
97+
HorizontalAlignment="Left"
98+
Source="Assets/Magic.Clean.png" />
99+
100+
<Border Grid.Column="1"
101+
Width="1"
102+
HorizontalAlignment="Center"
103+
Background="LightGray" />
104+
105+
<StackPanel Grid.Column="2">
106+
<TextBlock Margin="0,0,0,10"
107+
FontSize="24"
108+
FontWeight="Bold"
109+
Text="Promotion" />
110+
<TextBlock>
111+
<Run>We have created a</Run>
112+
<Run FontWeight="Bold" Foreground="MediumVioletRed">powerful devtools</Run>
113+
<Run>for Avalonia. A free trial plan is available now. Visit our</Run>
114+
<Button Classes="Link Website"
115+
Click="ButtonVisitWebsite_OnClick"
116+
Content="website"
117+
Tag="https://www.devtools.nlnet.net/" />
118+
<Run>to learn more.</Run>
119+
</TextBlock>
120+
</StackPanel>
121+
<Image Grid.Column="4"
122+
Height="120"
123+
Margin="20,0"
124+
HorizontalAlignment="Left"
125+
Source="Assets/DevTools.png" />
126+
</Grid>
127+
128+
97129
<TextBlock TextWrapping="Wrap">
98130
<Run>We provide an ability to generate icon classes from iconfont.json which comes from</Run>
99131
<Button Classes="Link Website"
100-
Click="ButtonOpenIconfontWebsite_OnClick"
101-
Content="https://www.iconfont.cn/." />
132+
Click="ButtonVisitWebsite_OnClick"
133+
Content="https://www.iconfont.cn/"
134+
Tag="https://www.iconfont.cn/" />
102135
<Run Text="Some other sites those have the ability to generate iconfont will be supported soon if you file an issue." />
103136
<LineBreak />
104137
<LineBreak />
@@ -112,11 +145,13 @@
112145
<Run BaselineAlignment="Center">If you like it, please give a star to us on</Run>
113146
<Button VerticalAlignment="Center"
114147
Classes="Link Icon"
115-
Click="ButtonOpenProjectUrlWebsite_OnClick"
148+
Click="ButtonVisitWebsite_OnClick"
116149
Content="{Black GitHub}"
117-
FontSize="28" />
150+
FontSize="28"
151+
Tag="https://github.com/liwuqingxin/Magic.Icon" />
118152
<Run BaselineAlignment="Center" Text=". Thank you for that!" />
119153
</TextBlock>
154+
120155
</StackPanel>
121156
</TabItem>
122157

@@ -246,47 +281,47 @@
246281
<Run Text="You can use the FontManagerOptions to control the text's FontFamily." />
247282
<Run Text="The last line is clipped. It is not recommended to use it." />
248283
</TextBlock>
249-
<TextBlock Text="{Food 彩椒, Prefix='The icon is', Suffix='and it is also named 彩椒.'}" />
250-
<TextBlock Text="{Food 咖啡, Suffix='This is Coffee (咖啡).'}" />
251-
<TextBlock Text="{Food 布丁, Suffix='This is Pudding (布丁).'}" />
252-
<TextBlock Text="{Food 树莓, Suffix='This is Raspberry (树莓).'}" />
284+
<TextBlock Text="{Food 彩椒, Prefix='The icon is', Suffix='and it is also named 彩椒.'}" />
285+
<TextBlock Text="{Food 咖啡, Suffix='This is Coffee (咖啡).'}" />
286+
<TextBlock Text="{Food 布丁, Suffix='This is Pudding (布丁).'}" />
287+
<TextBlock Text="{Food 树莓, Suffix='This is Raspberry (树莓).'}" />
253288

254289
<TextBlock Text="Use Run to combine icons and texts. In this way, FontFamily of icons and texts does not interact each other." />
255290
<Border BorderBrush="Red" BorderThickness="1">
256-
<TextBlock>
291+
<TextBlock>
257292
<Run FontSize="24" Text="{Food 奥利奥}" />
258-
<Run Text="This is Oreo (奥利奥)." />
259-
<Run FontSize="48" Text="{Food 树莓}" />
260-
<Run Text="This is Raspberry (树莓)." />
261-
</TextBlock>
293+
<Run Text="This is Oreo (奥利奥)." />
294+
<Run FontSize="48" Text="{Food 树莓}" />
295+
<Run Text="This is Raspberry (树莓)." />
296+
</TextBlock>
262297
</Border>
263298

264299
<TextBlock Text="Also we can have more controls on them, like 'BaselineAlignment'." />
265300
<Border BorderBrush="Red" BorderThickness="1">
266-
<TextBlock>
301+
<TextBlock>
267302
<Run BaselineAlignment="Center"
268303
FontSize="24"
269304
Text="{Food 奥利奥}" />
270-
<Run BaselineAlignment="Center" Text="This is Oreo (奥利奥)." />
271-
<Run BaselineAlignment="Baseline"
305+
<Run BaselineAlignment="Center" Text="This is Oreo (奥利奥)." />
306+
<Run BaselineAlignment="Baseline"
272307
FontSize="48"
273308
Text="{Food 树莓}" />
274-
<Run BaselineAlignment="Center" Text="This is Raspberry (树莓)." />
275-
</TextBlock>
309+
<Run BaselineAlignment="Center" Text="This is Raspberry (树莓)." />
310+
</TextBlock>
311+
</Border>
312+
<Border BorderBrush="Red" BorderThickness="1">
313+
<TextBlock>
314+
<Run BaselineAlignment="Center" Text="{Food 奥利奥}" />
315+
<Run BaselineAlignment="Center" Text="This is Oreo (奥利奥)." />
316+
<Run BaselineAlignment="Baseline" Text="{Food 树莓}" />
317+
<Run BaselineAlignment="Center" Text="This is Raspberry (树莓)." />
318+
</TextBlock>
276319
</Border>
277320
<Border BorderBrush="Red" BorderThickness="1">
278-
<TextBlock>
279-
<Run BaselineAlignment="Center" Text="{Food 奥利奥}" />
280-
<Run BaselineAlignment="Center" Text="This is Oreo (奥利奥)." />
281-
<Run BaselineAlignment="Baseline" Text="{Food 树莓}" />
282-
<Run BaselineAlignment="Center" Text="This is Raspberry (树莓)." />
283-
</TextBlock>
284-
</Border>
285-
<Border BorderBrush="Red" BorderThickness="1">
286-
<TextBlock FontSize="12">
321+
<TextBlock FontSize="12">
287322
<Run Text="{Food 橙子}" />
288323
<Run Text="This is Raspberry (树莓)." />
289-
</TextBlock>
324+
</TextBlock>
290325
</Border>
291326

292327
<TextBlock Text="If you use Nlnet.Sharp.Magic.Icon package in nuget, you can use 'IconTextBlock' which has a Icon property." />

src/Nlnet.Sharp.Magic.App/MainWindow.axaml.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ private void Button_OnClick(object? sender, RoutedEventArgs e)
1717
viewer.ShowDialog(this);
1818
}
1919

20-
private void ButtonOpenIconfontWebsite_OnClick(object? sender, RoutedEventArgs e)
20+
private void ButtonVisitWebsite_OnClick(object? sender, RoutedEventArgs e)
2121
{
22-
Process.Start(new ProcessStartInfo("https://www.iconfont.cn/") { UseShellExecute = true });
23-
}
22+
if (sender is not Button { Tag: string s })
23+
{
24+
return;
25+
}
2426

25-
private void ButtonOpenProjectUrlWebsite_OnClick(object? sender, RoutedEventArgs e)
26-
{
27-
Process.Start(new ProcessStartInfo("https://github.com/liwuqingxin/Magic.Icon") { UseShellExecute = true });
27+
Process.Start(new ProcessStartInfo(s) { UseShellExecute = true });
2828
}
2929
}

src/Nlnet.Sharp.Magic.App/Nlnet.Sharp.Magic.App.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
<ItemGroup>
1414
<AvaloniaResource Include="Assets\**" />
1515
</ItemGroup>
16+
17+
<ItemGroup>
18+
<None Remove="Assets\DevTools.png" />
19+
</ItemGroup>
1620

1721
<ItemGroup>
1822
<PackageReference Include="Avalonia" Version="$(AvaloniaVersionThatSampleUsed)" />

0 commit comments

Comments
 (0)