diff --git a/src/CommunitiesList.cpp b/src/CommunitiesList.cpp
index 2fb8731cd76a9f04f438d246639ca1c7894217d0..bb57ca405b4e9ad33ac070a78b02bf332a4ca922 100644
--- a/src/CommunitiesList.cpp
+++ b/src/CommunitiesList.cpp
@@ -30,16 +30,14 @@ CommunitiesList::CommunitiesList(QWidget *parent)
         scrollArea_->setWidgetResizable(true);
         scrollArea_->setAlignment(Qt::AlignLeading | Qt::AlignTop | Qt::AlignVCenter);
 
-        scrollAreaContents_ = new QWidget();
-
-        contentsLayout_ = new QVBoxLayout(scrollAreaContents_);
+        contentsLayout_ = new QVBoxLayout();
         contentsLayout_->setSpacing(0);
         contentsLayout_->setMargin(0);
 
         addGlobalItem();
         contentsLayout_->addStretch(1);
 
-        scrollArea_->setWidget(scrollAreaContents_);
+        scrollArea_->setLayout(contentsLayout_);
         topLayout_->addWidget(scrollArea_);
 
         connect(
diff --git a/src/CommunitiesList.h b/src/CommunitiesList.h
index e8042666d7d8c4dfc9d055fd3d3c58f39916d817..d3cbeeff6531a9104b3595c67533dcefa57c132a 100644
--- a/src/CommunitiesList.h
+++ b/src/CommunitiesList.h
@@ -53,7 +53,6 @@ private:
 
         QVBoxLayout *topLayout_;
         QVBoxLayout *contentsLayout_;
-        QWidget *scrollAreaContents_;
         QScrollArea *scrollArea_;
 
         std::map<QString, QSharedPointer<CommunitiesListItem>> communities_;