Skip to content

Commit 9eebcb1

Browse files
committed
Update
1 parent 4be0c5c commit 9eebcb1

File tree

3 files changed

+66
-54
lines changed

3 files changed

+66
-54
lines changed

ChatGPT.UI/App.axaml

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,42 @@
11
<Application xmlns="https://github.com/avaloniaui"
22
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
3-
x:Class="ChatGPT.UI.App">
3+
x:Class="ChatGPT.UI.App"
4+
Name="ChatGPT"
5+
RequestedThemeVariant="Light">
6+
<Application.Resources>
7+
<StreamGeometry x:Key="SendIcon">M5.694 12 2.299 3.272c-.236-.607.356-1.188.942-.982l.093.04 18 9a.75.75 0 0 1 .097 1.283l-.097.058-18 9c-.583.291-1.217-.244-1.065-.847l.03-.096L5.694 12 2.299 3.272 5.694 12ZM4.402 4.54l2.61 6.71h6.627a.75.75 0 0 1 .743.648l.007.102a.75.75 0 0 1-.649.743l-.101.007H7.01l-2.609 6.71L19.322 12 4.401 4.54Z</StreamGeometry>
8+
</Application.Resources>
49
<Application.Styles>
5-
<FluentTheme Mode="Light" />
10+
<FluentTheme />
611

712
<Style Selector="TextBox[Name=Choice]">
8-
<Setter Property="Background" Value="#fff" />
913
<Setter Property="Padding" Value="16" />
1014
<Setter Property="FontSize" Value="20" />
11-
<Setter Property="Foreground" Value="#333" />
12-
<Setter Property="Opacity" Value="0.8" />
1315
</Style>
1416

1517
<Style Selector="TextBlock[Text=Settings]">
1618
<Setter Property="Margin" Value="8" />
1719
<Setter Property="FontSize" Value="20" />
18-
<Setter Property="Foreground" Value="#333" />
1920
</Style>
2021

2122
<Style Selector="TextBox[Name=Temperature]">
22-
<Setter Property="Background" Value="#fff" />
2323
<Setter Property="Padding" Value="16" />
2424
<Setter Property="FontSize" Value="20" />
25-
<Setter Property="Foreground" Value="#333" />
26-
<Setter Property="Opacity" Value="0.8" />
2725
</Style>
2826

2927
<Style Selector="TextBox[Name=MaxTokens]">
30-
<Setter Property="Background" Value="#fff" />
3128
<Setter Property="Padding" Value="16" />
3229
<Setter Property="FontSize" Value="20" />
33-
<Setter Property="Foreground" Value="#333" />
34-
<Setter Property="Opacity" Value="0.8" />
3530
</Style>
3631

3732
<Style Selector="TextBox[Name=Prompt]">
38-
<Setter Property="Background" Value="#fff" />
3933
<Setter Property="Padding" Value="16" />
4034
<Setter Property="FontSize" Value="20" />
41-
<Setter Property="Foreground" Value="#333" />
42-
<Setter Property="Opacity" Value="0.8" />
4335
</Style>
4436

4537
<Style Selector="Button[Name=Submit]">
46-
<Setter Property="Background" Value="#fff" />
4738
<Setter Property="Padding" Value="16" />
4839
<Setter Property="FontSize" Value="20" />
49-
<Setter Property="Foreground" Value="#333" />
50-
<Setter Property="Opacity" Value="0.8" />
5140
</Style>
5241

5342
</Application.Styles>

ChatGPT.UI/ChatGPT.UI.csproj

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,14 @@
55
<Nullable>enable</Nullable>
66
<TrimMode>copyused</TrimMode>
77
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
8-
<AvaloniaVersion>11.0.0-preview4</AvaloniaVersion>
8+
<AvaloniaVersion>11.0.0-preview5</AvaloniaVersion>
99
</PropertyGroup>
10-
<ItemGroup>
11-
<TrimmableAssembly Include="Avalonia.Themes.Fluent" />
12-
<TrimmableAssembly Include="Avalonia.Themes.Default" />
13-
</ItemGroup>
1410
<ItemGroup>
1511
<PackageReference Include="Avalonia" Version="$(AvaloniaVersion)" />
1612
<PackageReference Include="Avalonia.Desktop" Version="$(AvaloniaVersion)" />
1713
<PackageReference Include="Avalonia.Themes.Fluent" Version="$(AvaloniaVersion)" />
1814
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="$(AvaloniaVersion)" />
19-
<PackageReference Include="XamlNameReferenceGenerator" Version="1.3.4" />
15+
<PackageReference Include="XamlNameReferenceGenerator" Version="1.5.1" />
2016
</ItemGroup>
2117
<ItemGroup>
2218
<ProjectReference Include="..\ChatGPT\ChatGPT.csproj" />

ChatGPT.UI/MainWindow.axaml

