Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
14 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ protected override void OnStartup(StartupEventArgs e)
return;
}

// P2 installs one calm industrial visual system before StartupUri materializes.
// P0 installs one cool-blue/white workstation system before StartupUri materializes.
// Existing XAML keeps its semantic resource keys while the overlay replaces
// glare-heavy white/blue surfaces with Blue Steel + Light Greige equivalents.
// warm legacy surfaces with shared blue-white semantic resources.
InstallP2BlueSteelGreigeTheme();

// Keep every IED card on one reusable template key while replacing the
Expand Down Expand Up @@ -92,6 +92,8 @@ private void AppWindow_Loaded(object sender, RoutedEventArgs e)
if (_styledWindows.TryGetValue(window, out _))
return;

// Initial placement is applied ONCE before first paint; never on activation or resize.
WorkstationWindowStartupBounds.Apply(window);
P2BlueSteelGreigeUx.ApplyToOpenWindows(this);
_styledWindows.Add(window, new object());

Expand Down
4 changes: 2 additions & 2 deletions IoListTestingWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
xmlns:io="clr-namespace:ArIED61850Tester.Models.IoTesting"
xmlns:local="clr-namespace:ArIED61850Tester"
Title="ARSAS - IO List Testing"
Height="900" Width="1500" MinHeight="760" MinWidth="1180"
WindowStartupLocation="CenterOwner" WindowState="Maximized"
Height="820" Width="1440" MinHeight="640" MinWidth="1100"
WindowStartupLocation="CenterOwner" WindowState="Normal"
Background="{StaticResource AppBackgroundGradient}"
FontFamily="{StaticResource AppFontFamily}"
UseLayoutRounding="True" SnapsToDevicePixels="True"
Expand Down
4 changes: 2 additions & 2 deletions MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:views="clr-namespace:ArIED61850Tester.Views"
Title="ARSAS - Smart IEC 61850 Communication Tester"
Height="900" Width="1480" MinHeight="760" MinWidth="1180"
WindowStartupLocation="CenterScreen" WindowState="Maximized" Background="{StaticResource AppBackgroundGradient}"
Height="840" Width="1440" MinHeight="640" MinWidth="1100"
WindowStartupLocation="CenterScreen" WindowState="Normal" Background="{StaticResource AppBackgroundGradient}"
FontFamily="{StaticResource AppFontFamily}"
UseLayoutRounding="True" SnapsToDevicePixels="True"
TextOptions.TextFormattingMode="Ideal"
Expand Down
39 changes: 8 additions & 31 deletions P2BlueSteelGreigeUx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@
namespace ArIED61850Tester;

/// <summary>
/// Small visual adapter for the P2 Blue Steel + Light Greige theme.
/// Visual adapter for the P0 Blue Steel + Cool Blue workstation system.
///
/// Most ARSAS surfaces already consume application resource keys. A few legacy
/// windows still own local white grid/card styles or hard-coded navigation chrome;
/// this adapter replaces only those visual contracts at runtime. It deliberately
/// Most ARSAS surfaces consume application resource keys. Handle legacy chrome
/// without overwriting scope-specific grid colors, SMV visuals or user window bounds. It deliberately
/// does not alter IEC 61850 workflows, bindings, command handlers, or session state.
/// </summary>
internal static class P2BlueSteelGreigeUx
Expand Down Expand Up @@ -56,10 +55,6 @@ private static void Apply(Window window)

private static void ApplyMainWindow(MainWindow window)
{
// ARSAS is an engineering workstation: use the available display by default.
if (window.WindowState == WindowState.Normal)
window.WindowState = WindowState.Maximized;

if (window.FindName("WorkflowNavShell") is Border navShell)
{
navShell.Background = Brush(window, "BlueSteelNavSurface");
Expand All @@ -78,15 +73,10 @@ private static void ApplyMainWindow(MainWindow window)
if (deviceList != null && Resource(window, "P2MainIedListItemStyle") is Style itemStyle)
deviceList.ItemContainerStyle = itemStyle;

foreach (var grid in Descendants<DataGrid>(window))
ApplyEngineeringGrid(window, grid);
}

private static void ApplyIoFatWindow(IoListTestingWindow window)
{
if (window.WindowState != WindowState.Maximized)
window.WindowState = WindowState.Maximized;

var fatIedList = Descendants<ListBox>(window)
.FirstOrDefault(list => ReferenceEquals(list.ItemsSource, window.Project.Ieds));
if (fatIedList != null && Resource(window, "P2FatIedListItemStyle") is Style itemStyle)
Expand All @@ -98,13 +88,13 @@ private static void ApplyIoFatWindow(IoListTestingWindow window)

foreach (var grid in Descendants<DataGrid>(window))
{
grid.Background = Brush(window, "GreigeSurface");
grid.BorderBrush = Brush(window, "SteelDividerStrong");
grid.Background = Brush(window, "PanelSurface");
grid.BorderBrush = Brush(window, "CoolDivider");
grid.BorderThickness = new Thickness(1);
grid.HorizontalGridLinesBrush = new SolidColorBrush(Color.FromRgb(0xD4, 0xD0, 0xC9));
grid.HorizontalGridLinesBrush = Brush(window, "CoolDivider");
grid.GridLinesVisibility = DataGridGridLinesVisibility.Horizontal;
grid.RowBackground = Brush(window, "GreigeRowA");
grid.AlternatingRowBackground = Brush(window, "GreigeRowB");
grid.RowBackground = Brush(window, "GridRowPrimary");
grid.AlternatingRowBackground = Brush(window, "GridRowAlternate");
grid.AlternationCount = 2;

if (rowStyle != null)
Expand All @@ -116,19 +106,6 @@ private static void ApplyIoFatWindow(IoListTestingWindow window)
}
}

private static void ApplyEngineeringGrid(FrameworkElement owner, DataGrid grid)
{
// Preserve explicit command-grid styles. The regular explorer/live tables
// already use ModernDataGrid; setting these semantic surfaces locally keeps
// zebra rows stable even when a legacy window has an old local brush.
if (grid.Style == Resource(owner, "CommandDataGrid"))
return;

grid.RowBackground = Brush(owner, "GreigeRowA");
grid.AlternatingRowBackground = Brush(owner, "GreigeRowB");
grid.AlternationCount = 2;
}

private static object? Resource(FrameworkElement owner, object key)
=> owner.TryFindResource(key) ?? Application.Current?.TryFindResource(key);

Expand Down
4 changes: 4 additions & 0 deletions P2IndustrialWorkstationUx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,10 @@ private static void ApplyIndustrialGridHeaders(FrameworkElement owner, bool skip
{
if (skipCommandGrid && grid.Style == commandStyle)
continue;
// A tab-specific instrument (e.g. SMV Measurements) owns its explicit
// header style. The global adapter must not override that contract.
if (grid.ReadLocalValue(DataGrid.ColumnHeaderStyleProperty) != DependencyProperty.UnsetValue)
continue;
grid.ColumnHeaderStyle = header;
}
}
Expand Down
Loading
Loading