-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
MainWindow.axaml
220 lines (208 loc) · 9.77 KB
/
MainWindow.axaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controllers="using:Arise.Client.Launcher.Controllers"
xmlns:avalonia="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia"
xmlns:controls="using:Arise.Client.Launcher.Controls"
x:Class="Arise.Client.Launcher.Windows.MainWindow"
x:DataType="controllers:MainController"
Width="1280"
Height="720"
RequestedThemeVariant="Dark"
>
<Window.Styles>
<Style Selector="#CloseButton:pointerover /template/ ContentPresenter">
<Setter Property="Background" Value="{DynamicResource CloseButtonPointerOverBackground}" />
</Style>
<Style Selector="#CloseButton:pressed /template/ ContentPresenter">
<Setter Property="Background" Value="{DynamicResource CloseButtonPressedBackground}" />
</Style>
<!--this is slow on first display (even without transition)
need to figure out a way to fix it; maybe render
the form outside of the window (or under the background image)
as soon as the window is loaded, then hide it and bring it
in position for any following show requests-->
<!--https://github.com/AvaloniaUI/Avalonia/issues/1529-->
<Style Selector="Border#ModalDarkening">
<Setter Property="Opacity" Value="0"/>
</Style>
<Style Selector="Border#ModalDarkening.visible">
<Setter Property="Opacity" Value="1"/>
</Style>
</Window.Styles>
<Grid RowDefinitions="48,*">
<!--Title bar-->
<Grid VerticalAlignment="Stretch"
ColumnDefinitions="Auto,*"
Margin="8">
<Grid.Styles>
<Style Selector="Button">
<Setter Property="Background" Value="{DynamicResource DefaultButtonBackground}" />
<Setter Property="CornerRadius" Value="8" />
<Setter Property="Height" Value="24" />
</Style>
</Grid.Styles>
<Rectangle RadiusX="8"
RadiusY="8"
Height="24"
Width="24"
HorizontalAlignment="Left"
Margin="0 0 8 0">
<Rectangle.Fill>
<ImageBrush Source="../../arise.png"
Stretch="Fill" />
</Rectangle.Fill>
</Rectangle>
<TextBlock Text="TERA Arise"
Grid.ColumnSpan="2"
IsHitTestVisible="False"
VerticalAlignment="Center"
HorizontalAlignment="Center"/>
<StackPanel Orientation="Horizontal"
Grid.Column="1"
HorizontalAlignment="Right">
<Button x:Name="AccountButton"
FontSize="10"
Margin="0 0 6 0"
Padding="6 0"
Command="{Binding ShowAccountPopupCommand}"
>
<StackPanel Orientation="Horizontal">
<avalonia:MaterialIcon Kind="Account"
IsVisible="{Binding IsLoggedIn}"/>
<TextBlock Text="{Binding CurrentAccountName}"
Margin="4 0 0 0"
VerticalAlignment="Center" />
</StackPanel>
</Button>
<Button x:Name="MinimizeButton"
Width="24"
Click="OnMinimizeClick">
<avalonia:MaterialIcon Kind="WindowMinimize" />
</Button>
<Button x:Name="CloseButton"
Width="24"
Margin="6 0 0 0"
Click="OnCloseClick">
<avalonia:MaterialIcon Kind="Close" />
</Button>
</StackPanel>
</Grid>
<Image Source="../../image_background.webp"
Stretch="Fill"
IsHitTestVisible="False"
Grid.Row="1" />
<!--
<Image Source="../../image_logo.webp"
IsHitTestVisible="False"
Stretch="Uniform"
Grid.Row="1" />-->
<Border x:Name="ModalDarkening"
Background="#5000"
Grid.RowSpan="2"
IsHitTestVisible="{Binding IsModalVisible}"
Classes.visible="{Binding IsModalVisible}"
controls:CommandBehavior.Command="{Binding CloseModalCommand}">
<Border.Transitions>
<Transitions>
<DoubleTransition Property="Opacity" Duration="0:0:0.25"/>
</Transitions>
</Border.Transitions>
<Border x:Name="LoginForm"
Background="{DynamicResource WindowBackground}"
CornerRadius="10"
BoxShadow="0 10 20 0 #5000"
Padding="24"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Width="300"
>
<Border.Styles>
<Style Selector="TextBox">
<Setter Property="Margin" Value="0 0 0 10"/>
<Setter Property="Padding" Value="12"/>
<Setter Property="CornerRadius" Value="8"/>
<Setter Property="BorderBrush" Value="{DynamicResource ThemeTextMidBrush}"/>
</Style>
</Border.Styles>
<Grid RowDefinitions="*,*,*,*,*,*">
<TextBlock Margin="0 0 0 20"
TextWrapping="Wrap">
<Run Text="TERA Arise"
FontSize="22"
FontWeight="DemiBold"/>
<LineBreak/>
<LineBreak/>
<Run Text="Use your account name and password to login"
Foreground="{DynamicResource ThemeTextMidBrush}"/>
</TextBlock>
<Button HorizontalAlignment="Right"
VerticalAlignment="Top"
Height="28"
Width="28"
CornerRadius="14"
Background="Transparent"
Command="{Binding CloseModalCommand}">
<avalonia:MaterialIcon Kind="Close" />
</Button>
<TextBox VerticalAlignment="Center"
Watermark="Username"
x:Name="UsernameTextBox"
Text="{Binding Username, Mode=TwoWay}"
Grid.Row="1"
/>
<TextBox PasswordChar="•"
Watermark="Password"
VerticalAlignment="Center"
Grid.Row="2"
Text="{Binding Password, Mode=TwoWay}"
/>
<Button Content="Login"
Grid.Row="3"
CornerRadius="8"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"
Height="{Binding #UsernameTextBox.Bounds.Height}"
Command="{Binding LoginCommand}"
Background="{DynamicResource AccentBrush}"
/>
<CheckBox Grid.Row="4"
Content="Remember me"
FontSize="10"
Padding="4 0 4 0"
Classes="small"
HorizontalAlignment="Left"
VerticalAlignment="Center"
IsChecked="{Binding RememberMe}"
/>
<TextBlock HorizontalAlignment="Right"
VerticalAlignment="Center"
Text="Recover password"
Grid.Row="4"
Padding="0 1 0 0"
FontSize="10"
Foreground="{DynamicResource AccentBrush}"
Cursor="Hand"
controls:CommandBehavior.Command="{Binding RecoverPasswordCommand}"
/>
<!--looks like we have no inline hyperlinks in avalonia
https://github.com/AvaloniaUI/Avalonia/discussions/8818-->
<WrapPanel Grid.Row="5"
Margin="0 10 0 0"
Orientation="Horizontal"
VerticalAlignment="Center"
HorizontalAlignment="Center">
<TextBlock Text="You don't have an account? " FontSize="10"/>
<TextBlock Text="Register"
FontSize="10"
Foreground="{DynamicResource AccentBrush}"
Cursor="Hand"
controls:CommandBehavior.Command="{Binding RegisterCommand}"
/>
<TextBlock Text=" now." FontSize="10"/>
</WrapPanel>
</Grid>
</Border>
</Border>
</Grid>
</Window>