Tab manager responsible for integrating plugin-provided views into the UI.
More...
#include <plugin_tab.h>
|
| struct | PluginData |
| | Internal data structure storing information about a plugin tab. More...
|
|
| void | openView (const QString &name, PluginView *view) |
| | Signal emitted when a plugin view should be opened.
|
| void | closeView (PluginView *view) |
| | Signal emitted when a plugin view should be closed.
|
|
| | PluginTab (QMenu *menu, QObject *parent=nullptr) |
| | Constructs a PluginTab instance.
|
| void | updateScene (const QString &name) override |
| | Updates the scene associated with a plugin tab.
|
| void | openScene (const QString &name) override |
| | Opens the scene associated with a plugin tab.
|
| maki::Theme | currentTheme () override |
| | Returns the currently active theme variables.
|
| void | registerPlugin (const QString &name, std::function< VoidResult(QGraphicsScene *scene)> callback) override |
| | Registers a plugin-provided tab.
|
| void | deregisterPlugin (const QString &name) override |
| | Deregisters a plugin.
|
| void | onThemeChanged () |
| | Notifies the tab that the application theme has changed.
|
|
| maki::Theme | qlementineToMaki (const oclero::qlementine::Theme &theme) const |
| | Converts a qlementine theme to the maki theme.
|
|
|
QMenu * | mMenu |
| | Menu where plugin tabs are registered as actions.
|
|
QMap< QString, PluginData > | mTabs |
| | Mapping between plugin names and their associated data.
|
Tab manager responsible for integrating plugin-provided views into the UI.
PluginTab allows external plugins to register graphical views that operate on a QGraphicsScene. Each plugin registers a callback that populates a scene when the tab is opened or updated. The class also integrates plugin entries into the application menu and propagates theme changes to the plugin views.
◆ PluginTab()
| PluginTab::PluginTab |
( |
QMenu * | menu, |
|
|
QObject * | parent = nullptr ) |
Constructs a PluginTab instance.
- Parameters
-
| menu | Menu where plugin entries will be added. |
| parent | Optional Qt parent object. |
◆ closeView
Signal emitted when a plugin view should be closed.
The UI layer can connect to this signal to close the view associated with the plugin.
- Parameters
-
◆ currentTheme()
| maki::Theme PluginTab::currentTheme |
( |
| ) |
|
|
override |
Returns the currently active theme variables.
Plugins may use these variables to style their visual components consistently with the rest of the application.
- Returns
- The current theme variable set.
◆ deregisterPlugin()
| void PluginTab::deregisterPlugin |
( |
const QString & | name | ) |
|
|
override |
Deregisters a plugin.
- Parameters
-
| name | Name of the plugin to be deregsitered. |
◆ onThemeChanged()
| void PluginTab::onThemeChanged |
( |
| ) |
|
Notifies the tab that the application theme has changed.
This allows plugin views to update their styling according to the new theme.
◆ openScene()
| void PluginTab::openScene |
( |
const QString & | name | ) |
|
|
override |
Opens the scene associated with a plugin tab.
Emits a signal that allows the UI to display the corresponding PluginView.
- Parameters
-
| name | Name of the plugin tab to open. |
◆ openView
| void PluginTab::openView |
( |
const QString & | name, |
|
|
PluginView * | view ) |
|
signal |
Signal emitted when a plugin view should be opened.
The UI layer can connect to this signal to display the view associated with the plugin.
- Parameters
-
| name | Name of the plugin tab. |
| view | Pointer to the PluginView instance. |
◆ qlementineToMaki()
| maki::Theme PluginTab::qlementineToMaki |
( |
const oclero::qlementine::Theme & | theme | ) |
const |
|
private |
Converts a qlementine theme to the maki theme.
- Parameters
-
| theme | The qlemetine theme to be converted |
- Returns
- A maki::Theme corresponding to the qlementine theme
◆ registerPlugin()
| void PluginTab::registerPlugin |
( |
const QString & | name, |
|
|
std::function< VoidResult(QGraphicsScene *scene)> | callback ) |
|
override |
Registers a plugin-provided tab.
The plugin provides a callback that receives a QGraphicsScene and populates it with its visual content.
- Parameters
-
| name | Name of the plugin tab. |
| callback | Function responsible for populating the scene. |
◆ updateScene()
| void PluginTab::updateScene |
( |
const QString & | name | ) |
|
|
override |
Updates the scene associated with a plugin tab.
This triggers the plugin callback responsible for populating or refreshing the scene content.
- Parameters
-
| name | Name of the plugin tab to update. |
The documentation for this class was generated from the following files:
- /__w/maki/maki/app/system/plugin_tab.h
- /__w/maki/maki/app/system/plugin_tab.cpp