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:
@@ -24,7 +24,7 @@ function Register-EventHandlers {
|
||||
|
||||
# Define a handler to validate pasted text, ensuring it's only integers
|
||||
$integerPastingHandler = {
|
||||
param($sender, $pastingEventArgs)
|
||||
param($eventSource, $pastingEventArgs)
|
||||
if ($pastingEventArgs.DataObject.GetDataPresent([string])) {
|
||||
$pastedText = $pastingEventArgs.DataObject.GetData([string])
|
||||
# Check if the pasted text consists ONLY of one or more digits.
|
||||
@@ -345,6 +345,7 @@ function Register-EventHandlers {
|
||||
$driveObject | Add-Member -MemberType NoteProperty -Name 'IsSelected' -Value $false -Force
|
||||
$localState.Controls.lstUSBDrives.Items.Add($driveObject)
|
||||
}
|
||||
Request-ListViewColumnAutoResize -ListView $localState.Controls.lstUSBDrives
|
||||
if ($localState.Controls.lstUSBDrives.Items.Count -gt 0) {
|
||||
$localState.Controls.lstUSBDrives.SelectedIndex = 0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user