From c5ce3d4e731058081ac62d06d15367612cc48bd8 Mon Sep 17 00:00:00 2001 From: Catalin Badea Date: Mon, 11 Jun 2012 17:40:15 +0300 Subject: Added mock-up ui 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 #include -#include -#include -#include -#include -#include -#include - #include +#include #include 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("hey", "Me", QDateTime::currentDateTime(), "http://swarm.cs.pub.ro/~cbadea/storage/iron_man.png", false, false, theme, "id")); + conversation_->addMessage(boost::make_shared("hey", "You", QDateTime::currentDateTime(), "http://swarm.cs.pub.ro/~cbadea/storage/war_machine.png", true, false, theme, "id2")); + conversation_->addMessage(boost::make_shared("knock knock", "Me", QDateTime::currentDateTime(), "http://swarm.cs.pub.ro/~cbadea/storage/iron_man.png", false, false, theme, "id")); + conversation_->addMessage(boost::make_shared("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 +#include +#include #include 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 2da5535..02ca668 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") -- cgit v0.10.2-6-g49f6