forked from miroiu/nodify
-
Notifications
You must be signed in to change notification settings - Fork 0
/
EditorSettingsView.xaml
399 lines (361 loc) · 20.9 KB
/
EditorSettingsView.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
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
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
<UserControl x:Class="Nodify.Playground.EditorSettingsView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Nodify.Playground"
xmlns:shared="clr-namespace:Nodify;assembly=Nodify.Shared"
d:Foreground="{DynamicResource ForegroundBrush}"
d:Background="{DynamicResource PanelBackgroundBrush}"
mc:Ignorable="d">
<Border BorderThickness="1"
Padding="10"
HorizontalAlignment="Stretch">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"
SharedSizeGroup="PropertyName" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock Text="Realtime selection: "
ToolTip="Selects items when finished if disabled."
Margin="0 0 5 0" />
<CheckBox Grid.Column="1"
Margin="0 0 5 0"
IsChecked="{Binding EnableRealtimeSelection, Source={x:Static local:EditorSettings.Instance}}" />
<TextBlock Grid.Row="1"
Text="Pending connection snapping: "
ToolTip="Whether to snap the pending connection to connectors"
Margin="0 5 5 0" />
<CheckBox Grid.Row="1"
Grid.Column="1"
IsChecked="{Binding EnablePendingConnectionSnapping, Source={x:Static local:EditorSettings.Instance}}"
Margin="0 5 5 0" />
<TextBlock Grid.Row="2"
Text="Pending connection preview: "
ToolTip="Show information about the pending connection."
Margin="0 5 5 0" />
<CheckBox Grid.Row="2"
Grid.Column="1"
IsChecked="{Binding EnablePendingConnectionPreview, Source={x:Static local:EditorSettings.Instance}}"
Margin="0 5 5 0" />
<TextBlock Grid.Row="3"
Text="Disable drop connection on node: "
ToolTip="Can connect directly to nodes if enabled"
Margin="0 5 5 0" />
<CheckBox Grid.Row="3"
Grid.Column="1"
IsChecked="{Binding AllowConnectingToConnectorsOnly, Source={x:Static local:EditorSettings.Instance}}"
Margin="0 5 5 0" />
<TextBlock Grid.Row="4"
Text="Disable auto panning: "
Margin="0 5 5 0" />
<CheckBox Grid.Row="4"
Grid.Column="1"
IsChecked="{Binding DisableAutoPanning, Source={x:Static local:EditorSettings.Instance}}"
Margin="0 5 5 0" />
<TextBlock Grid.Row="5"
Text="Disable panning: "
Margin="0 5 5 0" />
<CheckBox Grid.Row="5"
Grid.Column="1"
IsChecked="{Binding DisablePanning, Source={x:Static local:EditorSettings.Instance}}"
Margin="0 5 5 0" />
<TextBlock Grid.Row="6"
Text="Disable zooming: "
Margin="0 5 5 0" />
<CheckBox Grid.Row="6"
Grid.Column="1"
IsChecked="{Binding DisableZooming, Source={x:Static local:EditorSettings.Instance}}"
Margin="0 5 5 0" />
<TextBlock Grid.Row="7"
Text="Grid spacing: "
ToolTip="Snapping value in pixels"
Margin="0 5 5 0" />
<TextBox Grid.Row="7"
Grid.Column="1"
Text="{Binding GridSpacing, Mode=TwoWay, Source={x:Static local:EditorSettings.Instance}}"
Margin="0 5 5 0" />
<TextBlock Grid.Row="8"
Text="Location: "
ToolTip="The viewport's Offset."
Margin="0 5 5 0" />
<local:PointEditorView Grid.Row="8"
Grid.Column="1"
DataContext="{Binding Location, Mode=TwoWay, Source={x:Static local:EditorSettings.Instance}}"
Margin="0 5 5 0" />
<TextBlock Grid.Row="9"
Text="Zoom: "
ToolTip="The viewport's scale. Not accurate when trying to zoom outside the MinScale and MaxScale because of dependency property coercion not updating the binding with the final result."
Margin="0 5 5 0" />
<TextBox Grid.Row="9"
Grid.Column="1"
Text="{Binding Zoom, Mode=TwoWay, Source={x:Static local:EditorSettings.Instance}}"
Margin="0 5 5 0" />
<TextBlock Grid.Row="10"
Text="Min zoom: "
Margin="0 5 5 0" />
<TextBox Grid.Row="10"
Grid.Column="1"
Text="{Binding MinZoom, Mode=TwoWay, Source={x:Static local:EditorSettings.Instance}}"
Margin="0 5 5 0" />
<TextBlock Grid.Row="11"
Text="Max zoom: "
Margin="0 5 5 0" />
<TextBox Grid.Row="11"
Grid.Column="1"
Text="{Binding MaxZoom, Mode=TwoWay, Source={x:Static local:EditorSettings.Instance}}"
Margin="0 5 5 0" />
<TextBlock Grid.Row="12"
Text="Auto panning speed: "
ToolTip="Speed value in pixels per tick"
Margin="0 5 5 0" />
<TextBox Grid.Row="12"
Grid.Column="1"
Text="{Binding AutoPanningSpeed, Mode=TwoWay, Source={x:Static local:EditorSettings.Instance}}"
Margin="0 5 5 0" />
<TextBlock Grid.Row="13"
Text="Auto panning edge distance: "
ToolTip="Distance from edge to trigger auto panning"
Margin="0 5 5 0" />
<TextBox Grid.Row="13"
Grid.Column="1"
Text="{Binding AutoPanningEdgeDistance, Mode=TwoWay, Source={x:Static local:EditorSettings.Instance}}"
Margin="0 5 5 0" />
<TextBlock Grid.Row="14"
Text="Connection style: "
Margin="0 5 5 0" />
<ComboBox Grid.Row="14"
Grid.Column="1"
DisplayMemberPath="Name"
SelectedValuePath="Value"
SelectedValue="{Binding ConnectionStyle, Mode=TwoWay, Source={x:Static local:EditorSettings.Instance}}"
ItemsSource="{Binding ConnectionStyle, Converter={shared:EnumValuesConverter}, Source={x:Static local:EditorSettings.Instance}}"
Margin="0 5 5 0" />
<TextBlock Grid.Row="15"
Text="Connection angle: "
ToolTip="Applies to circuit connection style"
Margin="0 5 5 0" />
<TextBox Grid.Row="15"
Grid.Column="1"
Text="{Binding CircuitConnectionAngle, Mode=TwoWay, Source={x:Static local:EditorSettings.Instance}}"
Margin="0 5 5 0" />
<TextBlock Grid.Row="16"
Text="Connection spacing: "
ToolTip="Applies to circuit connection style"
Margin="0 5 5 0" />
<TextBox Grid.Row="16"
Grid.Column="1"
Text="{Binding CircuitConnectionSpacing, Mode=TwoWay, Source={x:Static local:EditorSettings.Instance}}"
Margin="0 5 5 0" />
<TextBlock Grid.Row="17"
Text="Connection arrow size: "
ToolTip="Applies to circuit and directional connection style"
Margin="0 5 5 0" />
<local:PointEditorView Grid.Row="17"
Grid.Column="1"
DataContext="{Binding ConnectionArrowSize, Mode=TwoWay, Source={x:Static local:EditorSettings.Instance}}"
Margin="0 5 5 0" />
<TextBlock Grid.Row="18"
Text="Connection offset mode: "
Margin="0 5 5 0" />
<ComboBox Grid.Row="18"
Grid.Column="1"
DisplayMemberPath="Name"
SelectedValuePath="Value"
SelectedValue="{Binding ConnectionOffsetMode, Mode=TwoWay, Source={x:Static local:EditorSettings.Instance}}"
ItemsSource="{Binding ConnectionOffsetMode, Converter={shared:EnumValuesConverter}, Source={x:Static local:EditorSettings.Instance}}"
Margin="0 5 5 0" />
<TextBlock Grid.Row="19"
Text="Connection source offset: "
Margin="0 5 5 0" />
<local:PointEditorView Grid.Row="19"
Grid.Column="1"
DataContext="{Binding ConnectionSourceOffset, Mode=TwoWay, Source={x:Static local:EditorSettings.Instance}}"
Margin="0 5 5 0" />
<TextBlock Grid.Row="20"
Text="Connection target offset: "
Margin="0 5 5 0" />
<local:PointEditorView Grid.Row="20"
Grid.Column="1"
DataContext="{Binding ConnectionTargetOffset, Mode=TwoWay, Source={x:Static local:EditorSettings.Instance}}"
Margin="0 5 5 0" />
<TextBlock Grid.Row="21"
Text="Display connections on top: "
Margin="0 5 5 0" />
<CheckBox Grid.Row="21"
Grid.Column="1"
IsChecked="{Binding DisplayConnectionsOnTop, Source={x:Static local:EditorSettings.Instance}}"
Margin="0 5 5 0" />
<TextBlock Grid.Row="22"
Text="Bring into view duration: "
ToolTip="Bring location into view animation duration"
Margin="0 5 5 0" />
<TextBox Grid.Row="22"
Grid.Column="1"
Text="{Binding BringIntoViewAnimationDuration, Mode=TwoWay, Source={x:Static local:EditorSettings.Instance}}"
Margin="0 5 5 0" />
<Expander Grid.Row="23"
Grid.ColumnSpan="2"
Header="Advanced"
Padding="0 5 0 0"
BorderThickness="0 0 0 1"
IsExpanded="True"
BorderBrush="{DynamicResource BackgroundBrush}">
<Expander.Style>
<Style TargetType="{x:Type Expander}"
BasedOn="{StaticResource {x:Type Expander}}">
<Setter Property="Tag"
Value="{StaticResource ExpandRightIcon}" />
<Style.Triggers>
<Trigger Property="IsExpanded"
Value="True">
<Setter Property="Tag"
Value="{StaticResource ExpandDownIcon}" />
</Trigger>
</Style.Triggers>
</Style>
</Expander.Style>
<Border BorderThickness="1"
HorizontalAlignment="Stretch">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"
SharedSizeGroup="PropertyName" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock Text="Disable context menu after panning: "
ToolTip="Disable after mouse moved this far"
Margin="0 0 5 0" />
<TextBox Grid.Column="1"
Text="{Binding HandleRightClickAfterPanningThreshold, Mode=TwoWay, Source={x:Static local:EditorSettings.Instance}}"
Margin="0 0 5 0" />
<TextBlock Grid.Row="1"
Text="Auto panning tick rate: "
ToolTip="How often is the new position calculated in milliseconds. Disable and enable auto panning for this to have effect."
Margin="0 5 5 0" />
<TextBox Grid.Row="1"
Grid.Column="1"
Text="{Binding AutoPanningTickRate, Mode=TwoWay, Source={x:Static local:EditorSettings.Instance}}"
Margin="0 5 5 0" />
<TextBlock Grid.Row="2"
Text="Allow dragging cancellation: "
ToolTip="Right click to cancel dragging."
Margin="0 5 5 0" />
<CheckBox Grid.Row="2"
Grid.Column="1"
IsChecked="{Binding AllowDraggingCancellation, Mode=TwoWay, Source={x:Static local:EditorSettings.Instance}}"
Margin="0 5 5 0" />
<TextBlock Grid.Row="3"
Text="Allow pending connection cancellation: "
ToolTip="Right click to cancel pending connection."
Margin="0 5 5 0" />
<CheckBox Grid.Row="3"
Grid.Column="1"
IsChecked="{Binding AllowPendingConnectionCancellation, Mode=TwoWay, Source={x:Static local:EditorSettings.Instance}}"
Margin="0 5 5 0" />
<TextBlock Grid.Row="4"
Text="Enable snapping correction: "
ToolTip="Correct the final position when moving a selection"
Margin="0 5 5 0" />
<CheckBox Grid.Row="4"
Grid.Column="1"
IsChecked="{Binding EnableSnappingCorrection, Mode=TwoWay, Source={x:Static local:EditorSettings.Instance}}"
Margin="0 5 5 0" />
<Separator Grid.Row="5"
Grid.ColumnSpan="2"
Width="Auto" />
<TextBlock Grid.Row="6"
Text="Enable connector optimizations: "
ToolTip="Enables optimizations for connectors based on viewport distance and minimum selected nodes."
Margin="0 5 5 0" />
<CheckBox Grid.Row="6"
Grid.Column="1"
IsChecked="{Binding EnableConnectorOptimizations, Mode=TwoWay, Source={x:Static local:EditorSettings.Instance}}"
Margin="0 5 5 0" />
<TextBlock Grid.Row="7"
Text="Optimize connectors safe zone: "
ToolTip="The minimum distance from the viewport where connectors will start optimizing"
Margin="0 5 5 0" />
<TextBox Grid.Row="7"
Grid.Column="1"
Text="{Binding OptimizeSafeZone, Mode=TwoWay, Source={x:Static local:EditorSettings.Instance}}"
Margin="0 5 5 0" />
<TextBlock Grid.Row="8"
Text="Optimize connectors minimum selection: "
ToolTip="The minimum selected items needed to start optimizing when outside the safe zone."
Margin="0 5 5 0" />
<TextBox Grid.Row="8"
Grid.Column="1"
Text="{Binding OptimizeMinimumSelectedItems, Mode=TwoWay, Source={x:Static local:EditorSettings.Instance}}"
Margin="0 5 5 0" />
<TextBlock Grid.Row="9"
Text="Enable nodes rendering optimization: "
ToolTip="Enables rendering optimizations for nodes based on zoom out percent and nodes count. (zoom in/out to apply optimization)"
Margin="0 5 5 0" />
<CheckBox Grid.Row="9"
Grid.Column="1"
IsChecked="{Binding EnableRenderingOptimizations, Mode=TwoWay, Source={x:Static local:EditorSettings.Instance}}"
Margin="0 5 5 0" />
<TextBlock Grid.Row="10"
Text="Rendering optimization zoom out percent: "
ToolTip="The zoom out percent that triggers the optimization. (percent of x = 1 - MinScale)"
Margin="0 5 5 0" />
<TextBox Grid.Row="10"
Grid.Column="1"
Text="{Binding OptimizeRenderingZoomOutPercent, Mode=TwoWay, Source={x:Static local:EditorSettings.Instance}}"
Margin="0 5 5 0" />
<TextBlock Grid.Row="11"
Text="Rendering optimization minimum nodes: "
ToolTip="The minimum nodes needed to start optimizing when zoom out percent is met."
Margin="0 5 5 0" />
<TextBox Grid.Row="11"
Grid.Column="1"
Text="{Binding OptimizeRenderingMinimumNodes, Mode=TwoWay, Source={x:Static local:EditorSettings.Instance}}"
Margin="0 5 5 0" />
</Grid>
</Border>
</Expander>
</Grid>
</Border>
</UserControl>