1
0
mirror of https://github.com/KDE/latte-dock.git synced 2024-12-24 17:33:50 +03:00

expose Colorizer to itw own View c++ class

This commit is contained in:
Michail Vourlakos 2020-07-07 18:33:41 +03:00
parent 7fd56aebfb
commit bf2c7ebbd9
3 changed files with 31 additions and 0 deletions

View File

@ -1230,6 +1230,21 @@ bool View::mimeContainsPlasmoid(QMimeData *mimeData, QString name)
return false;
}
QQuickItem *View::colorizer() const
{
return m_colorizer;
}
void View::setColorizer(QQuickItem *colorizer)
{
if (m_colorizer == colorizer) {
return;
}
m_colorizer = colorizer;
emit colorizerChanged();
}
ViewPart::Effects *View::effects() const
{
return m_effects;

View File

@ -117,6 +117,8 @@ class View : public PlasmaQuick::ContainmentView
Q_PROPERTY(float maxLength READ maxLength WRITE setMaxLength NOTIFY maxLengthChanged)
Q_PROPERTY(float offset READ offset WRITE setOffset NOTIFY offsetChanged)
Q_PROPERTY(QQuickItem *colorizer READ colorizer WRITE setColorizer NOTIFY colorizerChanged)
Q_PROPERTY(Latte::Layout::GenericLayout *layout READ layout WRITE setLayout NOTIFY layoutChanged)
Q_PROPERTY(Latte::ViewPart::Effects *effects READ effects NOTIFY effectsChanged)
Q_PROPERTY(Latte::ViewPart::ContainmentInterface *extendedInterface READ extendedInterface NOTIFY extendedInterfaceChanged)
@ -227,6 +229,9 @@ public:
bool settingsWindowIsShown();
void showSettingsWindow();
QQuickItem *colorizer() const;
void setColorizer(QQuickItem *colorizer);
QQuickView *configView();
ViewPart::Effects *effects() const;
@ -288,6 +293,7 @@ signals:
void alignmentChanged();
void behaveAsPlasmaPanelChanged();
void byPassWMChanged();
void colorizerChanged();
void configWindowGeometryChanged(); // is called from config windows
void containsDragChanged();
void contextMenuIsShownChanged();
@ -414,6 +420,9 @@ private:
int m_releaseGrab_y;
Layout::GenericLayout *m_layout{nullptr};
QQuickItem *m_colorizer{nullptr};
QPointer<PlasmaQuick::ConfigView> m_appletConfigView;
QPointer<ViewPart::PrimaryConfigView> m_primaryConfigView;

View File

@ -272,6 +272,13 @@ Item{
}
}
Binding{
target: latteView
property: "colorizer"
when: latteView
value: colorizerManager
}
//! View::Effects bindings
Binding{
target: latteView && latteView.effects ? latteView.effects : null