summary refs log tree commit diff
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2017-05-14 21:10:03 +0300
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2017-05-14 21:10:03 +0300
commita568d60cef5e293c33eec6a1864e361f16b895b9 (patch)
tree8014f8546f7b6af95ff67d06c565034f54d607f3
parentAdd missing parents (diff)
downloadnheko-a568d60cef5e293c33eec6a1864e361f16b895b9.tar.xz
Remove MainWindow ui form
-rw-r--r--CMakeLists.txt1
-rw-r--r--forms/MainWindow.ui42
-rw-r--r--include/MainWindow.h8
-rw-r--r--src/MainWindow.cc17
4 files changed, 12 insertions, 56 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt

index 7f9204c9..b6ddd91b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt
@@ -150,7 +150,6 @@ include_directories(include/events/messages) qt5_wrap_ui (UI_HEADERS forms/ChatPage.ui - forms/MainWindow.ui forms/RoomList.ui ) diff --git a/forms/MainWindow.ui b/forms/MainWindow.ui deleted file mode 100644
index 5549bad0..00000000 --- a/forms/MainWindow.ui +++ /dev/null
@@ -1,42 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>MainWindow</class> - <widget class="QMainWindow" name="MainWindow"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>1066</width> - <height>600</height> - </rect> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>950</width> - <height>600</height> - </size> - </property> - <property name="font"> - <font> - <family>Open Sans</family> - <stylestrategy>PreferAntialias</stylestrategy> - </font> - </property> - <property name="windowTitle"> - <string notr="true"> nheko </string> - </property> - <property name="styleSheet"> - <string notr="true">background-color: #f9f9f9</string> - </property> - <widget class="QWidget" name="centralWidget"/> - </widget> - <layoutdefault spacing="6" margin="11"/> - <resources/> - <connections/> -</ui> diff --git a/include/MainWindow.h b/include/MainWindow.h
index f1582f85..182b959a 100644 --- a/include/MainWindow.h +++ b/include/MainWindow.h
@@ -30,11 +30,6 @@ #include "SlidingStackWidget.h" #include "WelcomePage.h" -namespace Ui -{ -class MainWindow; -} - class MainWindow : public QMainWindow { Q_OBJECT @@ -59,9 +54,6 @@ private slots: void removeOverlayProgressBar(); private: - // The UI component of the main window. - Ui::MainWindow *ui_; - // The initial welcome screen. WelcomePage *welcome_page_; diff --git a/src/MainWindow.cc b/src/MainWindow.cc
index bc64198c..9a3a44ef 100644 --- a/src/MainWindow.cc +++ b/src/MainWindow.cc
@@ -16,7 +16,6 @@ */ #include "MainWindow.h" -#include "ui_MainWindow.h" #include <QLayout> #include <QNetworkReply> @@ -24,15 +23,24 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) - , ui_(new Ui::MainWindow) , progress_modal_{nullptr} , spinner_{nullptr} { - ui_->setupUi(this); + QSizePolicy sizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); + setSizePolicy(sizePolicy); + setWindowTitle("nheko"); + + resize(1066, 600); // 16:9 ratio + setMinimumSize(QSize(950, 600)); + setStyleSheet("background-color: #f9f9f9"); + + QFont font("Open Sans", 12); + font.setStyleStrategy(QFont::PreferAntialias); + setFont(font); + client_ = QSharedPointer<MatrixClient>(new MatrixClient("matrix.org")); welcome_page_ = new WelcomePage(this); - login_page_ = new LoginPage(client_, this); register_page_ = new RegisterPage(client_, this); chat_page_ = new ChatPage(client_, this); @@ -153,5 +161,4 @@ void MainWindow::showRegisterPage() MainWindow::~MainWindow() { - delete ui_; }