diff --git a/src/widgets/settingspages/PluginsPage.cpp b/src/widgets/settingspages/PluginsPage.cpp index 245e69b8e..7b195f74f 100644 --- a/src/widgets/settingspages/PluginsPage.cpp +++ b/src/widgets/settingspages/PluginsPage.cpp @@ -11,16 +11,24 @@ #include #include #include +#include namespace chatterino { PluginsPage::PluginsPage() + : scrollArea_(nullptr) { LayoutCreator layoutCreator(this); + this->scrollArea_ = layoutCreator.emplace(); - auto scroll = layoutCreator.emplace(); - auto widget = scroll.emplaceScrollAreaWidget(); - removeScrollAreaBackground(scroll.getElement(), widget.getElement()); + this->rebuildContent(); +} + +void PluginsPage::rebuildContent() +{ + auto widget = this->scrollArea_.emplaceScrollAreaWidget(); + removeScrollAreaBackground(this->scrollArea_.getElement(), + widget.getElement()); auto layout = widget.setLayoutType(); auto group = layout.emplace("Plugins"); @@ -76,9 +84,11 @@ PluginsPage::PluginsPage() pl->addRow("Used libraries", libs); auto *reload = new QPushButton("Reload"); - QObject::connect(reload, &QPushButton::pressed, [name = codename]() { - getApp()->plugins->reload(name); - }); + QObject::connect(reload, &QPushButton::pressed, + [name = codename, this]() { + getApp()->plugins->reload(name); + this->rebuildContent(); + }); pl->addRow(reload); } } diff --git a/src/widgets/settingspages/PluginsPage.hpp b/src/widgets/settingspages/PluginsPage.hpp index ce6296ab1..27d664dce 100644 --- a/src/widgets/settingspages/PluginsPage.hpp +++ b/src/widgets/settingspages/PluginsPage.hpp @@ -1,9 +1,20 @@ #pragma once +#include "util/LayoutCreator.hpp" #include "widgets/settingspages/SettingsPage.hpp" + +#include +#include namespace chatterino { +class Plugin; + class PluginsPage : public SettingsPage { public: PluginsPage(); + +private: + void rebuildContent(); + + LayoutCreator scrollArea_; }; } // namespace chatterino