faq: add icon fallback

This commit is contained in:
outfoxxed 2025-06-07 21:30:37 -07:00
parent f0e3b46627
commit 0fbc2f5584
Signed by: outfoxxed
GPG key ID: 4C88A185FB89301E

View file

@ -52,6 +52,24 @@ inside of them.
} }
``` ```
### Get rid of the purple/black icons
The @@Quickshell.Quickshell.iconPath() function has three variants:
- One draws a purple/black square if the icon is missing.
- One allows you to specify a fallback icon if the desired one is missing.
- One returns an empty string if the icon is missing.
Either of the last two variants can be used to avoid the purple/black square.
Note that you can change out a loader's component conditionally:
```qml
@@QtQuick.Loader {
readonly property Component thing1: ...
readonly property Component thing2: ...
sourceComponent: condition ? thing1 : thing2
}
```
## Something is broken ## Something is broken
### There is a hole in my window ### There is a hole in my window