intellicrack.ui.resources.icon_manager

Icon management for Intellicrack UI.

Provides centralized icon loading with caching and fallback support.

class IconManager[source]

Bases: object

Singleton icon manager with caching and fallback support.

Provides centralized icon loading for the Intellicrack UI with performance optimization through caching and graceful degradation when icon files are not available.

__init__()[source]

Initialize the IconManager instance.

Return type:

None

classmethod get_instance()[source]

Get the singleton instance of IconManager.

Returns:

The IconManager singleton instance.

Return type:

IconManager

classmethod reset_instance()[source]

Reset the singleton instance (primarily for testing).

Return type:

None

get_icon(name, size=24)[source]

Get an icon by name with caching.

Parameters:
  • name (str) – Icon name (key in ICON_MAP or filename without extension).

  • size (int) – Preferred icon size in pixels.

Returns:

QIcon instance (may be empty if icon not found and no fallback).

Return type:

QIcon

get_pixmap(name, size=24)[source]

Get a pixmap by icon name.

Parameters:
  • name (str) – Icon name.

  • size (int) – Desired pixmap size.

Returns:

QPixmap of the requested size.

Return type:

QPixmap

get_app_icon()[source]

Get the main application icon.

Returns:

QIcon for the application window and taskbar.

Return type:

QIcon

get_status_icon(*, success)[source]

Get a status icon indicating success or failure.

Parameters:

success (bool) – True for success icon, False for error icon.

Returns:

Appropriate status icon.

Return type:

QIcon

get_status_pixmap(*, success, size=16)[source]

Get a status pixmap indicating success or failure.

Parameters:
  • success (bool) – True for success, False for error.

  • size (int) – Pixmap size in pixels.

Returns:

Appropriate status pixmap.

Return type:

QPixmap

clear_cache()[source]

Clear all cached icons and pixmaps.

Return type:

None

preload_icons(names=None)[source]

Preload icons into cache for faster access.

Parameters:

names (list[str] | None) – List of icon names to preload. If None, preloads common icons.

Return type:

None

static list_available_icons()[source]

List all available icon names.

Returns:

List of icon names from ICON_MAP.

Return type:

list[str]

icon_exists(name)[source]

Check if an icon file exists.

Parameters:

name (str) – Icon name to check.

Returns:

True if the icon file exists.

Return type:

bool