mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2024-11-14 14:45:52 -06:00
Fix New Line Character for 'winutil.ps1' File (#2150)
* Change New Line Character from LF to CRLF in 'Get-TabXaml.ps1' Private Function * Update '.gitattributes' File Provide stricter rules to be used for multiple file types in the repo.
This commit is contained in:
parent
676e46f59f
commit
a924d91d65
11
.gitattributes
vendored
11
.gitattributes
vendored
@ -1,3 +1,12 @@
|
|||||||
|
* text=auto
|
||||||
|
|
||||||
|
*.ps1 text eol=crlf
|
||||||
|
*.json text eol=crlf
|
||||||
|
*.cfg text eol=crlf
|
||||||
|
|
||||||
|
*.png binary
|
||||||
|
*.jpg binary
|
||||||
|
|
||||||
config/* diff
|
config/* diff
|
||||||
config/applications.json diff
|
config/applications.json diff
|
||||||
*.json diff
|
*.json diff
|
||||||
|
@ -61,19 +61,19 @@ function Get-TabXaml {
|
|||||||
$paneltotal = $columncount
|
$paneltotal = $columncount
|
||||||
}
|
}
|
||||||
# add ColumnDefinitions to evenly draw colums
|
# add ColumnDefinitions to evenly draw colums
|
||||||
$blockXml="<Grid.ColumnDefinitions>`n"+("<ColumnDefinition Width=""*""/>`n"*($paneltotal))+"</Grid.ColumnDefinitions>`n"
|
$blockXml="<Grid.ColumnDefinitions>`r`n"+("<ColumnDefinition Width=""*""/>`r`n"*($paneltotal))+"</Grid.ColumnDefinitions>`r`n"
|
||||||
# Iterate through organizedData by panel, category, and application
|
# Iterate through organizedData by panel, category, and application
|
||||||
$count = 0
|
$count = 0
|
||||||
foreach ($panel in ($organizedData.Keys | Sort-Object)) {
|
foreach ($panel in ($organizedData.Keys | Sort-Object)) {
|
||||||
$blockXml += "<Border Grid.Row=""1"" Grid.Column=""$panelcount"">`n<StackPanel Background=""{MainBackgroundColor}"" SnapsToDevicePixels=""True"">`n"
|
$blockXml += "<Border Grid.Row=""1"" Grid.Column=""$panelcount"">`r`n<StackPanel Background=""{MainBackgroundColor}"" SnapsToDevicePixels=""True"">`r`n"
|
||||||
$panelcount++
|
$panelcount++
|
||||||
foreach ($category in ($organizedData[$panel].Keys | Sort-Object)) {
|
foreach ($category in ($organizedData[$panel].Keys | Sort-Object)) {
|
||||||
$count++
|
$count++
|
||||||
if ($columncount -gt 0) {
|
if ($columncount -gt 0) {
|
||||||
$panelcount2 = [Int](($count)/$maxcount-0.5)
|
$panelcount2 = [Int](($count)/$maxcount-0.5)
|
||||||
if ($panelcount -eq $panelcount2 ) {
|
if ($panelcount -eq $panelcount2 ) {
|
||||||
$blockXml +="`n</StackPanel>`n</Border>`n"
|
$blockXml +="`r`n</StackPanel>`r`n</Border>`r`n"
|
||||||
$blockXml += "<Border Grid.Row=""1"" Grid.Column=""$panelcount"">`n<StackPanel Background=""{MainBackgroundColor}"" SnapsToDevicePixels=""True"">`n"
|
$blockXml += "<Border Grid.Row=""1"" Grid.Column=""$panelcount"">`r`n<StackPanel Background=""{MainBackgroundColor}"" SnapsToDevicePixels=""True"">`r`n"
|
||||||
$panelcount++
|
$panelcount++
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -83,49 +83,49 @@ function Get-TabXaml {
|
|||||||
|
|
||||||
$categorycontent = $($category -replace '^.__', '')
|
$categorycontent = $($category -replace '^.__', '')
|
||||||
$categoryname = Get-WPFObjectName -type "Label" -name $categorycontent
|
$categoryname = Get-WPFObjectName -type "Label" -name $categorycontent
|
||||||
$blockXml += "<Label Name=""$categoryname"" Content=""$categorycontent"" FontSize=""16""/>`n"
|
$blockXml += "<Label Name=""$categoryname"" Content=""$categorycontent"" FontSize=""16""/>`r`n"
|
||||||
$sortedApps = $organizedData[$panel][$category].Keys | Sort-Object
|
$sortedApps = $organizedData[$panel][$category].Keys | Sort-Object
|
||||||
foreach ($appName in $sortedApps) {
|
foreach ($appName in $sortedApps) {
|
||||||
$count++
|
$count++
|
||||||
if ($columncount -gt 0) {
|
if ($columncount -gt 0) {
|
||||||
$panelcount2 = [Int](($count)/$maxcount-0.5)
|
$panelcount2 = [Int](($count)/$maxcount-0.5)
|
||||||
if ($panelcount -eq $panelcount2 ) {
|
if ($panelcount -eq $panelcount2 ) {
|
||||||
$blockXml +="`n</StackPanel>`n</Border>`n"
|
$blockXml +="`r`n</StackPanel>`r`n</Border>`r`n"
|
||||||
$blockXml += "<Border Grid.Row=""1"" Grid.Column=""$panelcount"">`n<StackPanel Background=""{MainBackgroundColor}"" SnapsToDevicePixels=""True"">`n"
|
$blockXml += "<Border Grid.Row=""1"" Grid.Column=""$panelcount"">`r`n<StackPanel Background=""{MainBackgroundColor}"" SnapsToDevicePixels=""True"">`r`n"
|
||||||
$panelcount++
|
$panelcount++
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$appInfo = $organizedData[$panel][$category][$appName]
|
$appInfo = $organizedData[$panel][$category][$appName]
|
||||||
if ("Toggle" -eq $appInfo.Type) {
|
if ("Toggle" -eq $appInfo.Type) {
|
||||||
$blockXml += "<DockPanel LastChildFill=`"True`">`n<Label Content=`"$($appInfo.Content)`" ToolTip=`"$($appInfo.Description)`" HorizontalAlignment=`"Left`"/>`n"
|
$blockXml += "<DockPanel LastChildFill=`"True`">`r`n<Label Content=`"$($appInfo.Content)`" ToolTip=`"$($appInfo.Description)`" HorizontalAlignment=`"Left`"/>`r`n"
|
||||||
$blockXml += "<CheckBox Name=`"$($appInfo.Name)`" Style=`"{StaticResource ColorfulToggleSwitchStyle}`" Margin=`"2.5,0`" HorizontalAlignment=`"Right`"/>`n</DockPanel>`n"
|
$blockXml += "<CheckBox Name=`"$($appInfo.Name)`" Style=`"{StaticResource ColorfulToggleSwitchStyle}`" Margin=`"2.5,0`" HorizontalAlignment=`"Right`"/>`r`n</DockPanel>`r`n"
|
||||||
} elseif ("Combobox" -eq $appInfo.Type) {
|
} elseif ("Combobox" -eq $appInfo.Type) {
|
||||||
$blockXml += "<StackPanel Orientation=`"Horizontal`" Margin=`"0,5,0,0`">`n<Label Content=`"$($appInfo.Content)`" HorizontalAlignment=`"Left`" VerticalAlignment=`"Center`"/>`n"
|
$blockXml += "<StackPanel Orientation=`"Horizontal`" Margin=`"0,5,0,0`">`r`n<Label Content=`"$($appInfo.Content)`" HorizontalAlignment=`"Left`" VerticalAlignment=`"Center`"/>`r`n"
|
||||||
$blockXml += "<ComboBox Name=`"$($appInfo.Name)`" Height=`"32`" Width=`"186`" HorizontalAlignment=`"Left`" VerticalAlignment=`"Center`" Margin=`"5,5`">`n"
|
$blockXml += "<ComboBox Name=`"$($appInfo.Name)`" Height=`"32`" Width=`"186`" HorizontalAlignment=`"Left`" VerticalAlignment=`"Center`" Margin=`"5,5`">`r`n"
|
||||||
$addfirst="IsSelected=`"True`""
|
$addfirst="IsSelected=`"True`""
|
||||||
foreach ($comboitem in ($appInfo.ComboItems -split " ")) {
|
foreach ($comboitem in ($appInfo.ComboItems -split " ")) {
|
||||||
$blockXml += "<ComboBoxItem $addfirst Content=`"$comboitem`"/>`n"
|
$blockXml += "<ComboBoxItem $addfirst Content=`"$comboitem`"/>`r`n"
|
||||||
$addfirst=""
|
$addfirst=""
|
||||||
}
|
}
|
||||||
$blockXml += "</ComboBox>`n</StackPanel>"
|
$blockXml += "</ComboBox>`r`n</StackPanel>"
|
||||||
# If it is a digit, type is button and button length is digits
|
# If it is a digit, type is button and button length is digits
|
||||||
} elseif ($appInfo.Type -match "^[\d\.]+$") {
|
} elseif ($appInfo.Type -match "^[\d\.]+$") {
|
||||||
$blockXml += "<Button Name=`"$($appInfo.Name)`" Content=`"$($appInfo.Content)`" HorizontalAlignment = `"Left`" Width=`"$($appInfo.Type)`" Margin=`"5`" Padding=`"20,5`" />`n"
|
$blockXml += "<Button Name=`"$($appInfo.Name)`" Content=`"$($appInfo.Content)`" HorizontalAlignment = `"Left`" Width=`"$($appInfo.Type)`" Margin=`"5`" Padding=`"20,5`" />`r`n"
|
||||||
# else it is a checkbox
|
# else it is a checkbox
|
||||||
} else {
|
} else {
|
||||||
$checkedStatus = If ($null -eq $appInfo.Checked) {""} Else {"IsChecked=`"$($appInfo.Checked)`" "}
|
$checkedStatus = If ($null -eq $appInfo.Checked) {""} Else {"IsChecked=`"$($appInfo.Checked)`" "}
|
||||||
if ($null -eq $appInfo.Link)
|
if ($null -eq $appInfo.Link)
|
||||||
{
|
{
|
||||||
$blockXml += "<CheckBox Name=`"$($appInfo.Name)`" Content=`"$($appInfo.Content)`" $($checkedStatus)Margin=`"5,0`" ToolTip=`"$($appInfo.Description)`"/>`n"
|
$blockXml += "<CheckBox Name=`"$($appInfo.Name)`" Content=`"$($appInfo.Content)`" $($checkedStatus)Margin=`"5,0`" ToolTip=`"$($appInfo.Description)`"/>`r`n"
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$blockXml += "<StackPanel Orientation=""Horizontal"">`n<CheckBox Name=""$($appInfo.Name)"" Content=""$($appInfo.Content)"" $($checkedStatus)ToolTip=""$($appInfo.Description)"" Margin=""0,0,2,0""/><TextBlock Name=""$($appInfo.Name)Link"" Style=""{StaticResource HoverTextBlockStyle}"" Text=""(?)"" ToolTip=""$($appInfo.Link)"" />`n</StackPanel>`n"
|
$blockXml += "<StackPanel Orientation=""Horizontal"">`r`n<CheckBox Name=""$($appInfo.Name)"" Content=""$($appInfo.Content)"" $($checkedStatus)ToolTip=""$($appInfo.Description)"" Margin=""0,0,2,0""/><TextBlock Name=""$($appInfo.Name)Link"" Style=""{StaticResource HoverTextBlockStyle}"" Text=""(?)"" ToolTip=""$($appInfo.Link)"" />`r`n</StackPanel>`r`n"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$blockXml +="`n</StackPanel>`n</Border>`n"
|
$blockXml +="`r`n</StackPanel>`r`n</Border>`r`n"
|
||||||
}
|
}
|
||||||
return ($blockXml)
|
return ($blockXml)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user