mirror of
https://github.com/rbalsleyMSFT/FFU.git
synced 2026-06-14 02:09:35 -06:00
Updates UI layout to a modern navigation sidebar and adds Fluent theme support
Refactors the main window layout to use a sidebar navigation model instead of a standard tab control, improving the overall organization of the application. Introduces support for the Fluent theme (Light, Dark, and System) for users running PowerShell 7.5+ (.NET 9+), gracefully falling back to standard styling for older versions. Adds a new Settings page that allows users to configure the application theme and access helpful documentation and repository links. Standardizes margins, font sizes, and layout choices across all forms to closer match Windows design guidelines. Updates configuration handling to save and restore user theme preferences.
This commit is contained in:
@@ -55,7 +55,8 @@ $script:uiState = [PSCustomObject]@{
|
||||
lastSortProperty = $null;
|
||||
lastSortAscending = $true;
|
||||
isBuilding = $false;
|
||||
isCleanupRunning = $false
|
||||
isCleanupRunning = $false;
|
||||
isFluentSupported = $false
|
||||
};
|
||||
Defaults = @{};
|
||||
LogFilePath = "$FFUDevelopmentPath\FFUDevelopment_UI.log"
|
||||
@@ -120,6 +121,9 @@ $reader = New-Object System.IO.StringReader($xamlString)
|
||||
$xmlReader = [System.Xml.XmlReader]::Create($reader)
|
||||
$window = [Windows.Markup.XamlReader]::Load($xmlReader)
|
||||
|
||||
# Apply Fluent theme before the window renders (requires PowerShell 7.5+ / .NET 9+)
|
||||
Initialize-FluentTheme -Window $window -ThemeMode "System" -State $script:uiState
|
||||
|
||||
$window.Add_Loaded({
|
||||
# Pass the state object to all initialization functions
|
||||
$script:uiState.Window = $window
|
||||
@@ -390,8 +394,11 @@ $script:uiState.Controls.btnRun.Add_Click({
|
||||
# Not currently building: start a new build
|
||||
$btnRun.IsEnabled = $false
|
||||
|
||||
# Switch to Monitor Tab
|
||||
$script:uiState.Controls.MainTabControl.SelectedItem = $script:uiState.Controls.MonitorTab
|
||||
# Switch to Monitor page via navigation
|
||||
$monitorIndex = 8 # Monitor is the 9th item (index 8) in the navigation list
|
||||
if ($null -ne $script:uiState.Controls.lstNavigation) {
|
||||
$script:uiState.Controls.lstNavigation.SelectedIndex = $monitorIndex
|
||||
}
|
||||
|
||||
# Clear previous log data and reset autoscroll
|
||||
if ($null -ne $script:uiState.Data.logData) {
|
||||
|
||||
Reference in New Issue
Block a user