Browse Source

refactor: save friendScroll as a class member

pull/5934/head
TriKriSta 5 years ago committed by Anthony Bilinski
parent
commit
14f4188401
No known key found for this signature in database
GPG Key ID: 2AA8E0DA1B31FB3C
  1. 4
      src/widget/contentdialog.cpp
  2. 2
      src/widget/contentdialog.h

4
src/widget/contentdialog.cpp

@ -82,7 +82,7 @@ ContentDialog::ContentDialog(const Core &core, QWidget* parent)
onGroupchatPositionChanged(s.getGroupchatPosition()); onGroupchatPositionChanged(s.getGroupchatPosition());
QScrollArea* friendScroll = new QScrollArea(this); friendScroll = new QScrollArea(this);
friendScroll->setMinimumWidth(minWidget); friendScroll->setMinimumWidth(minWidget);
friendScroll->setFrameStyle(QFrame::NoFrame); friendScroll->setFrameStyle(QFrame::NoFrame);
friendScroll->setLayoutDirection(Qt::RightToLeft); friendScroll->setLayoutDirection(Qt::RightToLeft);
@ -438,7 +438,7 @@ void ContentDialog::setUsername(const QString& newName)
void ContentDialog::reloadTheme() void ContentDialog::reloadTheme()
{ {
setStyleSheet(Style::getStylesheet("contentDialog/contentDialog.css")); 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) bool ContentDialog::event(QEvent* event)

2
src/widget/contentdialog.h

@ -44,6 +44,7 @@ class GroupChatroom;
class GroupWidget; class GroupWidget;
class QCloseEvent; class QCloseEvent;
class QSplitter; class QSplitter;
class QScrollArea;
class ContentDialog : public ActivateDialog, public IDialogs class ContentDialog : public ActivateDialog, public IDialogs
{ {
@ -122,6 +123,7 @@ private:
private: private:
QList<QLayout*> layouts; QList<QLayout*> layouts;
QSplitter* splitter; QSplitter* splitter;
QScrollArea* friendScroll;
FriendListLayout* friendLayout; FriendListLayout* friendLayout;
GenericChatItemLayout groupLayout; GenericChatItemLayout groupLayout;
ContentLayout* contentLayout; ContentLayout* contentLayout;

Loading…
Cancel
Save