mirror of
https://github.com/Raphire/Win11Debloat.git
synced 2026-05-18 11:46:18 +00:00
Refactor app removal scope handling & styling
This commit is contained in:
@@ -504,6 +504,19 @@ function Show-MainWindow {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$appSelectionStatus.Text = "$selectedCount app(s) selected for removal"
|
$appSelectionStatus.Text = "$selectedCount app(s) selected for removal"
|
||||||
|
|
||||||
|
if ($appRemovalScopeCombo -and $appRemovalScopeSection -and $appRemovalScopeDescription) {
|
||||||
|
if ($selectedCount -gt 0) {
|
||||||
|
if ($userSelectionCombo.SelectedIndex -ne 2) {
|
||||||
|
$appRemovalScopeCombo.IsEnabled = $true
|
||||||
|
}
|
||||||
|
UpdateAppRemovalScopeDescription
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$appRemovalScopeCombo.IsEnabled = $false
|
||||||
|
$appRemovalScopeDescription.Text = "No apps selected for removal."
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Applies a preset by checking/unchecking apps that match the given filter
|
# Applies a preset by checking/unchecking apps that match the given filter
|
||||||
@@ -1563,21 +1576,7 @@ function Show-MainWindow {
|
|||||||
$changesList += "Remove $selectedAppsCount application(s)"
|
$changesList += "Remove $selectedAppsCount application(s)"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Update app removal scope section based on whether apps are selected
|
UpdateAppSelectionStatus
|
||||||
if ($selectedAppsCount -gt 0) {
|
|
||||||
# Enable app removal scope selection (unless locked by sysprep mode)
|
|
||||||
if ($userSelectionCombo.SelectedIndex -ne 2) {
|
|
||||||
$appRemovalScopeCombo.IsEnabled = $true
|
|
||||||
}
|
|
||||||
$appRemovalScopeSection.Opacity = 1.0
|
|
||||||
UpdateAppRemovalScopeDescription
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
# Disable app removal scope selection when no apps selected
|
|
||||||
$appRemovalScopeCombo.IsEnabled = $false
|
|
||||||
$appRemovalScopeSection.Opacity = 0.5
|
|
||||||
$appRemovalScopeDescription.Text = "No apps selected for removal."
|
|
||||||
}
|
|
||||||
|
|
||||||
# Collect all ComboBox/CheckBox selections from dynamically created controls
|
# Collect all ComboBox/CheckBox selections from dynamically created controls
|
||||||
if ($script:UiControlMappings) {
|
if ($script:UiControlMappings) {
|
||||||
|
|||||||
Reference in New Issue
Block a user