![]() |
NDEVR
API Documentation
|
Manages all Icons and Pixmaps used by the UI in the NDEVR Engine. More...
Static Public Member Functions | |
| static void | AddIconEngine (NDEVRIconEngine *engine) |
| Registers an icon rendering engine. | |
| static void | addIconTheme (const IconThemeSettings &theme) |
| Registers a new icon theme. | |
| static void | AddResolver (PixmapResolver *resolver) |
| Registers a pixmap resolver for resolving custom pixmap resources. | |
| static QImage | AutoCrop (const QImage &pixmap, int margin=0, bool preserve_ratio=false) |
| Removes transparent borders from an image, optionally adding a margin. | |
| static QImage | CleanupImageForIcon (const QImage &image) |
| Cleans up an image to make it suitable for use as an icon. | |
| static void | ClearWindowIcon (QWidget *widget) |
| Clears the window icon previously set on a widget. | |
| static Buffer< std::pair< LABColor, LABColor > > | ConvertColorPalette (const Buffer< std::pair< RGBColor, RGBColor > > &palette) |
| Converts an RGB color palette to LAB color space for perceptual color operations. | |
| static void | ConvertColorTheme (const Buffer< std::pair< LABColor, LABColor > > &color, QImage &image, bool preserve_brightness, bool preserve_alpha) |
| Applies a LAB color theme conversion directly to a QImage. | |
| static void | ConvertColorTheme (const Buffer< std::pair< RGBColor, RGBColor > > &colors, const Buffer< File > &in, const File &out_location, bool preserve_brightness, bool preserve_alpha, Log *log=nullptr) |
| Converts a set of icon files from one color theme to another. | |
| static void | ConvertColorTheme (const Buffer< std::pair< RGBColor, RGBColor > > &colors, const File &in_location, const File &out_location, bool preserve_brightness, bool preserve_alpha, Log *log=nullptr) |
| Converts icon files at a given location from one color theme to another. | |
| static const QPixmap & | disabledPixmap (const StringView &icon_name) |
| Returns a cached disabled (grayed-out) version of the given icon. | |
| static const IconThemeSettings & | EffectiveIconTheme () |
| Returns the currently effective icon theme, accounting for any overrides. | |
| static QImage | FillBackground (const QImage &pixmap, RGBColor color) |
| Fills the transparent background of an image with the specified color. | |
| static void | GetIconResource (const std::function< void(const StringView &, const QIcon &)> &on_finished, const StringView &icon, const IconThemeSettings &theme, QIcon::Mode mode=QIcon::Mode::Normal) |
| Asynchronously fetches an icon resource using a specific theme, invoking the callback when ready. | |
| static void | GetIconResource (const std::function< void(const StringView &, const QIcon &)> &on_finished, const StringView &icon, QIcon::Mode mode=QIcon::Mode::Normal) |
| Asynchronously fetches an icon resource using the current theme, invoking the callback when ready. | |
| static QIcon | GetIconResourceBlocking (const StringView &icon, const IconThemeSettings &theme, QIcon::Mode mode=QIcon::Mode::Normal) |
| Synchronously fetches an icon resource using a specific theme. | |
| static QIcon | GetIconResourceBlocking (const StringView &icon, QIcon::Mode mode=QIcon::Mode::Normal) |
| Synchronously fetches an icon resource using the current theme. | |
| static void | GetPixmapResource (const std::function< void(const StringView &, const QPixmap &)> &on_finished, const StringView &pixmap, QIcon::Mode mode=QIcon::Mode::Normal, const QSize &requested_size=QSize()) |
| Asynchronously fetches a pixmap resource, invoking the callback when ready. | |
| static String | GetSVGPath (const StringView &icon, const IconThemeSettings &theme) |
| Returns the file path to an SVG icon resource for the given theme. | |
| static String | IconCacheLocation (const StringView &icon, const IconThemeSettings &theme) |
| Returns the cache file path for a rendered icon. | |
| static const Buffer< IconThemeSettings > & | iconThemes () |
| Returns all registered icon themes. | |
| static String | ImageCacheLocation (const StringView &icon) |
| Returns the cache file path for a rendered image. | |
| static QPixmap | LocalPixmapResource (const StringView &pixmap, QIcon::Mode mode=QIcon::Mode::Normal, const QSize &requested_size=QSize()) |
| Synchronously resolves a local pixmap resource. | |
| static const IconThemeSettings & | NDEVRIconTheme () |
| Returns the default NDEVR icon theme. | |
| static constexpr const char * | NDEVRThemeLocation () |
| Returns the file path prefix for the default NDEVR icon theme resources. | |
| static const IconThemeSettings & | OutlineIconTheme () |
| Returns the built-in outline icon theme. | |
| static void | PostIconResourceLoad (const StringView &id) |
| Notifies any pending callbacks that an icon resource has finished loading. | |
| static bool | RequestSet (const StringView &pixmap_resource, QPixmap map, QIcon::Mode mode=QIcon::Mode::Normal) |
| Stores a pixmap for the given resource identifier in available resolvers. | |
| static void | SetLightingTheme (const IconThemeSettings &theme) |
| Sets the user's icon theme. | |
| static void | SetOverrideTheme (IconThemeSettings *theme) |
| Sets a temporary override theme that takes precedence over the user's saved theme. | |
| static void | SetWindowIcon (const StringView &s, QWidget *widget) |
| Sets the window icon for a widget to the specified icon resource. | |
Static Public Attributes | |
| static Resource< IconThemeSettings > | s_icon_theme |
| Resource holding the user's selected icon theme. | |
| static Resource< IconThemeSettings * > | s_overide_icon_theme |
| Resource holding the override icon theme pointer. | |
Static Protected Member Functions | |
| static File | GetImagePath (const StringView &icon) |
| Returns the file path for an image resource. | |
| static QIcon | icon (const StringView &icon, const IconThemeSettings &theme, QIcon::Mode mode=QIcon::Mode::Normal) |
| Resolves an icon using a specific theme. | |
| static QIcon | icon (const StringView &icon, QIcon::Mode mode=QIcon::Mode::Normal) |
| Resolves an icon using the current theme. | |
| static QPixmap | pixmap (const StringView &pixmap, QIcon::Mode mode=QIcon::Mode::Normal, const QSize &requested_size=QSize()) |
| Resolves a pixmap resource. | |
Manages all Icons and Pixmaps used by the UI in the NDEVR Engine.
Icons may be fetched remotely so callbacks are used to specify the action to take when the resource is retrieved.
Definition at line 242 of file QTIconManager.h.
|
static |
Registers an icon rendering engine.
| [in] | engine | The engine to add. |
|
static |
Registers a new icon theme.
| [in] | theme | The icon theme settings to add. |
|
static |
Registers a pixmap resolver for resolving custom pixmap resources.
| [in] | resolver | The resolver to add. |
|
static |
|
static |
Cleans up an image to make it suitable for use as an icon.
| [in] | image | The source image. |
|
static |
Clears the window icon previously set on a widget.
| [in] | widget | The widget whose window icon to clear. |
|
static |
Converts an RGB color palette to LAB color space for perceptual color operations.
| [in] | palette | The RGB color pairs to convert. |
|
static |
Applies a LAB color theme conversion directly to a QImage.
| [in] | color | The LAB color mapping pairs. |
| [in] | image | The image to modify in-place. |
| [in] | preserve_brightness | Whether to preserve the original brightness. |
| [in] | preserve_alpha | Whether to preserve the original alpha channel. |
|
static |
Converts a set of icon files from one color theme to another.
| [in] | colors | The RGB color mapping pairs (source to destination). |
| [in] | in | The input files to convert. |
| [in] | out_location | The output directory for converted files. |
| [in] | preserve_brightness | Whether to preserve the original brightness of pixels. |
| [in] | preserve_alpha | Whether to preserve the original alpha channel. |
| [in] | log | Optional log for reporting progress or errors. |
|
static |
Converts icon files at a given location from one color theme to another.
| [in] | colors | The RGB color mapping pairs (source to destination). |
| [in] | in_location | The input directory containing files to convert. |
| [in] | out_location | The output directory for converted files. |
| [in] | preserve_brightness | Whether to preserve the original brightness of pixels. |
| [in] | preserve_alpha | Whether to preserve the original alpha channel. |
| [in] | log | Optional log for reporting progress or errors. |
|
static |
Returns a cached disabled (grayed-out) version of the given icon.
| [in] | icon_name | The icon resource identifier. |
|
static |
Returns the currently effective icon theme, accounting for any overrides.
|
static |
|
static |
Asynchronously fetches an icon resource using a specific theme, invoking the callback when ready.
| [in] | on_finished | Callback receiving the icon name and the resolved QIcon. |
| [in] | icon | The icon resource identifier. |
| [in] | theme | The icon theme settings to apply. |
| [in] | mode | The icon mode. |
References icon().
|
static |
|
static |
|
static |
Synchronously fetches an icon resource using the current theme.
| [in] | icon | The icon resource identifier. |
| [in] | mode | The icon mode. |
References icon().
Referenced by BuildActionProgramLogic::addMenuItems().
|
staticprotected |
|
static |
|
static |
|
staticprotected |
|
staticprotected |
Resolves an icon using the current theme.
| [in] | icon | The icon resource identifier. |
| [in] | mode | The icon mode. |
References icon().
Referenced by GetIconResource(), GetIconResource(), GetIconResourceBlocking(), GetIconResourceBlocking(), GetImagePath(), GetSVGPath(), icon(), icon(), IconCacheLocation(), and ImageCacheLocation().
|
static |
|
static |
Returns all registered icon themes.
|
static |
|
static |
|
static |
|
inlinestaticconstexpr |
Returns the file path prefix for the default NDEVR icon theme resources.
Definition at line 419 of file QTIconManager.h.
|
static |
Returns the built-in outline icon theme.
|
staticprotected |
Resolves a pixmap resource.
| [in] | pixmap | The pixmap resource identifier. |
| [in] | mode | The icon mode. |
| [in] | requested_size | The desired pixmap size. |
References pixmap().
Referenced by AutoCrop(), FillBackground(), GetPixmapResource(), LocalPixmapResource(), and pixmap().
|
static |
Notifies any pending callbacks that an icon resource has finished loading.
| [in] | id | The resource identifier that was loaded. |
|
static |
Stores a pixmap for the given resource identifier in available resolvers.
| [in] | pixmap_resource | The resource identifier. |
| [in] | map | The pixmap to store. |
| [in] | mode | The icon mode. |
|
static |
Sets the user's icon theme.
The selection is persisted to INI files for the next session.
| [in] | theme | The icon theme settings to apply. |
|
static |
Sets a temporary override theme that takes precedence over the user's saved theme.
| [in] | theme | Pointer to the override theme settings, or nullptr to clear. |
|
static |
Sets the window icon for a widget to the specified icon resource.
| [in] | s | The icon resource identifier. |
| [in] | widget | The widget whose window icon to set. |