mirror of
https://github.com/rbalsleyMSFT/FFU.git
synced 2026-06-14 02:09:35 -06:00
Adds automatic column resizing to ListViews
- Enables automatic horizontal and vertical scrollbars for ListViews in the UI to improve navigation. - Introduces functions to dynamically calculate and apply column widths based on the visible content and header text. - Triggers column auto-resizing across various modules whenever ListView data is updated or refreshed. - Renames a path normalization function and updates an event handler parameter name for clarity.
This commit is contained in:
@@ -182,6 +182,7 @@ function Add-BYOApplication {
|
||||
|
||||
# Refresh the ListView to show the changes
|
||||
$listView.Items.Refresh()
|
||||
Request-ListViewColumnAutoResize -ListView $listView
|
||||
|
||||
# Reset state
|
||||
$State.Data.editingBYOApplication = $null
|
||||
@@ -212,6 +213,7 @@ function Add-BYOApplication {
|
||||
CopyStatus = ""
|
||||
}
|
||||
$listView.Items.Add($application)
|
||||
Request-ListViewColumnAutoResize -ListView $listView
|
||||
}
|
||||
|
||||
# Clear form and update button states for both add and update operations
|
||||
@@ -285,6 +287,7 @@ function Add-AppsScriptVariable {
|
||||
}
|
||||
$State.Data.appsScriptVariablesDataList.Add($newItem)
|
||||
$State.Controls.lstAppsScriptVariables.ItemsSource = $State.Data.appsScriptVariablesDataList.ToArray()
|
||||
Request-ListViewColumnAutoResize -ListView $State.Controls.lstAppsScriptVariables
|
||||
$State.Controls.txtAppsScriptKey.Clear()
|
||||
$State.Controls.txtAppsScriptValue.Clear()
|
||||
# Update the header checkbox state
|
||||
@@ -311,6 +314,7 @@ function Remove-SelectedAppsScriptVariable {
|
||||
$State.Data.appsScriptVariablesDataList.Remove($itemToRemove)
|
||||
}
|
||||
$State.Controls.lstAppsScriptVariables.ItemsSource = $State.Data.appsScriptVariablesDataList.ToArray()
|
||||
Request-ListViewColumnAutoResize -ListView $State.Controls.lstAppsScriptVariables
|
||||
|
||||
# Update the header checkbox state
|
||||
if ($null -ne $State.Controls.chkSelectAllAppsScriptVariables) {
|
||||
|
||||
Reference in New Issue
Block a user