|
| virtual void | updateIcon (QObject *widget, const DtQIconConfigurations &iconConfigurations, bool lightDarkModeIconsEnabled) |
| | Helper function to update a single widget that uses the provided icon file name. More...
|
| |
| virtual void | updateIndexedIcon (QObject *indexedWidget, const DtIndexableQIconConfigurations &iconConfigurations, bool lightDarkModeIconsEnabled) |
| | Helper function to update a single widget that uses the provided icon file name. More...
|
| |
| virtual QPixmap | findOrCreatePixmapInCache (const std::string &filePath) |
| | Helper function for getting the QPixmap for the associated asset pointed to by the provided filePath from the manager's QPixmap cache. More...
|
| |
| virtual std::string | iconsDirectory (const std::string &iconFileNameOrPath) const |
| | Helper function to get the base icons directory associated with the provided icon file name or path. More...
|
| |
| virtual bool | iconExistsOnDiskOrInCache (const std::string &iconFilePath) const |
| | Helper function that returns whether or not provided iconFilePath exists on disk or is present in the icon cache. More...
|
| |
| virtual bool | getPixmapFromSVGAndColorMappings (const std::string &iconFileNameOrPath, const std::vector< std::pair< QColor, QColor >> colorMappings, QPixmap &resultIcon) const |
| | Helper function that creates a modified version of an icon asset. More...
|
| |
| MAKLogger::DtWidgetIconStyleManager::DtWidgetIconStyleManager |
( |
QMainWindow * |
mainWindow | ) |
|
| virtual MAKLogger::DtWidgetIconStyleManager::~DtWidgetIconStyleManager |
( |
| ) |
|
|
virtual |
| virtual void MAKLogger::DtWidgetIconStyleManager::clearCache |
( |
bool |
refreshIcons = true | ) |
|
|
virtual |
Clear the cache of QPixmap objects that are used to set the icons.
- Parameters
-
| refreshIcons | If true, update all managed widgets after clearing the cache. |
| virtual QIcon MAKLogger::DtWidgetIconStyleManager::createQIconBasedOnConfigurations |
( |
const DtQIconConfigurations & |
configurations | ) |
|
|
virtual |
Helper function for creating a QIcon based on a DtQIconConfigurations.
- Parameters
-
| configurations | The VRV-specific configurations to convert to a QIcon |
| virtual QPixmap MAKLogger::DtWidgetIconStyleManager::findOrCreatePixmapInCache |
( |
const std::string & |
filePath | ) |
|
|
protectedvirtual |
Helper function for getting the QPixmap for the associated asset pointed to by the provided filePath from the manager's QPixmap cache.
This function will create a QPixmap and cache it if one does not exist in the cache already.
| virtual void MAKLogger::DtWidgetIconStyleManager::generateAndAppendAdditionalIconConfigurationsIfNeeded |
( |
QIcon & |
iconToAppendToIfNeeded, |
|
|
const DtQIconConfigurations & |
iconConfigurations |
|
) |
| const |
|
virtual |
Helper function to generate additional icon configurations, if needed Additional icon configurations need to be generated if the flags maintained by the collection of configurations indicate they should be generated.
The behavior of the generation depends on the QIcon::Mode.
o If Qicon::Mode::Disabled configurations are being generated, the behavior is as follows:
- If the user defines icon configurations for QIcon::Mode::Disabled, then use those to generate the new disabled versions of the icon.
- If the user defines icon configurations for QIcon::Mode::Normal, then use those to generate the new disabled versions of the icon.
- Otherwise, do nothing and output an INFO-level warning to the console.
o If Qicon::Mode::Normal configurations are being generated, the behavior is as follows:
- If the user defines icon configurations for QIcon::Mode::Normal, then use those to generate the new normal versions of the icon.
- Otherwise, do nothing and output an INFO-level warning to the console.
Generation in this context means we create a modified version of a provided icon configuration. The modified version is the same as the provided icon configuration and only differs in the colors it uses. The colors to use for generated icons come from mappings present in the stylesheet of the application and that are maintained by the main window of the application.
- See Also
- DtLgrMainWindow
| virtual QPixmap MAKLogger::DtWidgetIconStyleManager::generateThemedPixmapFromSVGAndIconMode |
( |
const std::string & |
iconFileNameOrPath, |
|
|
QIcon::Mode |
iconModeOfGeneratedPixmap = QIcon::Normal |
|
) |
| const |
|
virtual |
Helper function for generating a pixmap from an SVG and the desired mode for the pixmap The generated SVG is a modified version of the SVG pointed to by the provided icon file name/path with a different set of colors.
The colors of the SVG are swapped out with other colors based on mappings maintained by the main window.
- See Also
- DtLgrMainWindow::iconColorMappingsByMode
Reimplemented in MAKLogger::DtRemoteWidgetIconStyleManager.
| virtual bool MAKLogger::DtWidgetIconStyleManager::getPixmapFromSVGAndColorMappings |
( |
const std::string & |
iconFileNameOrPath, |
|
|
const std::vector< std::pair< QColor, QColor >> |
colorMappings, |
|
|
QPixmap & |
resultIcon |
|
) |
| const |
|
protectedvirtual |
Helper function that creates a modified version of an icon asset.
This function assumes the icon asset is an SVG. The modified version of the SVG swaps out colors with other colors defined in the provided color mappings. If the icon asset is not a SVG, then just return a QPixmap with the icon asset loaded.
| virtual bool MAKLogger::DtWidgetIconStyleManager::iconExistsOnDiskOrInCache |
( |
const std::string & |
iconFilePath | ) |
const |
|
protectedvirtual |
Helper function that returns whether or not provided iconFilePath exists on disk or is present in the icon cache.
| virtual std::string MAKLogger::DtWidgetIconStyleManager::iconsDirectory |
( |
const std::string & |
iconFileNameOrPath | ) |
const |
|
protectedvirtual |
Helper function to get the base icons directory associated with the provided icon file name or path.
| virtual void MAKLogger::DtWidgetIconStyleManager::manageIndexableWidget |
( |
QObject * |
indexedWidgetToManage, |
|
|
int |
index, |
|
|
const DtQIconConfigurations & |
iconConfigurations |
|
) |
| |
|
virtual |
Add a new indexable widget to the manager.
The manager will now manage the icon style for the widget.
- Parameters
-
| widgetToManage | The indexable widget to manage the icon for. |
| index | The index of the widget the icon configurations will be applied to. |
| iconConfigurations | The configurations for the widget's icon. |
| virtual void MAKLogger::DtWidgetIconStyleManager::manageWidget |
( |
QObject * |
widgetToManage, |
|
|
const std::string & |
iconFileNameOrPath |
|
) |
| |
|
virtual |
Add a new widget to the manager.
The manager will now manage the icon style for the widget.
- Parameters
-
| widgetToManage | The widget to manage the icon for. |
| iconFileNameOrFilePath | The file name of the icon asset OR the file path to the icon asset. |
| virtual void MAKLogger::DtWidgetIconStyleManager::manageWidget |
( |
QObject * |
widgetToManage, |
|
|
const DtQIconConfigurations & |
iconConfigurations |
|
) |
| |
|
virtual |
Add a new widget to the manager.
The manager will now manage the icon style for the widget.
- Parameters
-
| widgetToManage | The widget to manage the icon for. |
| iconConfigurations | The configurations for the widget's icon. |
| virtual void MAKLogger::DtWidgetIconStyleManager::rotateIcon |
( |
QTabWidget * |
myTabs, |
|
|
int |
deg, |
|
|
QIcon & |
icon |
|
) |
| |
|
virtual |
Takes an icon's pixmap and rotates it by the specified amount.
These newly rotated pixmaps are then added to the icon.
| virtual void MAKLogger::DtWidgetIconStyleManager::unmanageWidget |
( |
QObject * |
widgetToManage | ) |
|
|
virtual |
Remove a new widget the manager.
The manager will not manage the icon style.
- Parameters
-
| widgetToManage | The (non)indexable widget to no longer manage. |
| virtual void MAKLogger::DtWidgetIconStyleManager::updateAllManagedIcons |
( |
bool |
lightDarkModeIconsEnabled | ) |
|
|
virtual |
Update all managed icons based on application settings.
| virtual void MAKLogger::DtWidgetIconStyleManager::updateIcon |
( |
QObject * |
widget, |
|
|
const DtQIconConfigurations & |
iconConfigurations, |
|
|
bool |
lightDarkModeIconsEnabled |
|
) |
| |
|
protectedvirtual |
Helper function to update a single widget that uses the provided icon file name.
| virtual void MAKLogger::DtWidgetIconStyleManager::updateIndexedIcon |
( |
QObject * |
indexedWidget, |
|
|
const DtIndexableQIconConfigurations & |
iconConfigurations, |
|
|
bool |
lightDarkModeIconsEnabled |
|
) |
| |
|
protectedvirtual |
Helper function to update a single widget that uses the provided icon file name.
Event filter to detect changes to enable state of some widget types.
| std::map<std::string, QPixmap> MAKLogger::DtWidgetIconStyleManager::myFilepathsToPixmapCache |
|
protected |
Mapping a filepath to the cached QPixmap for the asset pointed to by the filepath.
Mapping an indexed QObject (UI element with indices where each index can have an icon) and its configuration.
| QMainWindow* MAKLogger::DtWidgetIconStyleManager::myMainWindow |
|
protected |
Store a pointer to the main window.
Mapping a QObject (UI element with the icon) and its configuration.
The documentation for this class was generated from the following file: