diff options
author | Catalin Badea <catalin.badea392@gmail.com> | 2012-06-11 14:40:15 (GMT) |
---|---|---|
committer | Cătălin Badea <catalin.badea392@gmail.com> | 2012-08-11 15:45:27 (GMT) |
commit | e1b2d04ec9b90a4c5f3ce3d189a740dec05bb93b (patch) | |
tree | c66b95c2054f83eed84f51af43bc1ab3a5288b59 /Swift/QtUI | |
parent | ab658eccab4955e338db8f42accd847fd6a9c106 (diff) | |
download | swift-contrib-e1b2d04ec9b90a4c5f3ce3d189a740dec05bb93b.zip swift-contrib-e1b2d04ec9b90a4c5f3ce3d189a740dec05bb93b.tar.bz2 |
Added mock-up ui
Diffstat (limited to 'Swift/QtUI')
-rw-r--r-- | Swift/QtUI/QtHistoryWindow.cpp | 33 | ||||
-rw-r--r-- | Swift/QtUI/QtHistoryWindow.h | 5 | ||||
-rw-r--r-- | Swift/QtUI/SConscript | 1 |
3 files changed, 22 insertions, 17 deletions
diff --git a/Swift/QtUI/QtHistoryWindow.cpp b/Swift/QtUI/QtHistoryWindow.cpp index 6868ca5..aaf4d65 100644 --- a/Swift/QtUI/QtHistoryWindow.cpp +++ b/Swift/QtUI/QtHistoryWindow.cpp @@ -7,32 +7,31 @@ #include <QtHistoryWindow.h> #include <QtTabbable.h> -#include <QCloseEvent> -#include <QTextEdit> -#include <QVBoxLayout> -#include <QPushButton> -#include <QScrollBar> -#include <QCheckBox> - #include <QtSwiftUtil.h> +#include <MessageSnippet.h> #include <string> namespace Swift { QtHistoryWindow::QtHistoryWindow() { - QVBoxLayout* layout = new QVBoxLayout(this); - layout->setSpacing(0); - layout->setContentsMargins(0,0,0,0); + ui_.setupUi(this); + + QtChatTheme* theme = new QtChatTheme(""); // FIXME: leak - QWidget* bottom = new QWidget(this); - layout->addWidget(bottom); - bottom->setAutoFillBackground(true); + delete ui_.conversation; + conversation_ = new QtChatView(theme, this); + QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); + sizePolicy.setHorizontalStretch(80); + sizePolicy.setVerticalStretch(0); + conversation_->setSizePolicy(sizePolicy); - QHBoxLayout* buttonLayout = new QHBoxLayout(bottom); - buttonLayout->setContentsMargins(10,0,20,0); - buttonLayout->setSpacing(0); + ui_.conversation = conversation_; + ui_.bottomLayout->addWidget(conversation_); - buttonLayout->addStretch(); + conversation_->addMessage(boost::make_shared<MessageSnippet>("hey", "Me", QDateTime::currentDateTime(), "http://swarm.cs.pub.ro/~cbadea/storage/iron_man.png", false, false, theme, "id")); + conversation_->addMessage(boost::make_shared<MessageSnippet>("hey", "You", QDateTime::currentDateTime(), "http://swarm.cs.pub.ro/~cbadea/storage/war_machine.png", true, false, theme, "id2")); + conversation_->addMessage(boost::make_shared<MessageSnippet>("knock knock", "Me", QDateTime::currentDateTime(), "http://swarm.cs.pub.ro/~cbadea/storage/iron_man.png", false, false, theme, "id")); + conversation_->addMessage(boost::make_shared<MessageSnippet>("who's there?", "You", QDateTime::currentDateTime(), "http://swarm.cs.pub.ro/~cbadea/storage/war_machine.png", true, false, theme, "id2")); setWindowTitle(tr("History")); } diff --git a/Swift/QtUI/QtHistoryWindow.h b/Swift/QtUI/QtHistoryWindow.h index eacba8d..08db473 100644 --- a/Swift/QtUI/QtHistoryWindow.h +++ b/Swift/QtUI/QtHistoryWindow.h @@ -7,6 +7,8 @@ #pragma once #include <Swift/Controllers/UIInterfaces/HistoryWindow.h> +#include <Swift/QtUI/ui_QtHistoryWindow.h> +#include <QtChatView.h> #include <QtTabbable.h> class QTextEdit; @@ -25,5 +27,8 @@ namespace Swift { private: virtual void closeEvent(QCloseEvent* event); virtual void showEvent(QShowEvent* event); + + Ui::QtHistoryWindow ui_; + QtChatView* conversation_; }; } diff --git a/Swift/QtUI/SConscript b/Swift/QtUI/SConscript index a22b4eb..70ec670 100644 --- a/Swift/QtUI/SConscript +++ b/Swift/QtUI/SConscript @@ -198,6 +198,7 @@ myenv.Uic4("UserSearch/QtUserSearchResultsPage.ui") myenv.Uic4("QtBookmarkDetailWindow.ui") myenv.Uic4("QtAffiliationEditor.ui") myenv.Uic4("QtJoinMUCWindow.ui") +myenv.Uic4("QtHistoryWindow.ui") myenv.Qrc("DefaultTheme.qrc") myenv.Qrc("Swift.qrc") |