-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainWindow.xaml
More file actions
351 lines (322 loc) · 20.9 KB
/
Copy pathMainWindow.xaml
File metadata and controls
351 lines (322 loc) · 20.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
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
<Window x:Class="MiniMacro.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:MiniMacro"
mc:Ignorable="d"
Title="Mini Macro"
Loaded="Window_Loaded"
Height="480" Width="680"
MinHeight="480" MinWidth="680"
WindowStyle="None"
ResizeMode="NoResize"
AllowsTransparency="False"
Background="{DynamicResource BgBrush}"
WindowStartupLocation="CenterScreen"
Icon="logo.ico">
<!-- Внешняя рамка окна (1px бордер вместо системного chrome) -->
<Border BorderBrush="{DynamicResource AppBorderBrush}" BorderThickness="1">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="32"/> <!-- Заголовок -->
<RowDefinition Height="*"/> <!-- Контент -->
</Grid.RowDefinitions>
<!-- ══════════════════════════════════════════════
ЗАГОЛОВОК ОКНА
══════════════════════════════════════════════ -->
<Grid Grid.Row="0"
Background="{DynamicResource SidebarBrush}"
MouseLeftButtonDown="TitleBar_MouseLeftButtonDown">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<!-- Иконка + название -->
<StackPanel Grid.Column="0" Orientation="Horizontal"
VerticalAlignment="Center" Margin="12,0,0,0">
<Image Source="logo.ico" Width="16" Height="16" Margin="0,0,8,0"
RenderOptions.BitmapScalingMode="HighQuality"/>
<TextBlock Text="Mini Macro"
Foreground="{DynamicResource TextPrimaryBrush}"
FontFamily="Segoe UI" FontSize="12" FontWeight="Medium"
VerticalAlignment="Center"/>
</StackPanel>
<!-- Кнопки управления окном -->
<StackPanel Grid.Column="1" Orientation="Horizontal">
<Button Style="{StaticResource TitleBarButtonStyle}"
Click="Minimize_Click" ToolTip="Свернуть">
<!-- Иконка: горизонтальная черта -->
<Path Data="M 5,8 L 11,8"
Stroke="{DynamicResource TextSecondaryBrush}"
StrokeThickness="1.5"
StrokeStartLineCap="Round" StrokeEndLineCap="Round"/>
</Button>
<Button Style="{StaticResource CloseButtonStyle}"
Click="Close_Click" ToolTip="Закрыть">
<!-- Иконка: крестик -->
<Path Data="M 4.5,4.5 L 11.5,11.5 M 11.5,4.5 L 4.5,11.5"
Stroke="{DynamicResource TextSecondaryBrush}"
StrokeThickness="1.5"
StrokeStartLineCap="Round" StrokeEndLineCap="Round"/>
</Button>
</StackPanel>
</Grid>
<!-- ══════════════════════════════════════════════
ОСНОВНОЙ КОНТЕНТ
══════════════════════════════════════════════ -->
<Grid x:Name="ContentArea" Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="180"/> <!-- Сайдбар -->
<ColumnDefinition Width="1"/> <!-- Разделитель -->
<ColumnDefinition Width="*"/> <!-- Рабочая область -->
</Grid.ColumnDefinitions>
<!-- ────────────────────────────────────────
САЙДБАР
──────────────────────────────────────── -->
<Grid Grid.Column="0" Background="{DynamicResource SidebarBrush}">
<Grid.RowDefinitions>
<RowDefinition Height="*"/> <!-- Навигация -->
<RowDefinition Height="Auto"/> <!-- Футер -->
</Grid.RowDefinitions>
<!-- Навигация -->
<StackPanel Grid.Row="0" Margin="0,12,0,0">
<!-- Библиотека -->
<Button Style="{StaticResource NavButtonStyle}"
Click="Library_Click"
ToolTip="Библиотека макросов">
<StackPanel Orientation="Horizontal">
<Viewbox Width="16" Height="16" Margin="0,0,10,0">
<!-- Иконка: три горизонтальные линии (список) -->
<Path Data="M 1,4 L 15,4 M 1,8 L 15,8 M 1,12 L 15,12"
Stroke="{Binding Foreground,
RelativeSource={RelativeSource AncestorType=Button}}"
StrokeThickness="1.6"
StrokeStartLineCap="Round"
StrokeEndLineCap="Round"/>
</Viewbox>
<TextBlock Text="Библиотека"
FontFamily="Segoe UI" FontSize="13"
Foreground="{Binding Foreground,
RelativeSource={RelativeSource AncestorType=Button}}"
VerticalAlignment="Center"/>
</StackPanel>
</Button>
<!-- Настройки -->
<Button Style="{StaticResource NavButtonStyle}"
Margin="0,2,0,0"
Click="Settings_Click"
ToolTip="Настройки">
<StackPanel Orientation="Horizontal">
<Viewbox Width="16" Height="16" Margin="0,0,10,0">
<!-- Иконка: ползунки (settings / sliders) -->
<Path Data="M 1,4 L 5,4 M 9,4 L 15,4
M 1,12 L 7,12 M 11,12 L 15,12
M 7,2.5 L 7,5.5
M 9,10.5 L 9,13.5"
Stroke="{Binding Foreground,
RelativeSource={RelativeSource AncestorType=Button}}"
StrokeThickness="1.6"
StrokeStartLineCap="Round"
StrokeEndLineCap="Round"/>
</Viewbox>
<TextBlock Text="Настройки"
FontFamily="Segoe UI" FontSize="13"
Foreground="{Binding Foreground,
RelativeSource={RelativeSource AncestorType=Button}}"
VerticalAlignment="Center"/>
</StackPanel>
</Button>
</StackPanel>
<!-- Футер сайдбара -->
<StackPanel Grid.Row="1" Margin="0,0,0,12">
<!-- Параметры воспроизведения -->
<Rectangle Height="1"
Fill="{DynamicResource DividerBrush}"
Margin="12,0,12,10"/>
<DockPanel Margin="16,0,16,2">
<TextBlock Text="ПОВТОРЫ"
Foreground="{DynamicResource TextSecondaryBrush}"
FontFamily="Segoe UI" FontSize="10" FontWeight="SemiBold"
VerticalAlignment="Center" DockPanel.Dock="Left"/>
<TextBlock x:Name="SideRepeatText"
Foreground="{DynamicResource TextSecondaryBrush}"
FontFamily="Segoe UI" FontSize="10"
HorizontalAlignment="Right"/>
</DockPanel>
<Slider x:Name="SideRepeatSlider"
Style="{StaticResource SliderStyle}"
Minimum="1" Maximum="50" SmallChange="1" LargeChange="5"
IsSnapToTickEnabled="True" TickFrequency="1"
Margin="12,2,12,8"
ValueChanged="SideRepeat_ValueChanged"/>
<DockPanel Margin="16,0,16,2">
<TextBlock Text="СКОРОСТЬ"
Foreground="{DynamicResource TextSecondaryBrush}"
FontFamily="Segoe UI" FontSize="10" FontWeight="SemiBold"
VerticalAlignment="Center" DockPanel.Dock="Left"/>
<TextBlock x:Name="SideSpeedText"
Foreground="{DynamicResource TextSecondaryBrush}"
FontFamily="Segoe UI" FontSize="10"
HorizontalAlignment="Right"/>
</DockPanel>
<Slider x:Name="SideSpeedSlider"
Style="{StaticResource SliderStyle}"
Minimum="0.5" Maximum="5.0" SmallChange="0.1" LargeChange="0.5"
Margin="12,2,12,10"
ValueChanged="SideSpeed_ValueChanged"/>
<!-- Статус обновления (показывается только при отсутствии сети) -->
<TextBlock x:Name="UpdateStatusText"
Foreground="{DynamicResource TextSecondaryBrush}"
FontFamily="Segoe UI" FontSize="10"
TextWrapping="Wrap"
Margin="16,0,16,8"
Visibility="Collapsed"/>
<Rectangle Height="1"
Fill="{DynamicResource DividerBrush}"
Margin="12,0,12,12"/>
<TextBlock x:Name="VersionText"
Foreground="{DynamicResource TextSecondaryBrush}"
FontFamily="Segoe UI" FontSize="11"
Margin="20,0,0,2"/>
<TextBlock x:Name="AuthorText"
Foreground="{DynamicResource TextSecondaryBrush}"
FontFamily="Segoe UI" FontSize="11"
Margin="20,0,0,8"/>
</StackPanel>
</Grid>
<!-- Вертикальный разделитель -->
<Rectangle Grid.Column="1" Fill="{DynamicResource DividerBrush}"/>
<!-- ────────────────────────────────────────
РАБОЧАЯ ОБЛАСТЬ
──────────────────────────────────────── -->
<Grid Grid.Column="2">
<Grid.RowDefinitions>
<RowDefinition Height="*"/> <!-- Центр: макрос + транспорт -->
<RowDefinition Height="Auto"/> <!-- Нижняя панель: Save / Load -->
</Grid.RowDefinitions>
<!-- Центральная зона -->
<StackPanel Grid.Row="0"
VerticalAlignment="Center"
HorizontalAlignment="Center">
<!-- Текущий макрос -->
<StackPanel HorizontalAlignment="Center" Margin="0,0,0,44">
<TextBlock Text="ТЕКУЩИЙ МАКРОС"
Foreground="{DynamicResource TextSecondaryBrush}"
FontFamily="Segoe UI" FontSize="10"
FontWeight="SemiBold"
HorizontalAlignment="Center"
Margin="0,0,0,7"/>
<TextBlock x:Name="MacroNameText"
Text="— не выбран —"
Foreground="{DynamicResource TextPrimaryBrush}"
FontFamily="Segoe UI" FontSize="20"
FontWeight="Light"
HorizontalAlignment="Center"/>
</StackPanel>
<!-- Статус -->
<TextBlock x:Name="StatusText"
Foreground="{DynamicResource AccentBrush}"
FontFamily="Segoe UI" FontSize="12"
HorizontalAlignment="Center"
Margin="0,0,0,14"
Visibility="Collapsed"/>
<!-- Транспортные кнопки: Запись, Воспроизведение, Пауза, Остановка -->
<StackPanel Orientation="Horizontal"
HorizontalAlignment="Center">
<!-- Запись (круг встроен в шаблон стиля) -->
<Button x:Name="RecordButton"
Style="{StaticResource RecordButtonStyle}"
Margin="0,0,14,0" ToolTip="Начать запись"
Click="Record_Click"/>
<!-- Воспроизведение -->
<Button x:Name="PlayButton"
Style="{StaticResource TransportButtonStyle}"
Margin="0,0,6,0" ToolTip="Воспроизвести"
Click="Play_Click">
<!-- Треугольник (play) -->
<Path Data="M 5,3 L 14,8 L 5,13 Z"
Fill="{DynamicResource AccentBrush}"/>
</Button>
<!-- Пауза -->
<Button x:Name="PauseButton"
Style="{StaticResource TransportButtonStyle}"
Margin="0,0,6,0" ToolTip="Пауза"
Click="Pause_Click">
<!-- Две вертикальные полосы -->
<Path Data="M 4,3 L 7,3 L 7,13 L 4,13 Z
M 9,3 L 12,3 L 12,13 L 9,13 Z"
Fill="{DynamicResource TextPrimaryBrush}"/>
</Button>
<!-- Стоп -->
<Button x:Name="StopButton"
Style="{StaticResource TransportButtonStyle}"
ToolTip="Остановить"
Click="Stop_Click">
<!-- Квадрат (stop) -->
<Rectangle Width="13" Height="13"
Fill="{DynamicResource TextPrimaryBrush}"/>
</Button>
</StackPanel>
</StackPanel>
<!-- Нижняя панель -->
<Border Grid.Row="1"
BorderBrush="{DynamicResource DividerBrush}"
BorderThickness="0,1,0,0"
Padding="20,14">
<StackPanel Orientation="Horizontal"
HorizontalAlignment="Right">
<!-- Загрузить -->
<Button x:Name="LoadButton"
Style="{StaticResource ActionButtonStyle}"
Margin="0,0,8,0"
ToolTip="Загрузить макрос из файла"
Click="Load_Click">
<StackPanel Orientation="Horizontal">
<Viewbox Width="14" Height="14" Margin="0,0,7,0">
<!-- Иконка: стрелка вверх (открыть) -->
<Path Data="M 8,11 L 8,2 M 4,6 L 8,2 L 12,6
M 2,13 L 14,13"
Stroke="{DynamicResource TextPrimaryBrush}"
StrokeThickness="1.5"
StrokeLineJoin="Round"
StrokeStartLineCap="Round"
StrokeEndLineCap="Round"
Fill="Transparent"/>
</Viewbox>
<TextBlock Text="Загрузить"
Foreground="{DynamicResource TextPrimaryBrush}"
FontFamily="Segoe UI" FontSize="12"
VerticalAlignment="Center"/>
</StackPanel>
</Button>
<!-- Сохранить (акцент) -->
<Button x:Name="SaveButton"
Style="{StaticResource ActionButtonAccentStyle}"
ToolTip="Сохранить макрос в файл"
Click="Save_Click">
<StackPanel Orientation="Horizontal">
<Viewbox Width="14" Height="14" Margin="0,0,7,0">
<!-- Иконка: стрелка вниз (сохранить) -->
<Path Data="M 8,2 L 8,11 M 4,7 L 8,11 L 12,7
M 2,13 L 14,13"
Stroke="#141414"
StrokeThickness="1.5"
StrokeLineJoin="Round"
StrokeStartLineCap="Round"
StrokeEndLineCap="Round"
Fill="Transparent"/>
</Viewbox>
<TextBlock Text="Сохранить"
Foreground="#141414"
FontFamily="Segoe UI" FontSize="12"
VerticalAlignment="Center"/>
</StackPanel>
</Button>
</StackPanel>
</Border>
</Grid>
</Grid>
</Grid>
</Border>
</Window>