-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainWindow.xaml
More file actions
327 lines (306 loc) · 21.9 KB
/
MainWindow.xaml
File metadata and controls
327 lines (306 loc) · 21.9 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
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
<Window x:Class="GotifyClient.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Gotify Client" Height="750" Width="900"
Closing="Window_Closing"
Loaded="Window_Loaded"
StateChanged="Window_StateChanged"
Background="{StaticResource AppBackground}">
<Window.Resources>
<SolidColorBrush x:Key="AppBackground" Color="#111827"/>
<SolidColorBrush x:Key="HeaderBackground" Color="#1F2937"/>
<SolidColorBrush x:Key="CardBackground" Color="#1F2937"/>
<SolidColorBrush x:Key="CardHover" Color="#374151"/>
<SolidColorBrush x:Key="PanelBackground" Color="#0F172A"/>
<SolidColorBrush x:Key="BorderColor" Color="#374151"/>
<SolidColorBrush x:Key="PrimaryText" Color="#F9FAFB"/>
<SolidColorBrush x:Key="SecondaryText" Color="#D1D5DB"/>
<SolidColorBrush x:Key="MutedText" Color="#9CA3AF"/>
<SolidColorBrush x:Key="SubtleButton" Color="#374151"/>
<SolidColorBrush x:Key="SubtleButtonHover" Color="#4B5563"/>
<SolidColorBrush x:Key="Accent" Color="#6366F1"/>
</Window.Resources>
<Grid>
<!-- Main Content -->
<DockPanel>
<!-- Header -->
<Grid DockPanel.Dock="Top" Background="{StaticResource HeaderBackground}" Height="80">
<Grid.Effect>
<DropShadowEffect Color="Black" Opacity="0.1" BlurRadius="10" ShadowDepth="2" Direction="270"/>
</Grid.Effect>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="30,0">
<Ellipse Width="50" Height="50" Fill="{StaticResource Accent}" Margin="0,0,15,0">
<Ellipse.Effect>
<DropShadowEffect Color="#4F46E5" Opacity="0.3" BlurRadius="15" ShadowDepth="0"/>
</Ellipse.Effect>
</Ellipse>
<TextBlock Text="🔔" FontSize="30" VerticalAlignment="Center" Margin="-42,0,0,0"/>
<StackPanel VerticalAlignment="Center" Margin="10,0,0,0">
<TextBlock Text="Notifications Center" FontSize="24" FontWeight="Bold" Foreground="{StaticResource PrimaryText}"/>
<StackPanel Orientation="Horizontal">
<Ellipse x:Name="StatusIndicator" Width="8" Height="8" Fill="#EF4444" Margin="0,2,5,0"/>
<TextBlock x:Name="StatusTextBlock" Text="Déconnecté" FontSize="12" Foreground="{StaticResource MutedText}"/>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,0,0,0" VerticalAlignment="Center">
<Button Content="⚙️" FontSize="20" Width="40" Height="40" Margin="0,0,10,0"
Background="Transparent" BorderThickness="0" Cursor="Hand"
Click="ShowSettings_Click" ToolTip="Paramètres">
<Button.Style>
<Style TargetType="Button">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}"
CornerRadius="8" Padding="5">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{StaticResource SubtleButton}"/>
</Trigger>
</Style.Triggers>
</Style>
</Button.Style>
</Button>
<Button x:Name="OptionsMenuButton" Content="⋯" FontSize="20" Width="40" Height="40"
Background="Transparent" BorderThickness="0" Cursor="Hand"
Click="ShowOptionsMenu_Click" ToolTip="Options">
<Button.Style>
<Style TargetType="Button">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}"
CornerRadius="8" Padding="5">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{StaticResource SubtleButton}"/>
</Trigger>
</Style.Triggers>
</Style>
</Button.Style>
</Button>
</StackPanel>
</StackPanel>
</Grid>
<!-- Messages Area -->
<ScrollViewer DockPanel.Dock="Top" VerticalScrollBarVisibility="Auto" Margin="20,20,20,20">
<StackPanel>
<!-- Info Bar -->
<Border Background="{StaticResource CardBackground}" CornerRadius="12" Padding="20,15" Margin="0,0,0,15">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Horizontal">
<TextBlock x:Name="MessageCountTextBlock" Text="0 notifications" FontSize="14" FontWeight="SemiBold" Foreground="{StaticResource SecondaryText}" VerticalAlignment="Center"/>
<TextBlock x:Name="ServerUrlDisplay" Text="" FontSize="12" Foreground="{StaticResource MutedText}" Margin="15,0,0,0" VerticalAlignment="Center"/>
</StackPanel>
<Button Grid.Column="1" Content="Tout effacer" Padding="12,6"
Background="{StaticResource SubtleButton}" BorderThickness="0"
Foreground="{StaticResource SecondaryText}" FontSize="12" Cursor="Hand"
Click="ClearMessagesButton_Click">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}"
CornerRadius="6" Padding="{TemplateBinding Padding}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Button.Template>
<Button.Style>
<Style TargetType="Button">
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{StaticResource SubtleButtonHover}"/>
</Trigger>
</Style.Triggers>
</Style>
</Button.Style>
</Button>
</Grid>
</Border>
<!-- Messages List -->
<ItemsControl x:Name="MessagesItemsControl">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border Background="{StaticResource CardBackground}" CornerRadius="12" Padding="20" Margin="0,0,0,12" Cursor="Hand">
<Border.Effect>
<DropShadowEffect Color="Black" Opacity="0.05" BlurRadius="10" ShadowDepth="2" Direction="270"/>
</Border.Effect>
<Border.Style>
<Style TargetType="Border">
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{StaticResource CardHover}"/>
</Trigger>
</Style.Triggers>
</Style>
</Border.Style>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<!-- Icon -->
<Border Grid.Column="0" Width="50" Height="50" CornerRadius="10"
Background="{Binding PriorityColor}" Margin="0,0,15,0">
<TextBlock Text="{Binding PriorityIcon}" FontSize="24"
HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<!-- Content -->
<StackPanel Grid.Column="1" VerticalAlignment="Center">
<TextBlock Text="{Binding Title}" FontSize="15" FontWeight="SemiBold"
Foreground="{StaticResource PrimaryText}" TextWrapping="Wrap" Margin="0,0,0,4"/>
<TextBlock Text="{Binding Message}" FontSize="13" Foreground="{StaticResource SecondaryText}"
TextWrapping="Wrap" MaxHeight="60" TextTrimming="CharacterEllipsis"/>
<TextBlock Text="{Binding AppId}" FontSize="11" Foreground="{StaticResource MutedText}"
Margin="0,6,0,0" FontWeight="Medium"/>
</StackPanel>
<!-- Time & Priority -->
<StackPanel Grid.Column="2" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="15,0,0,0">
<TextBlock Text="{Binding DateFormatted}" FontSize="11" Foreground="{StaticResource MutedText}"
HorizontalAlignment="Right"/>
<Border Background="{Binding PriorityColor}" CornerRadius="4"
Padding="8,3" Margin="0,8,0,0" HorizontalAlignment="Right">
<TextBlock Text="{Binding priority}" FontSize="11" FontWeight="Bold"
Foreground="White"/>
</Border>
</StackPanel>
</Grid>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<!-- Empty State -->
<Border x:Name="EmptyState" Background="{StaticResource CardBackground}" CornerRadius="12" Padding="40"
Visibility="Collapsed" HorizontalAlignment="Center" Margin="0,40,0,0">
<StackPanel HorizontalAlignment="Center">
<TextBlock Text="🔕" FontSize="48" HorizontalAlignment="Center" Margin="0,0,0,15"/>
<TextBlock Text="Aucune notification" FontSize="18" FontWeight="SemiBold"
Foreground="{StaticResource SecondaryText}" HorizontalAlignment="Center"/>
<TextBlock Text="Vous êtes à jour !" FontSize="13" Foreground="{StaticResource MutedText}"
HorizontalAlignment="Center" Margin="0,5,0,0"/>
</StackPanel>
</Border>
</StackPanel>
</ScrollViewer>
</DockPanel>
<!-- Settings Dialog Overlay -->
<Grid x:Name="SettingsOverlay" Background="#DD000000" Visibility="Collapsed">
<Border Background="{StaticResource PanelBackground}" Width="520" Height="350" CornerRadius="16"
HorizontalAlignment="Center" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect Color="Black" Opacity="0.3" BlurRadius="30" ShadowDepth="0"/>
</Border.Effect>
<Grid Margin="30">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Margin="0,0,0,25">
<TextBlock Text="⚙️ Paramètres de connexion" FontSize="22" FontWeight="Bold" Foreground="{StaticResource PrimaryText}"/>
<TextBlock Text="Configurez votre serveur Gotify" FontSize="13" Foreground="{StaticResource SecondaryText}" Margin="0,5,0,0"/>
</StackPanel>
<StackPanel Grid.Row="1">
<TextBlock Text="URL du serveur" FontSize="13" FontWeight="SemiBold" Foreground="{StaticResource SecondaryText}" Margin="0,0,0,8"/>
<Border Background="{StaticResource HeaderBackground}" BorderBrush="{StaticResource BorderColor}" BorderThickness="1" CornerRadius="8" Height="42">
<TextBox x:Name="ServerUrlTextBox" Padding="12" FontSize="14" BorderThickness="0" Background="Transparent"
ToolTip="Ex: https://gotify.example.com" VerticalContentAlignment="Center" Foreground="{StaticResource PrimaryText}"/>
</Border>
<TextBlock Text="Token client" FontSize="13" FontWeight="SemiBold" Foreground="{StaticResource SecondaryText}" Margin="0,20,0,8"/>
<Border Background="{StaticResource HeaderBackground}" BorderBrush="{StaticResource BorderColor}" BorderThickness="1" CornerRadius="8" Height="42">
<PasswordBox x:Name="TokenPasswordBox" Padding="12" FontSize="14" BorderThickness="0" Background="Transparent"
ToolTip="Token d'application client" VerticalContentAlignment="Center" Foreground="{StaticResource PrimaryText}"/>
</Border>
<TextBlock x:Name="SettingsStatusText" Foreground="#F87171" TextWrapping="Wrap" Margin="0,10,0,0" FontSize="12"/>
</StackPanel>
<StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,25,0,0">
<Button Content="Annuler" Width="100" Height="38" Margin="0,0,10,0"
Background="{StaticResource SubtleButton}" BorderThickness="0"
Foreground="{StaticResource SecondaryText}" FontSize="14" FontWeight="SemiBold" Cursor="Hand"
Click="CancelSettings_Click">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}" CornerRadius="8">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Button.Template>
<Button.Style>
<Style TargetType="Button">
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{StaticResource SubtleButtonHover}"/>
</Trigger>
</Style.Triggers>
</Style>
</Button.Style>
</Button>
<Button x:Name="SaveSettingsButton" Content="Se connecter" Width="140" Height="38"
Background="{StaticResource Accent}" BorderThickness="0"
Foreground="White" FontSize="14" FontWeight="SemiBold" Cursor="Hand"
Click="SaveSettings_Click">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}" CornerRadius="8">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Button.Template>
<Button.Effect>
<DropShadowEffect Color="#4F46E5" Opacity="0.3" BlurRadius="15" ShadowDepth="0"/>
</Button.Effect>
<Button.Style>
<Style TargetType="Button">
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#4338CA"/>
</Trigger>
</Style.Triggers>
</Style>
</Button.Style>
</Button>
</StackPanel>
</Grid>
</Border>
</Grid>
<!-- Options Menu Popup -->
<Popup x:Name="OptionsMenuPopup" StaysOpen="False" Placement="Bottom" PlacementTarget="{Binding ElementName=OptionsMenuButton}">
<Border Background="{StaticResource CardBackground}" CornerRadius="8" BorderBrush="{StaticResource BorderColor}" BorderThickness="1" Padding="8">
<Border.Effect>
<DropShadowEffect Color="Black" Opacity="0.15" BlurRadius="15" ShadowDepth="5"/>
</Border.Effect>
<StackPanel Width="200">
<CheckBox x:Name="SoundNotificationMenuItem" Content="Notifications sonores" IsChecked="True"
Foreground="{StaticResource SecondaryText}"
Margin="8,8,8,4" Checked="ToggleSoundNotification_Click" Unchecked="ToggleSoundNotification_Click"/>
<CheckBox x:Name="WindowsNotificationMenuItem" Content="Notifications Windows" IsChecked="True"
Foreground="{StaticResource SecondaryText}"
Margin="8,4,8,4" Checked="ToggleWindowsNotification_Click" Unchecked="ToggleWindowsNotification_Click"/>
<CheckBox x:Name="MinimizeToTrayMenuItem" Content="Minimiser dans la barre" IsChecked="True"
Foreground="{StaticResource SecondaryText}"
Margin="8,4,8,4"/>
<Separator Margin="0,8"/>
<Button Content="À propos" Padding="8,6" Background="Transparent" BorderThickness="0"
Foreground="{StaticResource SecondaryText}"
HorizontalContentAlignment="Left" Click="ShowAbout_Click"/>
<Button Content="Quitter" Padding="8,6" Background="Transparent" BorderThickness="0"
HorizontalContentAlignment="Left" Foreground="#F87171" Click="QuitApp_Click"/>
</StackPanel>
</Border>
</Popup>
</Grid>
</Window>