From 14f418840190da653b423ceefd1b3042272cf34e Mon Sep 17 00:00:00 2001 From: TriKriSta Date: Tue, 17 Mar 2020 15:12:01 +0200 Subject: [PATCH] refactor: save friendScroll as a class member --- src/widget/contentdialog.cpp | 4 ++-- src/widget/contentdialog.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/widget/contentdialog.cpp b/src/widget/contentdialog.cpp index 2fdf5b64b..ff3077b11 100644 --- a/src/widget/contentdialog.cpp +++ b/src/widget/contentdialog.cpp @@ -82,7 +82,7 @@ ContentDialog::ContentDialog(const Core &core, QWidget* parent) onGroupchatPositionChanged(s.getGroupchatPosition()); - QScrollArea* friendScroll = new QScrollArea(this); + friendScroll = new QScrollArea(this); friendScroll->setMinimumWidth(minWidget); friendScroll->setFrameStyle(QFrame::NoFrame); friendScroll->setLayoutDirection(Qt::RightToLeft); @@ -438,7 +438,7 @@ void ContentDialog::setUsername(const QString& newName) void ContentDialog::reloadTheme() { setStyleSheet(Style::getStylesheet("contentDialog/contentDialog.css")); - splitter->widget(0)->setStyleSheet(Style::getStylesheet("friendList/friendList.css")); + friendScroll->setStyleSheet(Style::getStylesheet("friendList/friendList.css")); } bool ContentDialog::event(QEvent* event) diff --git a/src/widget/contentdialog.h b/src/widget/contentdialog.h index b279dfd0d..8e6d6386c 100644 --- a/src/widget/contentdialog.h +++ b/src/widget/contentdialog.h @@ -44,6 +44,7 @@ class GroupChatroom; class GroupWidget; class QCloseEvent; class QSplitter; +class QScrollArea; class ContentDialog : public ActivateDialog, public IDialogs { @@ -122,6 +123,7 @@ private: private: QList layouts; QSplitter* splitter; + QScrollArea* friendScroll; FriendListLayout* friendLayout; GenericChatItemLayout groupLayout; ContentLayout* contentLayout;