devctrl.resources.icon.load_icon#

load_icon(icon_name: str, dark_mode: bool | None = None, fallback: str | None = None, raise_if_no_icon=False) QIcon[source]#

Load an application icon.

When dark_mode is None (the default), the returned QIcon is dynamically theme-aware.

Example:

button.setIcon(load_icon(“search”))

The same QIcon can subsequently render: icons/search.svg or icons-dark/search.svg depending on the current Qt color scheme (the actual directories of the icon depend on the configured search paths).

If dark_mode is explicitly True or False, a normal static QIcon is returned for that specific theme. This is useful for callers that deliberately want to override automatic theme selection.