Lines changed: 57 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,34 +5,61 @@
55
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
66
x:Class="ChatGPT.UI.MainWindow"
77
Title="ChatGPT"
8-
Background="#f8f8f8">
9-
<Grid Margin="16"
10-
RowDefinitions="*, Auto"
11-
ColumnDefinitions="*, Auto">
12-
<TextBox Grid.Row="0" Grid.Column="0" Name="Choice" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="8"
13-
Background="#fff" Padding="16" FontSize="20" Foreground="#333" Opacity="0.8"
14-
TextWrapping="Wrap" AcceptsReturn="True" AcceptsTab="True"/>
15-
<StackPanel Grid.Row="0" Grid.Column="1" Margin="8" Orientation="Vertical" Width="150">
16-
<TextBlock Margin="8" Text="Settings" FontSize="20" Foreground="#333" />
17-
<StackPanel Orientation="Vertical">
18-
<StackPanel Orientation="Vertical">
19-
<TextBlock Text="Temperature:" Margin="8" FontSize="20" Foreground="#333" />
20-
<TextBox Name="Temperature" Width="100" Margin="8"
21-
Background="#fff" Padding="16" FontSize="20" Foreground="#333" Opacity="0.8" />
22-
</StackPanel>
23-
<StackPanel Orientation="Vertical">
24-
<TextBlock Text="MaxTokens:" Margin="8" FontSize="20" Foreground="#333" />
25-
<TextBox Name="MaxTokens" Width="100" Margin="8"
26-
Background="#fff" Padding="16" FontSize="20" Foreground="#333" Opacity="0.8" />
27-
</StackPanel>
28-
</StackPanel>
29-
</StackPanel>
30-
<Grid Grid.Row="1" Margin="8"
31-
ColumnDefinitions="*, Auto">
32-
<TextBox Grid.Column="0" Name="Prompt" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="8"
33-
Background="#fff" Padding="16" FontSize="20" Foreground="#333" Opacity="0.8" />
34-
<Button Grid.Column="1" Name="Submit" Width="100" Content="Submit" Margin="8"
35-
Background="#fff" Padding="16" FontSize="20" Foreground="#333" Opacity="0.8" />
36-
</Grid>
37-
</Grid>
8+
Background="#00FFFFFF"
9+
TransparencyLevelHint="Transparent"
10+
ExtendClientAreaToDecorationsHint="True"
11+
ExtendClientAreaChromeHints="NoChrome"
12+
ExtendClientAreaTitleBarHeightHint="-1"
13+
x:Name="Main">
14+
<Panel>
15+
<!--<ExperimentalAcrylicBorder IsHitTestVisible="False">
16+
<ExperimentalAcrylicBorder.Material>
17+
<ExperimentalAcrylicMaterial BackgroundSource="Digger"
18+
TintColor="Transparent"
19+
TintOpacity="0"
20+
FallbackColor="Transparent"
21+
MaterialOpacity="0" />
22+
</ExperimentalAcrylicBorder.Material>
23+
</ExperimentalAcrylicBorder>-->
24+
<Panel Margin="{Binding #Main.OffScreenMargin}">
25+
<Panel Margin="{Binding #Main.WindowDecorationMargin}">
26+
<Grid Margin="16" RowDefinitions="*, Auto" ColumnDefinitions="*, Auto">
27+
<TextBox Grid.Row="0" Grid.Column="0"
28+
Name="Choice"
29+
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
30+
Margin="8"
31+
Padding="16" FontSize="20"
32+
TextWrapping="Wrap" AcceptsReturn="True" AcceptsTab="True"
33+
Background="Transparent"/>
34+
<StackPanel Grid.Row="0" Grid.Column="1" Margin="8" Orientation="Vertical" Width="150">
35+
<TextBlock Margin="8" Text="Settings" FontSize="20" />
36+
<StackPanel Orientation="Vertical">
37+
<StackPanel Orientation="Vertical">
38+
<TextBlock Text="Temperature:" Margin="8" FontSize="20" />
39+
<TextBox Name="Temperature" Width="100" Margin="8" Padding="16" FontSize="20"/>
40+
</StackPanel>
41+
<StackPanel Orientation="Vertical">
42+
<TextBlock Text="MaxTokens:" Margin="8" FontSize="20" />
43+
<TextBox Name="MaxTokens" Width="100" Margin="8" Padding="16" FontSize="20"/>
44+
</StackPanel>
45+
</StackPanel>
46+
</StackPanel>
47+
<Grid Grid.Column="0" Grid.Row="1"
48+
Margin="8"
49+
ColumnDefinitions="*, Auto">
50+
<TextBox Grid.Column="0"
51+
Name="Prompt"
52+
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
53+
Margin="8"
54+
Padding="16" FontSize="20" />
55+
<Button Grid.Column="1"
56+
Name="Submit"
57+
Width="100" Content="Submit" Margin="8" Padding="16" FontSize="20"/>
58+
</Grid>
59+
</Grid>
60+
</Panel>
61+
</Panel>
62+
</Panel>
63+
64+
3865
</Window>

0 commit comments

Comments
 (0)