From 9c331905e6cea902abbd5e727d7503de4760d5aa Mon Sep 17 00:00:00 2001 From: Konstantinos Sideris Date: Thu, 9 Nov 2017 00:17:08 +0200 Subject: [PATCH] Fix initial sidebar width --- src/ChatPage.cc | 3 ++- src/MainWindow.cc | 3 --- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/ChatPage.cc b/src/ChatPage.cc index 3f9c6fb0..b07729cf 100644 --- a/src/ChatPage.cc +++ b/src/ChatPage.cc @@ -62,7 +62,7 @@ ChatPage::ChatPage(QSharedPointer client, QWidget *parent) // SideBar sideBar_ = new QFrame(this); - sideBar_->setMinimumSize(QSize(ui::sidebar::NormalSize, 0)); + sideBar_->setMinimumSize(QSize(ui::sidebar::NormalSize, parent->height())); sideBarLayout_ = new QVBoxLayout(sideBar_); sideBarLayout_->setSpacing(0); sideBarLayout_->setMargin(0); @@ -93,6 +93,7 @@ ChatPage::ChatPage(QSharedPointer client, QWidget *parent) // Splitter splitter->addWidget(sideBar_); splitter->addWidget(content_); + splitter->setSizes({ui::sidebar::NormalSize, parent->width() - ui::sidebar::NormalSize}); text_input_ = new TextInputWidget(this); typingDisplay_ = new TypingDisplay(this); diff --git a/src/MainWindow.cc b/src/MainWindow.cc index 9653897d..c5735b68 100644 --- a/src/MainWindow.cc +++ b/src/MainWindow.cc @@ -41,14 +41,11 @@ MainWindow::MainWindow(QWidget *parent) , progressModal_{nullptr} , spinner_{nullptr} { - QSizePolicy sizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); - setSizePolicy(sizePolicy); setWindowTitle("nheko"); setObjectName("MainWindow"); setStyleSheet("QWidget#MainWindow {background-color: #fff}"); restoreWindowSize(); - setMinimumSize(QSize(conf::window::minWidth, conf::window::minHeight)); QFont font("Open Sans"); font.setPixelSize(conf::fontSize);