-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainWindow.xaml
229 lines (224 loc) · 10.8 KB
/
MainWindow.xaml
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
<Window
AllowsTransparency="True"
Background="Transparent"
Height="350"
Loaded="MainWindow_OnLoaded"
Title="MainWindow"
Width="525"
WindowStartupLocation="CenterScreen"
WindowStyle="None"
mc:Ignorable="d"
x:Class="VivaldiUpdater.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:VivaldiUpdater"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:properties="clr-namespace:VivaldiUpdater.Properties"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="tinyStyle.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Window.Resources>
<Border Background="#EFD6F3" CornerRadius="20">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="30" />
<RowDefinition />
</Grid.RowDefinitions>
<Grid MouseLeftButtonDown="HandleDrag">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid Background="Transparent" x:Name="windowsHeader">
<TextBlock
FontSize="15"
Foreground="Gray"
HorizontalAlignment="Center"
Margin="5"
Text="Vivaldi Updater by czyt"
VerticalAlignment="Center" />
<TextBlock Text="{Binding AppVersion,StringFormat=v{0}}" HorizontalAlignment="Right" VerticalAlignment="Center">
<TextBlock.Effect>
<DropShadowEffect ShadowDepth="2" Direction="30" Color="OrangeRed" Opacity="0.5" BlurRadius="1"/>
</TextBlock.Effect>
</TextBlock>
</Grid>
<Grid Grid.Column="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="{Binding ElementName=windowsHeader, Path=ActualHeight}" />
<ColumnDefinition Width="{Binding ElementName=windowsHeader, Path=ActualHeight}" />
<ColumnDefinition Width="{Binding ElementName=windowsHeader, Path=ActualHeight}" />
<ColumnDefinition Width="3" />
</Grid.ColumnDefinitions>
<Button Style="{StaticResource AppleButtonStyle}">
<Viewbox>
<Ellipse
Fill="#FFDAD404"
Height="15"
Stroke="#FFFDFDFD"
StrokeThickness="0.5"
Width="15" />
</Viewbox>
</Button>
<Button Grid.Column="1" Style="{StaticResource AppleButtonStyle}">
<Viewbox>
<Ellipse
Fill="#FF18D018"
Height="15"
Stroke="#FFFDFDFD"
StrokeThickness="0.5"
Width="15" />
</Viewbox>
</Button>
<Button
Click="CloseButton_OnClick"
Grid.Column="2"
Style="{StaticResource AppleButtonStyle}"
x:Name="closeButton">
<Viewbox>
<Ellipse
Fill="#FFEE7408"
Height="15"
Stroke="#FFFDFDFD"
StrokeThickness="0.5"
Width="15" />
</Viewbox>
</Button>
</Grid>
</Grid>
<Grid Grid.Row="1" Margin="20">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="80" />
</Grid.RowDefinitions>
<!-- display info -->
<StackPanel>
<!-- vivaldi info -->
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
<TextBlock
Foreground="PaleVioletRed"
HorizontalAlignment="Left"
Text="{Binding Source={x:Static properties:Resources.text_vivaldi_browser}}"
VerticalAlignment="Center"
Width="120" />
<TextBlock
Foreground="Green"
HorizontalAlignment="Left"
Margin="20,0,0,0"
Text="{Binding VivaldiLatestVersion}"
VerticalAlignment="Center" />
<TextBlock
Foreground="BlueViolet"
HorizontalAlignment="Left"
Margin="20,0,0,0"
Text="{Binding VivaldiUpdateNotifyText}"
VerticalAlignment="Center" />
</StackPanel>
<!-- vivaldi++ info -->
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
<TextBlock
Foreground="PaleVioletRed"
HorizontalAlignment="Left"
Margin="0,10,0,0"
Text="{Binding Source={x:Static properties:Resources.text_vivaldi_plus_plugin}}"
VerticalAlignment="Center"
Width="120" />
<TextBlock
Foreground="Green"
HorizontalAlignment="Left"
Margin="20,0,0,0"
Text="{Binding VivaldiPlusLatestVersion}"
VerticalAlignment="Center" />
<TextBlock
Foreground="BlueViolet"
HorizontalAlignment="Left"
Margin="20,0,0,0"
Text="{Binding VivaldiPlusUpdateNotifyText}"
VerticalAlignment="Center" />
</StackPanel>
</StackPanel>
<!-- Options -->
<StackPanel Grid.Row="1" Margin="0,10,0,0">
<!-- auto patch with vivaldi++ -->
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
<TextBlock
Foreground="PaleVioletRed"
HorizontalAlignment="Left"
Text="{Binding Source={x:Static properties:Resources.text_auto_update_vivaldi}}"
VerticalAlignment="Center"
Width="120" />
<ToggleButton
Height="35"
HorizontalAlignment="Left"
IsChecked="{Binding EnableVivaldiUpdate, Mode=TwoWay}"
Style="{StaticResource AppleToggleButtonStyle}"
VerticalAlignment="Center"
Width="100" />
</StackPanel>
<!-- auto patch with vivaldi++ -->
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
<TextBlock
Foreground="PaleVioletRed"
HorizontalAlignment="Left"
Text="{Binding Source={x:Static properties:Resources.text_enable_vivaldi_plus}}"
VerticalAlignment="Center"
Width="120" />
<ToggleButton
Height="35"
HorizontalAlignment="Left"
IsChecked="{Binding EnableVivaldiPlus, Mode=TwoWay}"
Style="{StaticResource AppleToggleButtonStyle}"
VerticalAlignment="Center"
Width="100" />
</StackPanel>
<!-- update vivaldi++ -->
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
<TextBlock
Foreground="PaleVioletRed"
HorizontalAlignment="Left"
Text="{Binding Source={x:Static properties:Resources.text_auto_update_vivaldi_plus}}"
VerticalAlignment="Center"
Width="120" />
<ToggleButton
Height="35"
HorizontalAlignment="Left"
IsChecked="{Binding EnableVivaldiPlusUpdate, Mode=TwoWay}"
Style="{StaticResource AppleToggleButtonStyle}"
VerticalAlignment="Center"
Width="100" />
</StackPanel>
</StackPanel>
<!-- update process -->
<StackPanel Grid.Row="2" Margin="0,10,0,0">
<ProgressBar
Height="20"
Maximum="100"
Style="{StaticResource MacOSProgressBarStyle}"
Value="{Binding DownloadProgress}"
Visibility="{Binding ShowUpdateProcessBar}"
Width="200" />
<TextBlock
Foreground="Sienna"
HorizontalAlignment="Center"
Text="{Binding ProcessBarNotifyText}" />
</StackPanel>
<Button
Content="{Binding Operation}"
Grid.Row="3"
Height="60"
HorizontalAlignment="Center"
Style="{StaticResource ApplePriButtonStyle}"
VerticalAlignment="Center"
Width="200"
Command="{Binding ApplyCommand}"
/>
</Grid>
</Grid>
</Border>
</Window>