Repository navigation
feat: let widgets replace device icons with icons from the user's icon packs - #33
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Lets each widget replace a device's built-in icon with an icon from the user's Macro Deck icon packs, including packs imported from their own images. Requested on Discord, where the tablet icon read as an empty square and a G502 showed the generic battery icon.
UiRepeatinside aUiObjectInputkeyedicons. A repeat opens no id scope, so each picker staysicons.<key>.icons.<row id> = { "type": "icon-pack", "reference": "<icon id>" }.ExternalBatteryDevices.RowKeyfor another plugin's device, because an input key takes no colon.icons.UiResources.GetIconAsync, then re-renders.HostCallRetrynow also retries a rate-limited lookup.Sizethat fills the glyph's box. Without one, the reader draws it at its pixel size.WidgetDevice(source id, icon key, label, own or external) now feeds both the device multi-select and the Icons tab. It replacesDeviceChoices.WidgetIconTests:Not implemented: a per-device default icon in the config flow. Macro Deck's config-flow dialog has no renderer for
Iconfields (anActionParameter.Iconshows as a plain text box), so that waits on the host. Renaming a device drops its icon, the same as the widget's device selection, because the slot id follows the name.Checklist
dotnet buildanddotnet testpass locally (0 warnings, 368 tests).Device/hardware tested against (if applicable)
Not applicable: no device backend changes.