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

recreate views when indicators update

This commit is contained in:
Michail Vourlakos 2019-06-20 10:57:59 +03:00
parent a9310a3de3
commit caefba4576
3 changed files with 9 additions and 0 deletions

View File

@ -65,6 +65,7 @@ Factory::Factory(QObject *parent)
connect(KDirWatch::self(), &KDirWatch::dirty, this, [ & ](const QString & path) {
if (m_watchedPaths.contains(path)) {
reload();
emit pluginsUpdated();
}
});

View File

@ -64,6 +64,7 @@ public:
static Latte::Types::ImportExportState importIndicatorFile(QString compressedFile);
signals:
void customPluginsChanged();
void pluginsUpdated();
private:
void reload();

View File

@ -62,6 +62,13 @@ Indicator::Indicator(Latte::View *parent)
emit customPluginsChanged();
});
connect(m_corona->indicatorFactory(), &Latte::Indicator::Factory::pluginsUpdated, [this]() {
if (m_view && m_view->layout()) {
m_view->layout()->recreateView(m_view->containment());
}
});
connect(this, &Indicator::pluginChanged, [this]() {
if ((m_type != "org.kde.latte.default") && m_type != "org.kde.latte.plasma") {
setCustomType(m_type);