feat(install): bundle app icons and speed up the app list (#5199)
* feat(install): bundle app icons in the script config/icons.json holds a 64x64 PNG per application, taken from Dashboard Icons, gilbarbara/logos, Simple Icons, Chocolatey and project repos, so the Install tab draws them without a network request or a cache. Get-WinUtilAppIcon decodes each one once into a frozen bitmap. tools/New-WinUtilIcon.ps1 adds or replaces one. * feat(install): faster, responsive app cards Build each category's cards from one XAML parse with shared handlers instead of control by control, build the default tab before the window is shown, fit the cards to the width of each row, draw icons on a theme-aware plate, and make the cards 10% larger. * feat(install): lift icons off the card with a soft shadow Replace the solid plate behind each icon with a very light blurred shadow whose colour follows the theme (dark under the light theme, pale under the dark one), enough to separate the logo from the card without a visible box. * fix(install): keep the card width when the theme changes The theme loader re-applied a default AppEntryCardWidth, so switching theme shrank the cards back to their minimum. The width is set from the list's size, so it is no longer a theme value. * fix(install): address review feedback on the app card layout Refit the cards when the list's scrollbar appears or goes, not only when the window resizes. Keep a card at its minimum width in a viewport narrower than that. Restore the install-rendering test, whose mock had been replaced by a copy of the whole file. * feat(install): ship icons as one PNG per app in config/icons Replace the separate icons.json with config/icons/<key>.png, 48x48, so a contributor adding an app drops one image named after its key next to the applications.json entry. Compile.ps1 embeds the folder, the icons shrink from 64px to 48px (about +0.30 MB in winutil.ps1 instead of +0.42 MB), and a test checks that every icon is named after an app and stays under 8 KB. * fix(install): match the icon doc example to the real key and avoid locking the source The architecture example used a WPFInstall prefixed key, but applications.json keys have no prefix and the icon file is named after the unprefixed key. New-WinUtilIcon.ps1 now reads its input into memory, so an existing icon can be passed as its own input. * fix(install): dispose the graphics object in the icon tool * Preserve icon card dimensions during theme integration * Document bundled application icons and card sizing * fix: preserve catalog casing when generating app icons --------- Co-authored-by: Chris Titus <contact@christitus.com>
No files matched your search
@@ -16,7 +16,7 @@ $script += Get-ChildItem -Path functions -Recurse -File | ForEach-Object {
|
||||
Get-Content -Path $_.FullName -Raw
|
||||
}
|
||||
|
||||
Get-ChildItem config | ForEach-Object {
|
||||
Get-ChildItem config -File -Filter *.json | ForEach-Object {
|
||||
$obj = Get-Content -Path $_.FullName -Raw | ConvertFrom-Json
|
||||
|
||||
if ($_.Name -eq "applications.json") {
|
||||
@@ -33,6 +33,16 @@ Get-ChildItem config | ForEach-Object {
|
||||
$script += "`$sync.configs.$($_.BaseName) = @'`r`n$json`r`n'@ | ConvertFrom-Json"
|
||||
}
|
||||
|
||||
# Icons are one PNG per app in config\icons\<key>.png, named after the key in applications.json.
|
||||
# They ship as a single key -> base64 map, which the Install tab reads from $sync.configs.icons.
|
||||
$icons = [ordered]@{}
|
||||
Get-ChildItem config\icons -File -Filter *.png | ForEach-Object {
|
||||
$icons[$_.BaseName] = [Convert]::ToBase64String([IO.File]::ReadAllBytes($_.FullName))
|
||||
}
|
||||
$iconsObject = [pscustomobject]$icons
|
||||
$sync.configs["icons"] = $iconsObject
|
||||
$script += "`$sync.configs.icons = @'`r`n$($iconsObject | ConvertTo-Json)`r`n'@ | ConvertFrom-Json"
|
||||
|
||||
$xaml = Get-Content -Path xaml\inputXML.xaml -Raw
|
||||
$script += "`$inputXML = @'`r`n$xaml`r`n'@"
|
||||
|
||||
|
||||
@@ -85,6 +85,7 @@ Because the final script is concatenated, code cannot rely on runtime module imp
|
||||
- Config files must remain valid JSON and compile cleanly through `ConvertFrom-Json`.
|
||||
- `config/dns.json` opts unfiltered providers into Fastest selection with `BenchmarkEligible: true`; missing or false values exclude a provider from the TCP latency benchmark.
|
||||
- `config/applications.json` defines installable applications; each entry includes the fields expected by tests and UI code, such as package manager IDs, category, display content, description, and link.
|
||||
- `config/icons/<key>.png` holds one 48x48 icon per application, named after its key in `config/applications.json` (without the `WPFInstall` prefix). `Compile.ps1` embeds the folder as `$sync.configs.icons`, and the Install tab draws the icons without any network access (`Get-WinUtilAppIcon`); an app with no icon file falls back to the online favicon lookup. Add or replace one with `tools/New-WinUtilIcon.ps1`; a Pester test requires an icon of at most 8 KB for every application.
|
||||
- `config/tweaks.json` defines Windows tweaks; registry and service changes include original values or original states when applicable so undo workflows can restore user systems.
|
||||
- Preset and navigation files reference valid config keys. Renaming a config key requires updating all presets, UI references, docs, and code paths together.
|
||||
- Adding or renaming a preset, adding a selection key prefix, or adding a new kind of tweak change also requires updating the docs Tools pages (see Docs Site).
|
||||
|
||||
|
After Width: | Height: | Size: 802 B |
|
After Width: | Height: | Size: 671 B |
|
After Width: | Height: | Size: 712 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 857 B |
|
After Width: | Height: | Size: 561 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 724 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 650 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 887 B |
|
After Width: | Height: | Size: 758 B |
|
After Width: | Height: | Size: 833 B |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 947 B |
|
After Width: | Height: | Size: 627 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1005 B |
|
After Width: | Height: | Size: 998 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 654 B |
|
After Width: | Height: | Size: 958 B |
|
After Width: | Height: | Size: 751 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 742 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1011 B |
|
After Width: | Height: | Size: 952 B |
|
After Width: | Height: | Size: 1009 B |
|
After Width: | Height: | Size: 971 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 911 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 946 B |
|
After Width: | Height: | Size: 595 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 702 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 907 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 888 B |
|
After Width: | Height: | Size: 1019 B |
|
After Width: | Height: | Size: 702 B |
|
After Width: | Height: | Size: 702 B |
|
After Width: | Height: | Size: 702 B |
|
After Width: | Height: | Size: 702 B |
|
After Width: | Height: | Size: 983 B |
|
After Width: | Height: | Size: 880 B |
|
After Width: | Height: | Size: 865 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 944 B |
|
After Width: | Height: | Size: 808 B |
|
After Width: | Height: | Size: 949 B |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 544 B |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 1005 B |
|
After Width: | Height: | Size: 958 B |
|
After Width: | Height: | Size: 849 B |
|
After Width: | Height: | Size: 932 B |
|
After Width: | Height: | Size: 733 B |
|
After Width: | Height: | Size: 728 B |
|
After Width: | Height: | Size: 953 B |
|
After Width: | Height: | Size: 779 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 671 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 678 B |
|
After Width: | Height: | Size: 595 B |
|
After Width: | Height: | Size: 808 B |
|
After Width: | Height: | Size: 903 B |
|
After Width: | Height: | Size: 893 B |
|
After Width: | Height: | Size: 919 B |
|
After Width: | Height: | Size: 989 B |
|
After Width: | Height: | Size: 761 B |
|
After Width: | Height: | Size: 1003 B |
|
After Width: | Height: | Size: 899 B |
|
After Width: | Height: | Size: 880 B |
|
After Width: | Height: | Size: 575 B |
|
After Width: | Height: | Size: 1000 B |
|
After Width: | Height: | Size: 606 B |
|
After Width: | Height: | Size: 1019 B |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1015 B |