mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-07-01 10:32:35 -05:00
fix scrollviewer & reimplement logo logic into ui elements
This commit is contained in:
@ -137,7 +137,7 @@ function Invoke-WPFUIElements {
|
||||
if ($configVariable -eq $sync.configs.applications) {
|
||||
# Create the outer Border for the application type
|
||||
$border = New-Object Windows.Controls.Border
|
||||
$border.Name = $entryInfo.Name
|
||||
$border.Name = "wpfappborder" + $entryInfo.Name
|
||||
$border.BorderBrush = [Windows.Media.Brushes]::Gray
|
||||
$border.BorderThickness = 1
|
||||
$border.CornerRadius = 5
|
||||
@ -167,10 +167,30 @@ function Invoke-WPFUIElements {
|
||||
|
||||
# Create the Image and load it from the local path
|
||||
$image = New-Object Windows.Controls.Image
|
||||
$image.Name = "wpfapplogo" + $entryInfo.Name
|
||||
$image.Width = 40
|
||||
$image.Height = 40
|
||||
$image.Margin = New-Object Windows.Thickness(0, 0, 10, 0)
|
||||
$image.Source = $noimage
|
||||
if (-not [string]::IsNullOrEmpty($kaka)) {
|
||||
try {
|
||||
$packageinfo = (choco info $entryInfo.choco --limit-output).Split(' ')[0]
|
||||
$packageinfo = $packageinfo -replace '\|', '.'
|
||||
$iconlink = "https://community.chocolatey.org/content/packageimages/" + $packageinfo
|
||||
$finishediconlink = $iconlink + ".png"
|
||||
$webimage = Invoke-WebRequest -Uri $finishediconlink -Method Head -ErrorAction SilentlyContinue
|
||||
if ($webimage.StatusCode -eq 200) {
|
||||
$image.Source = [Windows.Media.Imaging.BitmapImage]::new([Uri]::new($finishediconlink))
|
||||
} else {
|
||||
$finishediconlink = $iconlink + ".svg"
|
||||
$image.Source = $noimage
|
||||
}
|
||||
} catch {
|
||||
$image.Source = $noimage
|
||||
}
|
||||
} else {
|
||||
$image.Source = $noimage
|
||||
}
|
||||
#$image.Source = $noimage
|
||||
$image.Clip = New-Object Windows.Media.RectangleGeometry
|
||||
$image.Clip.Rect = New-Object Windows.Rect(0, 0, $image.Width, $image.Height)
|
||||
$image.Clip.RadiusX = 5
|
||||
|
Reference in New Issue
Block a user