Interactive 2D wave optics simulator. Turn any image into a refractive scene, add sources, watch waves refract, diffract and interfere. Probes, intensity maps, video export.
C#
Properties pane: group headers with a rule, the first group close to the edge
Alexander Graefb142e35b9e1b
diff --git a/CLAUDE.md b/CLAUDE.mdindex 45e6b0b..a3fc8d2 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -32,6 +32,11 @@ WPF shell as it stands:`MainWindow.DefaultLayout()` (agreed 2026-10-09): a left column of a quarter of the width with theProject tree in its upper third and Properties below, the preview in the rest, Messages hidden;the preview starts stacked (`PreviewOrientation` default Vertical). No third-party packages but NLog.+- Properties pane groups: a section header is a `Label` in the `FormSection` style, the name over a rule+ across the width (2026-10-15, after the Display view's Field and Intensity groups were read as one list);+ the preview's picture labels keep the plain look as `PictureLabel`. The gap between groups is the+ `FormPanel`'s bottom margin (an implicit style), not the header's top margin, so the first header sits+ close to the pane's edge.- Theming: own `Themes/Dark.xaml` / `Light.xaml` dictionaries swapped by `Theming/ThemeController`(persisted in settings); the native title bar is darkened via DWM. Use `DynamicResource` for everytheme brush.diff --git a/WaveDude.WPF/Panes/PreviewPane.xaml b/WaveDude.WPF/Panes/PreviewPane.xamlindex e4ef664..b522d86 100644--- a/WaveDude.WPF/Panes/PreviewPane.xaml+++ b/WaveDude.WPF/Panes/PreviewPane.xaml@@ -405,7 +405,7 @@<ControlTemplate TargetType="{x:Type HeaderedContentControl}"><!-- the label goes above the picture, or rotated to its left when the cell is wider than the picture --><controls:PictureFrame>- <TextBlock Style="{StaticResource FormSection}" Text="{TemplateBinding Header}" />+ <TextBlock Style="{StaticResource PictureLabel}" Text="{TemplateBinding Header}" /><!-- the picture with the source/probe handles over it; both fill the same rectangle --><Grid><Image Source="{TemplateBinding Content}" Stretch="Uniform" AutomationProperties.AutomationId="{TemplateBinding Tag}" />diff --git a/WaveDude.WPF/Themes/Editors.xaml b/WaveDude.WPF/Themes/Editors.xamlindex ee1300d..6155b60 100644--- a/WaveDude.WPF/Themes/Editors.xaml+++ b/WaveDude.WPF/Themes/Editors.xaml@@ -350,7 +350,24 @@</Style><!-- property forms -->- <Style x:Key="FormSection" TargetType="{x:Type TextBlock}">+ <!-- a group header in the Properties pane: the name over a rule across the width, so the groups read apart+ (2026-10-15, after the Field and Intensity groups of the Display view were taken for one list) -->+ <Style x:Key="FormSection" TargetType="{x:Type Label}">+ <Setter Property="FontWeight" Value="SemiBold" />+ <Setter Property="Foreground" Value="{DynamicResource WindowForeground}" />+ <Setter Property="BorderBrush" Value="{DynamicResource ControlBorder}" />+ <Setter Property="BorderThickness" Value="0,0,0,1" />+ <Setter Property="Padding" Value="0,0,0,2" />+ <Setter Property="Margin" Value="0,2,0,6" />+ <Setter Property="HorizontalContentAlignment" Value="Left" />+ </Style>+ <!-- the gap between groups comes after a group's rows, not before its header, so the first header sits close to+ the pane's edge (2026-10-15, it hung 18 px below it) -->+ <Style TargetType="{x:Type controls:FormPanel}">+ <Setter Property="Margin" Value="0,0,0,10" />+ </Style>+ <!-- the label of a preview picture (above it, or rotated beside it): the old plain section look -->+ <Style x:Key="PictureLabel" TargetType="{x:Type TextBlock}"><Setter Property="FontWeight" Value="SemiBold" /><Setter Property="Foreground" Value="{DynamicResource WindowForeground}" /><Setter Property="Margin" Value="0,10,0,4" />diff --git a/WaveDude.WPF/Views/CollectionView.xaml b/WaveDude.WPF/Views/CollectionView.xamlindex 1ec6c78..f90f6bb 100644--- a/WaveDude.WPF/Views/CollectionView.xaml+++ b/WaveDude.WPF/Views/CollectionView.xaml@@ -4,7 +4,7 @@<!-- a folder node (Sources, Probes): just the name and the count for now --><StackPanel Margin="8">- <TextBlock Style="{StaticResource FormSection}" Text="{Binding Label}" Margin="0,2,0,4" />+ <Label Style="{StaticResource FormSection}" Content="{Binding Label}" Margin="0,2,0,4" /><TextBlock Style="{StaticResource FormValue}" Margin="0"Text="{Binding Items.Count, StringFormat={StaticResource ItemCountFormat}}" /></StackPanel>diff --git a/WaveDude.WPF/Views/ColorSchemeView.xaml b/WaveDude.WPF/Views/ColorSchemeView.xamlindex 3aafa34..b8cb897 100644--- a/WaveDude.WPF/Views/ColorSchemeView.xaml+++ b/WaveDude.WPF/Views/ColorSchemeView.xaml@@ -55,7 +55,7 @@<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled"><StackPanel Margin="8">- <TextBlock Style="{StaticResource FormSection}" Text="{DynamicResource SectionGeneral}" />+ <Label Style="{StaticResource FormSection}" Content="{DynamicResource SectionGeneral}" /><controls:FormPanel><TextBlock Style="{StaticResource FormLabel}" Text="{meta:Label rendering:ColorScheme.Name}" /><TextBox Text="{Binding Name, UpdateSourceTrigger=PropertyChanged}" ToolTip="{meta:Hint rendering:ColorScheme.Name}" />@@ -72,7 +72,7 @@ToolTip="{meta:Hint rendering:ColorScheme.Description}" /></controls:FormPanel>- <TextBlock Style="{StaticResource FormSection}" Text="{DynamicResource SectionStops}" />+ <Label Style="{StaticResource FormSection}" Content="{DynamicResource SectionStops}" /><!-- start from any existing scheme: picking one copies its stops, kind, category and description into this one --><controls:FormPanel><TextBlock Style="{StaticResource FormLabel}" Text="{DynamicResource LabelBasedOn}" />diff --git a/WaveDude.WPF/Views/DisplayView.xaml b/WaveDude.WPF/Views/DisplayView.xamlindex 01d042b..af61594 100644--- a/WaveDude.WPF/Views/DisplayView.xaml+++ b/WaveDude.WPF/Views/DisplayView.xaml@@ -8,13 +8,13 @@<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled"><StackPanel Margin="8">- <TextBlock Style="{StaticResource FormSection}" Text="{DynamicResource SectionField}" />+ <Label Style="{StaticResource FormSection}" Content="{DynamicResource SectionField}" /><local:DisplayLayerView DataContext="{Binding Field}" Kind="Field" />- <TextBlock Style="{StaticResource FormSection}" Text="{DynamicResource SectionIntensity}" />+ <Label Style="{StaticResource FormSection}" Content="{DynamicResource SectionIntensity}" /><local:DisplayLayerView DataContext="{Binding Intensity}" Kind="Intensity" />- <TextBlock Style="{StaticResource FormSection}" Text="{DynamicResource SectionExportRange}" />+ <Label Style="{StaticResource FormSection}" Content="{DynamicResource SectionExportRange}" /><controls:FormPanel><TextBlock Style="{StaticResource FormLabel}" Text="{meta:Label model:Display.ExportFrom}" /><controls:NumberBox Text="{Binding ExportFrom}" Minimum="0" ToolTip="{meta:Hint model:Display.ExportFrom}" />@@ -23,7 +23,7 @@<controls:NumberBox Text="{Binding ExportTo}" Minimum="0" ToolTip="{meta:Hint model:Display.ExportTo}" /></controls:FormPanel>- <TextBlock Style="{StaticResource FormSection}" Text="{DynamicResource SectionVideo}" />+ <Label Style="{StaticResource FormSection}" Content="{DynamicResource SectionVideo}" /><controls:FormPanel DataContext="{Binding Video}"><TextBlock Style="{StaticResource FormLabel}" Text="{meta:Label model:Video.Fps}" /><controls:NumberBox Text="{Binding Fps}" Minimum="1" Maximum="240" ToolTip="{meta:Hint model:Video.Fps}" />diff --git a/WaveDude.WPF/Views/ProbeView.xaml b/WaveDude.WPF/Views/ProbeView.xamlindex 906117c..5976c4a 100644--- a/WaveDude.WPF/Views/ProbeView.xaml+++ b/WaveDude.WPF/Views/ProbeView.xaml@@ -43,7 +43,7 @@<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled"><StackPanel Margin="8">- <TextBlock Style="{StaticResource FormSection}" Text="{DynamicResource SectionGeneral}" />+ <Label Style="{StaticResource FormSection}" Content="{DynamicResource SectionGeneral}" /><controls:FormPanel><TextBlock Style="{StaticResource FormLabel}" Text="{meta:Label model:Probe.Name}" /><TextBox Text="{Binding Name, UpdateSourceTrigger=PropertyChanged}" ToolTip="{meta:Hint model:Probe.Name}" />@@ -55,7 +55,7 @@<controls:NumberBox Text="{Binding StartAfter}" Minimum="0" ToolTip="{meta:Hint model:Probe.StartAfter}" /></controls:FormPanel>- <TextBlock Style="{StaticResource FormSection}" Text="{DynamicResource SectionMeasurement}" />+ <Label Style="{StaticResource FormSection}" Content="{DynamicResource SectionMeasurement}" /><controls:FormPanel><TextBlock Style="{StaticResource FormLabel}" Text="{meta:Label model:Probe.Layer}" /><ComboBox Style="{StaticResource EnumComboBox}" ItemsSource="{meta:EnumValues model:ProbeLayer}"@@ -71,7 +71,7 @@SelectedItem="{Binding Kind}" ToolTip="{meta:Hint model:Probe.Kind}" /></controls:FormPanel>- <TextBlock Style="{StaticResource FormSection}" Text="{DynamicResource SectionPosition}" />+ <Label Style="{StaticResource FormSection}" Content="{DynamicResource SectionPosition}" /><controls:FormPanel><TextBlock Style="{StaticResource FormLabel}" Text="{meta:Label model:Probe.AX}" /><controls:NumberBox Text="{Binding AX}" Minimum="0" ToolTip="{meta:Hint model:Probe.AX}" />@@ -86,7 +86,7 @@<controls:NumberBox Style="{StaticResource LineOnly}" Text="{Binding BY}" Minimum="0" ToolTip="{meta:Hint model:Probe.BY}" /></controls:FormPanel>- <TextBlock Style="{StaticResource FormSection}" Text="{DynamicResource SectionGraph}" />+ <Label Style="{StaticResource FormSection}" Content="{DynamicResource SectionGraph}" /><controls:FormPanel><TextBlock Style="{StaticResource FormLabel}" Text="{meta:Label model:Probe.BoxSize}" /><ComboBox Style="{StaticResource EnumComboBox}" ItemsSource="{meta:EnumValues model:ProbeBoxSize}"@@ -105,7 +105,7 @@<controls:NumberBox Style="{StaticResource CustomSizeOnly}" Text="{Binding BoxHeight}" Minimum="30" Maximum="4096" Increment="10" ToolTip="{meta:Hint model:Probe.BoxHeight}" /></controls:FormPanel>- <TextBlock Style="{StaticResource FormSection}" Text="{DynamicResource SectionAxes}" />+ <Label Style="{StaticResource FormSection}" Content="{DynamicResource SectionAxes}" /><controls:FormPanel><TextBlock Style="{StaticResource FormLabel}" Text="{meta:Label model:Probe.ScaleMode}" /><ComboBox Style="{StaticResource PointOnlyCombo}" ItemsSource="{meta:EnumValues model:ProbeScaleMode}"diff --git a/WaveDude.WPF/Views/ProjectView.xaml b/WaveDude.WPF/Views/ProjectView.xamlindex aade611..2d4b2a0 100644--- a/WaveDude.WPF/Views/ProjectView.xaml+++ b/WaveDude.WPF/Views/ProjectView.xaml@@ -12,7 +12,7 @@<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled"><StackPanel Margin="8">- <TextBlock Style="{StaticResource FormSection}" Text="{DynamicResource SectionGeneral}" />+ <Label Style="{StaticResource FormSection}" Content="{DynamicResource SectionGeneral}" /><controls:FormPanel><TextBlock Style="{StaticResource FormLabel}" Text="{meta:Label model:Project.Version}" /><TextBlock Style="{StaticResource FormValue}" Text="{Binding Version}" ToolTip="{meta:Hint model:Project.Version}" />diff --git a/WaveDude.WPF/Views/SceneView.xaml b/WaveDude.WPF/Views/SceneView.xamlindex e8f6610..262bfad 100644--- a/WaveDude.WPF/Views/SceneView.xaml+++ b/WaveDude.WPF/Views/SceneView.xaml@@ -28,7 +28,7 @@<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled"><StackPanel Margin="8">- <TextBlock Style="{StaticResource FormSection}" Text="{DynamicResource SectionCanvas}" />+ <Label Style="{StaticResource FormSection}" Content="{DynamicResource SectionCanvas}" /><controls:FormPanel><TextBlock Style="{StaticResource FormLabel}" Text="{meta:Label model:Scene.Mode}" /><ComboBox Style="{StaticResource EnumComboBox}" ItemsSource="{meta:EnumValues model:SceneMode}"@@ -60,7 +60,7 @@<controls:NumberBox Text="{Binding RefractiveIndex}" Minimum="1" Maximum="2.55" Increment="0.01" ToolTip="{meta:Hint model:Scene.RefractiveIndex}" /></controls:FormPanel>- <TextBlock Style="{StaticResource FormSection}" Text="{DynamicResource SectionImageSources}" />+ <Label Style="{StaticResource FormSection}" Content="{DynamicResource SectionImageSources}" /><controls:FormPanel><CheckBox controls:FormPanel.FullWidth="True" Content="{meta:Label model:Scene.ImageSources}"IsChecked="{Binding ImageSources}" ToolTip="{meta:Hint model:Scene.ImageSources}" />diff --git a/WaveDude.WPF/Views/SimulationView.xaml b/WaveDude.WPF/Views/SimulationView.xamlindex bef0c45..695ea19 100644--- a/WaveDude.WPF/Views/SimulationView.xaml+++ b/WaveDude.WPF/Views/SimulationView.xaml@@ -7,7 +7,7 @@<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled"><StackPanel Margin="8">- <TextBlock Style="{StaticResource FormSection}" Text="{DynamicResource SectionRun}" />+ <Label Style="{StaticResource FormSection}" Content="{DynamicResource SectionRun}" /><controls:FormPanel><TextBlock Style="{StaticResource FormLabel}" Text="{meta:Label model:Simulation.Steps}" /><controls:NumberBox Text="{Binding Steps}" Minimum="1" Maximum="10000000" Increment="100" ToolTip="{meta:Hint model:Simulation.Steps}" />@@ -16,7 +16,7 @@<controls:NumberBox Text="{Binding VisualizeEvery}" Minimum="1" Maximum="1000" ToolTip="{meta:Hint model:Simulation.VisualizeEvery}" /></controls:FormPanel>- <TextBlock Style="{StaticResource FormSection}" Text="{DynamicResource SectionSolver}" />+ <Label Style="{StaticResource FormSection}" Content="{DynamicResource SectionSolver}" /><controls:FormPanel><CheckBox controls:FormPanel.FullWidth="True" Content="{meta:Label model:Simulation.FourthOrderLaplacian}"IsChecked="{Binding FourthOrderLaplacian}" ToolTip="{meta:Hint model:Simulation.FourthOrderLaplacian}" />diff --git a/WaveDude.WPF/Views/SourceView.xaml b/WaveDude.WPF/Views/SourceView.xamlindex e754c89..ddbf4d6 100644--- a/WaveDude.WPF/Views/SourceView.xaml+++ b/WaveDude.WPF/Views/SourceView.xaml@@ -28,7 +28,7 @@<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled"><StackPanel Margin="8">- <TextBlock Style="{StaticResource FormSection}" Text="{DynamicResource SectionGeneral}" />+ <Label Style="{StaticResource FormSection}" Content="{DynamicResource SectionGeneral}" /><controls:FormPanel><TextBlock Style="{StaticResource FormLabel}" Text="{meta:Label model:Source.Name}" /><TextBox Text="{Binding Name, UpdateSourceTrigger=PropertyChanged}" ToolTip="{meta:Hint model:Source.Name}" />@@ -37,7 +37,7 @@IsChecked="{Binding Enabled}" ToolTip="{meta:Hint model:Source.Enabled}" /></controls:FormPanel>- <TextBlock Style="{StaticResource FormSection}" Text="{DynamicResource SectionPosition}" />+ <Label Style="{StaticResource FormSection}" Content="{DynamicResource SectionPosition}" /><controls:FormPanel><TextBlock Style="{StaticResource FormLabel}" Text="{meta:Label model:Source.X}" /><controls:NumberBox Text="{Binding X}" Minimum="0" ToolTip="{meta:Hint model:Source.X}" AutomationProperties.AutomationId="SourceX" />@@ -46,7 +46,7 @@<controls:NumberBox Text="{Binding Y}" Minimum="0" ToolTip="{meta:Hint model:Source.Y}" /></controls:FormPanel>- <TextBlock Style="{StaticResource FormSection}" Text="{DynamicResource SectionWave}" />+ <Label Style="{StaticResource FormSection}" Content="{DynamicResource SectionWave}" /><controls:FormPanel><TextBlock Style="{StaticResource FormLabel}" Text="{meta:Label model:Source.Frequency}" /><controls:NumberBox Text="{Binding Frequency}" Minimum="1" Maximum="255" ToolTip="{meta:Hint model:Source.Frequency}" />@@ -72,7 +72,7 @@</TextBlock></controls:FormPanel>- <TextBlock Style="{StaticResource FormSection}" Text="{DynamicResource SectionTiming}" />+ <Label Style="{StaticResource FormSection}" Content="{DynamicResource SectionTiming}" /><controls:FormPanel><TextBlock Style="{StaticResource FormLabel}" Text="{meta:Label model:Source.Mode}" /><ComboBox Style="{StaticResource EnumComboBox}" ItemsSource="{meta:EnumValues model:SourceMode}"@@ -92,7 +92,7 @@<controls:NumberBox Text="{Binding DetachAfter}" Minimum="-1" ToolTip="{meta:Hint model:Source.DetachAfter}" /></controls:FormPanel>- <TextBlock Style="{StaticResource FormSection}" Text="{DynamicResource SectionArray}" />+ <Label Style="{StaticResource FormSection}" Content="{DynamicResource SectionArray}" /><CheckBox Content="{meta:Label model:Source.IsComposite}" IsChecked="{Binding IsComposite}"ToolTip="{meta:Hint model:Source.IsComposite}" Margin="0,0,0,4" /><!-- the array's own settings; empty and disabled while there is no array -->@@ -114,7 +114,7 @@<controls:NumberBox Text="{Binding Angle}" Minimum="-180" Maximum="180" Increment="5" ToolTip="{meta:Hint model:SourceArray.Angle}" /><!-- the four random amounts are offsets added per emitter on top of the values above (the author's point 9) -->- <TextBlock controls:FormPanel.FullWidth="True" Style="{StaticResource FormSection}" Text="{DynamicResource SectionRandom}" />+ <Label controls:FormPanel.FullWidth="True" Style="{StaticResource FormSection}" Content="{DynamicResource SectionRandom}" /><TextBlock Style="{StaticResource FormLabel}" Text="{meta:Label model:SourceArray.RandomFrequency}" /><controls:NumberBox Text="{Binding RandomFrequency}" Minimum="0" ToolTip="{meta:Hint model:SourceArray.RandomFrequency}" />