Refactor/clean up window styles

This commit is contained in:
Raphire
2026-03-23 21:35:33 +01:00
parent b5c576519b
commit 2eddbe5638
6 changed files with 141 additions and 206 deletions

View File

@@ -1403,13 +1403,13 @@ function Show-MainWindow {
if ($userSelectionCombo.SelectedIndex -ne 2) {
$appRemovalScopeCombo.IsEnabled = $true
}
$appRemovalScopeSection.Opacity = 1.0
$appRemovalScopeSection.Visibility = 'Visible'
UpdateAppRemovalScopeDescription
}
else {
# Disable app removal scope selection when no apps selected
$appRemovalScopeCombo.IsEnabled = $false
$appRemovalScopeSection.Opacity = 0.5
$appRemovalScopeSection.Visibility = 'Collapsed'
$appRemovalScopeDescription.Text = "No apps selected for removal."
}

View File

@@ -55,19 +55,9 @@ function Show-RevertSettingsModal {
$applyBtn = $revertWindow.FindName('RevertApplyBtn')
$cancelBtn = $revertWindow.FindName('RevertCancelBtn')
$restartExplorerCheckbox = $revertWindow.FindName('RevertRestartExplorerCheckBox')
$featureCheckboxStyle = $revertWindow.FindResource('FeatureCheckboxStyle')
$restartExplorerCheckbox.Style = $featureCheckboxStyle
$entryCheckboxes = @()
$featureCheckboxStyle = $null
if ($ownerWindow) {
try {
$featureCheckboxStyle = $ownerWindow.FindResource('FeatureCheckboxStyle')
}
catch { }
}
if ($restartExplorerCheckbox -and $featureCheckboxStyle) {
$restartExplorerCheckbox.Style = $featureCheckboxStyle
}
foreach ($setting in $LastUsedSettings.Settings) {
if ($setting.Value -ne $true) { continue }
@@ -95,7 +85,7 @@ function Show-RevertSettingsModal {
'No revert action available'
}
$canUndo = ($undoFeature -ne $null)
$canUndo = ($null -ne $undoFeature)
$itemBorder = New-Object System.Windows.Controls.Border
$itemBorder.Style = $revertWindow.FindResource('RevertItemBorderStyle')
@@ -106,13 +96,7 @@ function Show-RevertSettingsModal {
$checkbox = New-Object System.Windows.Controls.CheckBox
$checkbox.Content = $label
$checkbox.Tag = $setting.Name
if ($featureCheckboxStyle) {
$checkbox.Style = $featureCheckboxStyle
}
else {
$checkbox.Foreground = $revertWindow.FindResource('FgColor')
}
$checkbox.Margin = [System.Windows.Thickness]::new(0, 0, 0, 3)
$checkbox.Style = $featureCheckboxStyle
$checkbox.IsEnabled = $canUndo
$undoText = New-Object System.Windows.Controls.TextBlock