diff options
author | Konstantinos Sideris <sideris.konstantin@gmail.com> | 2017-11-08 23:09:15 +0200 |
---|---|---|
committer | Konstantinos Sideris <sideris.konstantin@gmail.com> | 2017-11-08 23:09:15 +0200 |
commit | a6b84fac4546d8c6edf3acc366c13bf69a2b6218 (patch) | |
tree | 0f3af33957cdaec58aa4cff7c8e59341be342a92 /src | |
parent | Remove obsolete artifact from appveyor (diff) | |
download | nheko-a6b84fac4546d8c6edf3acc366c13bf69a2b6218.tar.xz |
Remove unnecessary layouts
Diffstat (limited to 'src')
-rw-r--r-- | src/ChatPage.cc | 50 | ||||
-rw-r--r-- | src/RoomList.cc | 9 | ||||
-rw-r--r-- | src/SideBarActions.cc | 3 | ||||
-rw-r--r-- | src/TimelineViewManager.cc | 2 | ||||
-rw-r--r-- | src/TopRoomBar.cc | 3 | ||||
-rw-r--r-- | src/UserInfoWidget.cc | 6 |
6 files changed, 17 insertions, 56 deletions
diff --git a/src/ChatPage.cc b/src/ChatPage.cc index 884e219a..3f9c6fb0 100644 --- a/src/ChatPage.cc +++ b/src/ChatPage.cc @@ -61,64 +61,39 @@ ChatPage::ChatPage(QSharedPointer<MatrixClient> client, QWidget *parent) topLayout_->addWidget(splitter); // SideBar - sideBar_ = new QWidget(this); + sideBar_ = new QFrame(this); sideBar_->setMinimumSize(QSize(ui::sidebar::NormalSize, 0)); sideBarLayout_ = new QVBoxLayout(sideBar_); sideBarLayout_->setSpacing(0); sideBarLayout_->setMargin(0); - sideBarTopLayout_ = new QVBoxLayout(); - sideBarTopLayout_->setSpacing(0); - sideBarTopLayout_->setMargin(0); - sideBarMainLayout_ = new QVBoxLayout(); - sideBarMainLayout_->setSpacing(0); - sideBarMainLayout_->setMargin(0); - sidebarActions_ = new SideBarActions(this); connect( sidebarActions_, &SideBarActions::showSettings, this, &ChatPage::showUserSettingsPage); - sideBarLayout_->addLayout(sideBarTopLayout_); - sideBarLayout_->addLayout(sideBarMainLayout_); - sideBarLayout_->addWidget(sidebarActions_); - - sideBarTopWidget_ = new QWidget(sideBar_); - sideBarTopWidget_->setStyleSheet("background-color: #d6dde3; color: #ebebeb;"); + user_info_widget_ = new UserInfoWidget(sideBar_); + room_list_ = new RoomList(client, sideBar_); - sideBarTopLayout_->addWidget(sideBarTopWidget_); - - sideBarTopWidgetLayout_ = new QVBoxLayout(sideBarTopWidget_); - sideBarTopWidgetLayout_->setSpacing(0); - sideBarTopWidgetLayout_->setMargin(0); + sideBarLayout_->addWidget(user_info_widget_); + sideBarLayout_->addWidget(room_list_); + sideBarLayout_->addWidget(sidebarActions_); // Content - content_ = new QWidget(this); + content_ = new QFrame(this); contentLayout_ = new QVBoxLayout(content_); contentLayout_->setSpacing(0); contentLayout_->setMargin(0); - topBarLayout_ = new QHBoxLayout(); - topBarLayout_->setSpacing(0); - mainContentLayout_ = new QVBoxLayout(); - mainContentLayout_->setSpacing(0); - mainContentLayout_->setMargin(0); + top_bar_ = new TopRoomBar(this); + view_manager_ = new TimelineViewManager(client, this); - contentLayout_->addLayout(topBarLayout_); - contentLayout_->addLayout(mainContentLayout_); + contentLayout_->addWidget(top_bar_); + contentLayout_->addWidget(view_manager_); // Splitter splitter->addWidget(sideBar_); splitter->addWidget(content_); - room_list_ = new RoomList(client, sideBar_); - sideBarMainLayout_->addWidget(room_list_); - - top_bar_ = new TopRoomBar(this); - topBarLayout_->addWidget(top_bar_); - - view_manager_ = new TimelineViewManager(client, this); - mainContentLayout_->addWidget(view_manager_); - text_input_ = new TextInputWidget(this); typingDisplay_ = new TypingDisplay(this); contentLayout_->addWidget(typingDisplay_); @@ -127,9 +102,6 @@ ChatPage::ChatPage(QSharedPointer<MatrixClient> client, QWidget *parent) typingRefresher_ = new QTimer(this); typingRefresher_->setInterval(TYPING_REFRESH_TIMEOUT); - user_info_widget_ = new UserInfoWidget(sideBarTopWidget_); - sideBarTopWidgetLayout_->addWidget(user_info_widget_); - connect(user_info_widget_, SIGNAL(logout()), client_.data(), SLOT(logout())); connect(client_.data(), SIGNAL(loggedOut()), this, SLOT(logout())); diff --git a/src/RoomList.cc b/src/RoomList.cc index c89e4e6e..8f494895 100644 --- a/src/RoomList.cc +++ b/src/RoomList.cc @@ -33,13 +33,6 @@ RoomList::RoomList(QSharedPointer<MatrixClient> client, QWidget *parent) : QWidget(parent) , client_(client) { - setStyleSheet("QWidget { border: none; }"); - - QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); - sizePolicy.setHorizontalStretch(0); - sizePolicy.setVerticalStretch(0); - setSizePolicy(sizePolicy); - topLayout_ = new QVBoxLayout(this); topLayout_->setSpacing(0); topLayout_->setMargin(0); @@ -51,7 +44,7 @@ RoomList::RoomList(QSharedPointer<MatrixClient> client, QWidget *parent) scrollArea_->setWidgetResizable(true); scrollArea_->setAlignment(Qt::AlignLeading | Qt::AlignLeft | Qt::AlignVCenter); - scrollAreaContents_ = new QWidget(); + scrollAreaContents_ = new QWidget(this); contentsLayout_ = new QVBoxLayout(scrollAreaContents_); contentsLayout_->setSpacing(0); diff --git a/src/SideBarActions.cc b/src/SideBarActions.cc index 16579ce3..3e741406 100644 --- a/src/SideBarActions.cc +++ b/src/SideBarActions.cc @@ -9,9 +9,6 @@ SideBarActions::SideBarActions(QWidget *parent) { setFixedHeight(conf::sidebarActions::height); - QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); - setSizePolicy(sizePolicy); - layout_ = new QHBoxLayout(this); layout_->setMargin(0); diff --git a/src/TimelineViewManager.cc b/src/TimelineViewManager.cc index bf2bee76..37feabbe 100644 --- a/src/TimelineViewManager.cc +++ b/src/TimelineViewManager.cc @@ -31,7 +31,7 @@ TimelineViewManager::TimelineViewManager(QSharedPointer<MatrixClient> client, QW : QStackedWidget(parent) , client_(client) { - setStyleSheet("QWidget { background: #fff; color: #e8e8e8; border: none;}"); + setStyleSheet("border: none;"); connect( client_.data(), &MatrixClient::messageSent, this, &TimelineViewManager::messageSent); diff --git a/src/TopRoomBar.cc b/src/TopRoomBar.cc index 25745e1a..7bec888d 100644 --- a/src/TopRoomBar.cc +++ b/src/TopRoomBar.cc @@ -33,8 +33,7 @@ TopRoomBar::TopRoomBar(QWidget *parent) , buttonSize_{32} { setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); - setMinimumSize(QSize(0, 65)); - setStyleSheet("background-color: #fff; color: #171919;"); + setFixedHeight(65); topLayout_ = new QHBoxLayout(); topLayout_->setSpacing(10); diff --git a/src/UserInfoWidget.cc b/src/UserInfoWidget.cc index 2f7dc2ef..f5f3db74 100644 --- a/src/UserInfoWidget.cc +++ b/src/UserInfoWidget.cc @@ -33,9 +33,7 @@ UserInfoWidget::UserInfoWidget(QWidget *parent) , logoutDialog_{nullptr} , logoutButtonSize_{20} { - QSizePolicy sizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed); - setSizePolicy(sizePolicy); - setMinimumSize(QSize(0, 65)); + setFixedHeight(65); topLayout_ = new QHBoxLayout(this); topLayout_->setSpacing(0); @@ -140,6 +138,8 @@ UserInfoWidget::resizeEvent(QResizeEvent *event) displayNameLabel_->show(); userIdLabel_->show(); } + + QWidget::resizeEvent(event); } void |