-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMainWindow.xaml
More file actions
352 lines (332 loc) · 17.9 KB
/
MainWindow.xaml
File metadata and controls
352 lines (332 loc) · 17.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
352
<?xml version="1.0" encoding="utf-8"?>
<Window
x:Class="ShaderLab.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:ShaderLab"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Title="ShaderLab">
<Grid RequestedTheme="Dark">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="2*" />
</Grid.ColumnDefinitions>
<!-- Toolbar -->
<Grid Grid.Row="0" Grid.ColumnSpan="3"
Padding="8,6"
Background="{ThemeResource CardBackgroundFillColorSecondaryBrush}"
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
BorderThickness="0,0,0,1">
<StackPanel Orientation="Horizontal" Spacing="4">
<Button x:Name="SaveGraphButton" ToolTipService.ToolTip="Save Graph (Ctrl+S, Ctrl+Shift+S = Save As)">
<Button.KeyboardAccelerators>
<KeyboardAccelerator Modifiers="Control" Key="S" Invoked="OnSaveAccelerator" />
<KeyboardAccelerator Modifiers="Control,Shift" Key="S" Invoked="OnSaveAsAccelerator" />
</Button.KeyboardAccelerators>
<StackPanel Orientation="Horizontal" Spacing="6">
<FontIcon Glyph="" FontSize="14" />
<TextBlock Text="Save Graph" />
</StackPanel>
</Button>
<Button x:Name="LoadGraphButton" ToolTipService.ToolTip="Load Graph (Ctrl+O)">
<Button.KeyboardAccelerators>
<KeyboardAccelerator Modifiers="Control" Key="O" />
</Button.KeyboardAccelerators>
<StackPanel Orientation="Horizontal" Spacing="6">
<FontIcon Glyph="" FontSize="14" />
<TextBlock Text="Load Graph" />
</StackPanel>
</Button>
<AppBarSeparator />
<DropDownButton x:Name="AddNodeButton" ToolTipService.ToolTip="Add a new node to the graph">
<StackPanel Orientation="Horizontal" Spacing="6">
<FontIcon Glyph="" FontSize="14" />
<TextBlock Text="Add Node" />
</StackPanel>
<DropDownButton.Flyout>
<MenuFlyout x:Name="AddNodeFlyout" />
</DropDownButton.Flyout>
</DropDownButton>
<Button x:Name="AutoArrangeButton" ToolTipService.ToolTip="Auto-arrange graph layout (Ctrl+L)">
<StackPanel Orientation="Horizontal" Spacing="6">
<FontIcon Glyph="" FontSize="14" />
<TextBlock Text="Arrange" />
</StackPanel>
</Button>
<AppBarSeparator />
<Button x:Name="SaveImageButton" ToolTipService.ToolTip="Save preview as image">
<StackPanel Orientation="Horizontal" Spacing="6">
<FontIcon Glyph="" FontSize="14" />
<TextBlock Text="Save Image" />
</StackPanel>
</Button>
<AppBarSeparator />
<Button x:Name="EffectDesignerButton" ToolTipService.ToolTip="Open the HLSL Effect Designer">
<StackPanel Orientation="Horizontal" Spacing="6">
<FontIcon Glyph="" FontSize="14" />
<TextBlock Text="Effect Designer" />
</StackPanel>
</Button>
<Button x:Name="UpdateAllEffectsButton" Visibility="Collapsed"
ToolTipService.ToolTip="Update all outdated ShaderLab effects to latest version">
<StackPanel Orientation="Horizontal" Spacing="6">
<FontIcon Glyph="" FontSize="14" />
<TextBlock x:Name="UpdateAllEffectsText" Text="Update Effects" />
</StackPanel>
</Button>
<AppBarSeparator />
<ToggleButton x:Name="McpServerToggle" IsChecked="False"
ToolTipService.ToolTip="Start/stop MCP server for AI assistant integration">
<StackPanel Orientation="Horizontal" Spacing="6">
<FontIcon Glyph="" FontSize="14" />
<TextBlock x:Name="McpServerLabel" Text="MCP Server" />
<Ellipse x:Name="McpActivityDot"
Width="10" Height="10"
VerticalAlignment="Center"
StrokeThickness="1"
Visibility="Collapsed"
ToolTipService.ToolTip="MCP activity indicator">
<Ellipse.Fill>
<SolidColorBrush x:Name="McpActivityDotBrush" Color="#FF303030" />
</Ellipse.Fill>
<Ellipse.Stroke>
<SolidColorBrush Color="#80000000" />
</Ellipse.Stroke>
</Ellipse>
</StackPanel>
</ToggleButton>
<Button x:Name="McpExportConfigButton" Visibility="Collapsed"
ToolTipService.ToolTip="Copy MCP config to clipboard">
<StackPanel Orientation="Horizontal" Spacing="6">
<FontIcon Glyph="" FontSize="14" />
<TextBlock Text="Export MCP Config" />
</StackPanel>
</Button>
<AppBarSeparator />
<TextBlock Text="Working Space:"
VerticalAlignment="Center"
Margin="4,0,6,0"
Style="{StaticResource CaptionTextBlockStyle}" />
<ComboBox x:Name="DisplayProfileSelector"
MinWidth="180"
ToolTipService.ToolTip="Reference color space for the entire pipeline (affects all output windows)" />
</StackPanel>
</Grid>
<!-- Left: Node Graph Editor area -->
<Grid Grid.Row="1" Grid.Column="0"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
BorderThickness="0,0,1,0">
<Grid x:Name="NodeGraphContainer" Background="Transparent"
AllowDrop="True"
DragOver="OnNodeGraphDragOver"
Drop="OnNodeGraphDrop">
<SwapChainPanel x:Name="NodeGraphPanel" />
</Grid>
</Grid>
<!-- Column splitter (draggable) -->
<Border x:Name="ColumnSplitter" Grid.Row="1" Grid.Column="1"
Width="6"
Background="{ThemeResource CardStrokeColorDefaultBrush}"
PointerPressed="OnColumnSplitterPointerPressed"
PointerMoved="OnColumnSplitterPointerMoved"
PointerReleased="OnColumnSplitterPointerReleased" />
<!-- Right: Preview + property tabs -->
<Grid Grid.Row="1" Grid.Column="2">
<Grid.RowDefinitions>
<RowDefinition Height="2*" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" MinHeight="180" />
</Grid.RowDefinitions>
<!-- Viewport surface with overlay -->
<Grid Grid.Row="0">
<!-- Swap chain panel -->
<SwapChainPanel x:Name="PreviewPanel" />
<!-- Pixel trace crosshair overlay -->
<Canvas x:Name="CrosshairCanvas"
IsHitTestVisible="False" />
<!-- Node name overlay -->
<Border
HorizontalAlignment="Left"
VerticalAlignment="Top"
Margin="8,8,0,0"
Padding="6,2"
Background="#99000000"
CornerRadius="2"
Visibility="Collapsed"
x:Name="PreviewOverlayBorder">
<TextBlock x:Name="PreviewOverlayText"
FontSize="12"
Foreground="White" />
</Border>
</Grid>
<!-- Row divider -->
<Border Grid.Row="1"
Height="4"
Background="{ThemeResource CardStrokeColorDefaultBrush}" />
<!-- Tab control for properties/editor/inspector -->
<TabView x:Name="BottomTabView" Grid.Row="2"
IsAddTabButtonVisible="False"
TabWidthMode="SizeToContent">
<TabViewItem Header="Properties" IsClosable="False">
<ScrollViewer>
<StackPanel x:Name="PropertiesPanel" Padding="12" Spacing="8">
<TextBlock x:Name="PropertiesPlaceholder"
Text="Select a node to view its properties."
Foreground="{ThemeResource TextFillColorSecondaryBrush}" />
</StackPanel>
</ScrollViewer>
</TabViewItem>
<TabViewItem Header="Pixel Trace" IsClosable="False">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<!-- Trace toolbar -->
<Grid Grid.Row="0" Padding="8,4"
Background="{ThemeResource CardBackgroundFillColorSecondaryBrush}"
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
BorderThickness="0,0,0,1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock x:Name="TracePositionText"
Text="Click preview to trace a pixel"
VerticalAlignment="Center"
Style="{StaticResource CaptionTextBlockStyle}"
FontFamily="Cascadia Mono, Consolas, Courier New" />
<TextBlock Text="Unit:"
Grid.Column="2"
VerticalAlignment="Center"
Margin="8,0,6,0"
Style="{StaticResource CaptionTextBlockStyle}" />
<ComboBox x:Name="TraceUnitSelector" Grid.Column="3"
MinWidth="100">
<x:String>scRGB</x:String>
<x:String>sRGB</x:String>
<x:String>Nits</x:String>
<x:String>PQ</x:String>
</ComboBox>
</Grid>
<!-- Trace tree with HDR swatch strip -->
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="28" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<SwapChainPanel x:Name="TraceSwatchPanel" Grid.Column="0" />
<ScrollViewer Grid.Column="1" Padding="4">
<StackPanel x:Name="PixelTracePanel" Spacing="2" />
</ScrollViewer>
</Grid>
</Grid>
</TabViewItem>
</TabView>
</Grid>
<!-- Status bar -->
<Grid Grid.Row="2" Grid.ColumnSpan="3"
Padding="12,5"
Background="{ThemeResource CardBackgroundFillColorSecondaryBrush}"
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
BorderThickness="0,1,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<!-- Cache reaper broom (Phase 8 p8-status-bar-button). Click
runs both reapers (graph temps + shader bytecode cache)
and reports freed bytes in the adjacent text block. -->
<StackPanel Orientation="Horizontal" Grid.Column="0" Margin="0,0,12,0"
VerticalAlignment="Center">
<Button x:Name="ReaperBroomButton"
Click="OnReaperBroomClicked"
Padding="4,2" MinWidth="0" MinHeight="0"
Background="Transparent" BorderThickness="0"
ToolTipService.ToolTip="Sweep cached graph temporaries + shader bytecode (clears stale entries from %LOCALAPPDATA%)">
<FontIcon Glyph="" FontSize="13"
Foreground="{ThemeResource TextFillColorSecondaryBrush}" />
</Button>
<TextBlock x:Name="ReaperStatusText"
Text=""
Margin="6,0,0,0"
VerticalAlignment="Center"
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
Style="{StaticResource CaptionTextBlockStyle}" />
</StackPanel>
<StackPanel Orientation="Horizontal" Grid.Column="1" Margin="0,0,20,0">
<FontIcon Glyph="" FontSize="11" Margin="0,0,5,0"
Foreground="{ThemeResource TextFillColorSecondaryBrush}" />
<TextBlock x:Name="PipelineFormatText"
Text="Pipeline: scRGB FP16"
Style="{StaticResource CaptionTextBlockStyle}" />
</StackPanel>
<StackPanel Orientation="Horizontal" Grid.Column="2" Margin="0,0,20,0">
<FontIcon Glyph="" FontSize="11" Margin="0,0,5,0"
Foreground="{ThemeResource TextFillColorSecondaryBrush}" />
<TextBlock x:Name="DisplayModeText"
Text="Display: SDR"
Style="{StaticResource CaptionTextBlockStyle}" />
</StackPanel>
<StackPanel Orientation="Horizontal" Grid.Column="3" Margin="0,0,20,0">
<FontIcon Glyph="" FontSize="11" Margin="0,0,5,0"
Foreground="{ThemeResource TextFillColorSecondaryBrush}" />
<TextBlock x:Name="DisplayLuminanceText"
Text="Max Luminance: --"
Style="{StaticResource CaptionTextBlockStyle}" />
</StackPanel>
<StackPanel Orientation="Horizontal" Grid.Column="4" Margin="0,0,20,0"
Tapped="OnGpuInfoTapped" Background="Transparent"
ToolTipService.ToolTip="Click to change GPU adapter">
<FontIcon Glyph="" FontSize="11" Margin="0,0,5,0"
Foreground="{ThemeResource TextFillColorSecondaryBrush}" />
<TextBlock x:Name="GpuInfoText"
Text="GPU: --"
Style="{StaticResource CaptionTextBlockStyle}" />
</StackPanel>
<Button x:Name="FpsButton" Grid.Column="6"
Background="Transparent"
BorderThickness="0"
Padding="4,0,4,0"
MinWidth="0" MinHeight="0"
Foreground="{ThemeResource TextFillColorSecondaryBrush}">
<TextBlock x:Name="FpsText"
Text="FPS: --"
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
Style="{StaticResource CaptionTextBlockStyle}" />
<Button.Flyout>
<Flyout x:Name="FpsFlyout" ShowMode="Standard">
<TextBlock x:Name="FpsTooltipText"
FontFamily="Cascadia Mono, Consolas, Courier New"
FontSize="11"
Text="(no data yet)" />
</Flyout>
</Button.Flyout>
<ToolTipService.ToolTip>
<ToolTip>
<TextBlock Text="Click for per-phase frame timing breakdown" />
</ToolTip>
</ToolTipService.ToolTip>
</Button>
<TextBlock x:Name="AppVersionText" Grid.Column="7"
Visibility="Collapsed" />
</Grid>
</Grid>
</Window>