![]() |
LeechCraft
0.6.70-15082-g543737046d
Modular cross-platform feature rich live environment.
|
Interface for accessing LeechCraft-wide icons manager. More...
#include "iiconthememanager.h"
Public Member Functions | |
virtual QIcon | GetIcon (const QString &on, const QString &off=QString())=0 |
Returns the current theme's icon for the given on and off states. More... | |
virtual void | UpdateIconset (const QList< QAction * > &actions)=0 |
Updates the icons of the given actions. More... | |
virtual void | ManageWidget (QWidget *widget)=0 |
Watches the given widget recursively and its child actions. More... | |
virtual void | RegisterChangeHandler (const std::function< void()> &function)=0 |
Registers the theme change handler. More... | |
virtual QIcon | GetPluginIcon ()=0 |
virtual QIcon | GetPluginIcon (const QString &name)=0 |
Protected Member Functions | |
virtual | ~IIconThemeManager () |
Interface for accessing LeechCraft-wide icons manager.
The icon theme manager provides access to actions icon sets managed globally in LeechCraft.
The icons are identified by their Freedesktop.org-like name, and they should be contained at least in the KDE's Oxygen icon theme.
Icons may be retrieved via the GetIcon() method, and actions (QAction subclasses) can be automatically set with a proper icon by setting their ActionIcon dynamic property to the name of the desired icon. This way they will also be automatically updated if the iconset changes.
Please note that the ActionIcon property should be set before QAction (or its parent) widget is exposed to the rest oF LeechCraft (for example, a menu embedded into a ITabWidget-implementing tab, or an ITabWidget added to LeechCrat windows). Otherwise, UpdateIconset() should be called on the actions for them to be registered.
Definition at line 38 of file iiconthememanager.h.
|
inlineprotectedvirtual |
Definition at line 41 of file iiconthememanager.h.
|
pure virtual |
Returns the current theme's icon for the given on and off states.
The name should match the Freedesktop.org's icons naming scheme and be contained at least in the KDE's Oxygen iconset.
[in] | on | The name of the icon in the "on" state. |
[in] | off | The name of the icon in the "off" state, if any. |
|
pure virtual |
|
pure virtual |
|
pure virtual |
Watches the given widget recursively and its child actions.
This function merely installs the event filter on the given widget to watch for new actions or action changes.
[in] | widget | The widget to manage. |
|
pure virtual |
Registers the theme change handler.
The given function will be invoked after each icon theme change.
[in] | function | The function to invoke after theme change. |
|
pure virtual |
Updates the icons of the given actions.
This function sets or updates the icons of actions according to the current iconset. This function also registers the actions so that they are automatically updated when the iconset changes, analogously to ManageWidget().
[in] | actions | The list of actions to update. |