[Settings] Replace large PNG from Command Palette page with dynamic background generation#43961
[Settings] Replace large PNG from Command Palette page with dynamic background generation#43961daverayment wants to merge 3 commits intomicrosoft:mainfrom
Conversation
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
…sync void method to async Task. Rename method for clarity.
This comment has been minimized.
This comment has been minimized.
@check-spelling-bot Report🔴 Please reviewSee the 📂 files view, the 📜action log, or 📝 job summary for details.Unrecognized words (2)icf These words are not needed and should be removedirdpTo accept these unrecognized words as correct and remove the previously acknowledged and now absent words, you could run the following commands... in a clone of the git@github.com:daverayment/PowerToys.git repository curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/c635c2f3f714eec2fcf27b643a1919b9a811ef2e/apply.pl' |
perl - 'https://github.com/microsoft/PowerToys/actions/runs/19790290644/attempts/1' &&
git commit -m 'Update check-spelling metadata'Errors ❌ (1)See the 📂 files view, the 📜action log, or 📝 job summary for details.
See ❌ Event descriptions for more information. If the flagged items are 🤯 false positivesIf items relate to a ...
|
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@daverayment Oh, just seeing this PR now - this looks really useful for the Windows Community Toolkit, actually? Have you considered adding it? The design team gave us a gradient that is easier to replicate in XAML, so we have replaced the png with a gradient brush in: #44721. Therefore, closing this PR for now. |
Summary of the Pull Request
This PR includes code to separately create gradient fills and noise textures. Together, these are used to replace the textured gradient background for the Command Palette settings page, which saves shipping a 2.15 MB PNG.
PR Checklist
Detailed Description of the Pull Request / Additional comments
A new
BackgroundTextureHelperclass provides helpers to create:ImageSources where you define each corner colour. When assigned to an Image and stretched, the GPU will produce a gradient fill.ImageSourceof the desired dimensions. Anintensityparameter can control the strength of the noise. Combine this with opacity settings on the receiver control to dial in the desired effect.ImageBrush: Creates a noise texture as an ImageBrush.For the Command Palette background, which is at most 1000x560 pixels, this takes a few milliseconds on my slow laptop, so the texture is deliberately not cached.
The Command Palette settings page's code behind assigns the background gradient and texture in a Loaded handler, using the existing Image element for the gradient and a new Rectangle for the texture.
Validation Steps Performed