-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainWindow.xaml
More file actions
223 lines (211 loc) · 10.6 KB
/
MainWindow.xaml
File metadata and controls
223 lines (211 loc) · 10.6 KB
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
221
222
223
<Window x:Class="bHapticsRelay.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="bHapticsRelay"
Width="520" Height="370"
Background="#1a1a1a"
WindowStartupLocation="CenterScreen"
Icon="pack://application:,,,/bhaptics-relay-icon.ico"
Closing="Window_Closing">
<Window.Resources>
<Style TargetType="Button">
<Setter Property="Background" Value="#fabe00"/>
<Setter Property="Foreground" Value="Black"/>
<Setter Property="FontSize" Value="16"/>
<Setter Property="Padding" Value="8,3"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="BorderBrush" Value="#565656"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="14">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="BrowseButtonStyle" TargetType="Button">
<Setter Property="Background" Value="#fabe00"/>
<Setter Property="Foreground" Value="Black"/>
<Setter Property="BorderBrush" Value="#565656"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="FontSize" Value="15"/>
<Setter Property="Padding" Value="8,3"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="border"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="14">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="border" Property="Background" Value="#ffe45c"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter TargetName="border" Property="Background" Value="#ffc107"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="border" Property="Background" Value="#aaa"/>
<Setter Property="Foreground" Value="#555"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="TestButtonStyle" TargetType="Button">
<Setter Property="Background" Value="#fabe00"/>
<Setter Property="Foreground" Value="Black"/>
<Setter Property="BorderBrush" Value="#565656"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="FontSize" Value="17"/>
<Setter Property="Padding" Value="8,3"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="border"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="18">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="border" Property="Background" Value="#ffe45c"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter TargetName="border" Property="Background" Value="#ffc107"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="border" Property="Background" Value="#666"/>
<Setter Property="Foreground" Value="#bbb"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>
<Grid Margin="0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="16,16,0,10">
<Image Source="pack://application:,,,/bhaptics-logo.png" Width="120" Height="28" Stretch="Uniform" RenderOptions.BitmapScalingMode="HighQuality"/>
<TextBlock x:Name="AppTitleText"
Text="bHapticsRelay"
Foreground="White"
FontSize="26"
FontWeight="Bold"
Margin="12,0,0,0"
VerticalAlignment="Center"/>
</StackPanel>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="24,0,0,0" Grid.Row="1">
<TextBlock Text="Player Connected:" Foreground="White" FontSize="18" VerticalAlignment="Center"/>
<Ellipse x:Name="ConnIndicator"
Width="18" Height="18"
Margin="10,0,0,0"
Fill="Gray"
Stroke="Black" StrokeThickness="1"/>
<TextBlock x:Name="ConnStatusText" Margin="8,0,0,0" VerticalAlignment="Center" Foreground="White" />
<Button x:Name="LaunchPlayerButton"
Content="Launch Player"
FontSize="10"
Margin="12,0,0,0"
Padding="16,4"
MinWidth="80"
VerticalAlignment="Center"
Visibility="Collapsed"
Click="LaunchPlayerButton_Click"/>
</StackPanel>
<StackPanel Grid.Row="2" Margin="32,14,32,0">
<TextBlock x:Name="LastCommandText"
Text="Last command: (none)"
Foreground="#d0eaff"
FontSize="12"
Margin="0,0,0,14"
FontWeight="Regular"/>
<StackPanel x:Name="TailPanel" Margin="0,0,0,12">
<TextBlock Text="Log file to monitor:" Foreground="White" FontSize="16" Margin="0,0,0,7"/>
<StackPanel Orientation="Horizontal">
<TextBox x:Name="LogFileTextBox"
Width="280"
IsReadOnly="True"
FontSize="15"
Padding="3"
Margin="0,0,6,0"
Background="#232323"
Foreground="#eaeaea"
BorderBrush="#444"
ToolTip="{Binding Text, RelativeSource={RelativeSource Self}}"/>
<Button
Content="Browse..."
Style="{StaticResource BrowseButtonStyle}"
Width="80"
Height="28"
FontSize="15"
Click="BrowseButton_Click"/>
</StackPanel>
</StackPanel>
<StackPanel x:Name="WebsocketPanel" Margin="0,0,0,12" Visibility="Collapsed">
<TextBlock Text="WebSocket Address:" Foreground="White" FontSize="12" Margin="0,0,0,7"/>
<TextBox x:Name="WsAddressText"
Text="ws://localhost:PORT"
FontSize="15"
Foreground="#eaeaea"
Background="#232323"
Padding="5,2,5,2"
Margin="0,0,0,4"
IsReadOnly="True"
BorderThickness="1"
Cursor="IBeam"/>
<TextBlock x:Name="WsClientsText"
Text="WS Clients Connected: 0"
FontSize="15"
Foreground="#fabe00"
Margin="0,10,0,0"/>
</StackPanel>
<Button x:Name="TestButton"
Content="Test" Click="TestButton_Click"
Style="{StaticResource TestButtonStyle}"
Width="150" Height="36"
Margin="0,10,0,0"
HorizontalAlignment="Center"
FontSize="17"
Background="#fabe00" Foreground="Black"
BorderBrush="#565656"/>
</StackPanel>
<Border Grid.Row="3" Background="#20242a" Padding="12,10,12,10">
<StackPanel>
<TextBlock x:Name="AboutText"
Text="bHapticsRelay by Dteyn"
Foreground="#aaa"
FontSize="13"
Margin="0,2,0,2"/>
<TextBlock FontSize="13" Foreground="#aaa">
<Run Text="GitHub: "/>
<Hyperlink NavigateUri="https://github.com/Dteyn/bHapticsRelay" RequestNavigate="Hyperlink_RequestNavigate">
github.com/Dteyn/bHapticsRelay
</Hyperlink>
<Run Text=" Support me on Ko-Fi:"/>
<Hyperlink NavigateUri="https://ko-fi.com/Dteyn" RequestNavigate="Hyperlink_RequestNavigate">
ko-fi.com/Dteyn
</Hyperlink>
</TextBlock>
</StackPanel>
</Border>
</Grid>
</Window>