From 2ce9dab34d9eaa689c5f50f4701a010e0b2382a4 Mon Sep 17 00:00:00 2001 From: Mykola08 <86469575+Mykola-08@users.noreply.github.com> Date: Thu, 15 Jan 2026 22:11:17 +0100 Subject: [PATCH] Add dynamic theming support and enhance GUI styling in MAS_GUI.ps1 --- App/MAS_GUI.ps1 | 240 +++++++++++++++++++++++++++++++----------------- 1 file changed, 156 insertions(+), 84 deletions(-) diff --git a/App/MAS_GUI.ps1 b/App/MAS_GUI.ps1 index 54ed4a4..8d3672e 100644 --- a/App/MAS_GUI.ps1 +++ b/App/MAS_GUI.ps1 @@ -2,7 +2,7 @@ .SYNOPSIS Win11 Style GUI for Microsoft Activation Scripts (MAS) .DESCRIPTION - A modern, Fluent-inspired interface for MAS with auto-detection of system status. + A modern, Fluent-inspired interface for MAS with auto-detection of system status and dynamic theming. #> # --- Self-Elevation --- @@ -21,7 +21,7 @@ Add-Type -AssemblyName System.Drawing # --- Helper: Get System Info --- function Get-SystemInfo { try { - $os = Get-CimInstance Win32_OperatingSystem -ErrorAction Stops + $os = Get-CimInstance Win32_OperatingSystem -ErrorAction Stop $comp = Get-CimInstance Win32_ComputerSystem -ErrorAction Stop $edition = $os.Caption -replace "Microsoft ", "" @@ -62,16 +62,39 @@ function Get-SystemInfo { $sysInfo = Get-SystemInfo +# --- Theme Definitions --- +$DarkTheme = @{ + "AppBackground" = "#202020" + "NavBackground" = "#191919" + "CardBackground" = "#272727" + "CardBorder" = "#353535" + "CardHover" = "#323232" + "TextPrimary" = "#FFFFFF" + "TextSecondary" = "#A0A0A0" + "AccentColor" = "#60CDFF" +} + +$LightTheme = @{ + "AppBackground" = "#F3F3F3" + "NavBackground" = "#EBEBEB" + "CardBackground" = "#FFFFFF" + "CardBorder" = "#E0E0E0" + "CardHover" = "#F9F9F9" + "TextPrimary" = "#000000" + "TextSecondary" = "#666666" + "AccentColor" = "#0078D4" +} + # --- XAML --- [xml]$xaml = @" + Background="{DynamicResource AppBackground}" Foreground="{DynamicResource TextPrimary}" FontFamily="Segoe UI Variable Display, Segoe UI, sans-serif"> - + @@ -83,9 +106,9 @@ $sysInfo = Get-SystemInfo