summaryrefslogtreecommitdiff
path: root/noncore/net/mail/mainwindow.cpp
Side-by-side diff
Diffstat (limited to 'noncore/net/mail/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/mainwindow.cpp28
1 files changed, 18 insertions, 10 deletions
diff --git a/noncore/net/mail/mainwindow.cpp b/noncore/net/mail/mainwindow.cpp
index b25db97..f19f93d 100644
--- a/noncore/net/mail/mainwindow.cpp
+++ b/noncore/net/mail/mainwindow.cpp
@@ -71,15 +71,7 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
QWidget *view = new QWidget( this );
setCentralWidget( view );
-
- QWidget *d = QApplication::desktop();
- QBoxLayout *layout;
-
- if ( d->width() < d->height() ) {
- layout = new QVBoxLayout( view );
- } else {
- layout = new QHBoxLayout( view );
- }
+ layout = new QBoxLayout ( view, QBoxLayout::LeftToRight );
folderView = new AccountView( view );
folderView->header()->hide();
@@ -99,6 +91,8 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
layout->setStretchFactor( folderView, 1 );
layout->setStretchFactor( mailView, 2 );
+ slotAdjustLayout();
+
connect( mailView, SIGNAL( clicked( QListViewItem * ) ),this,
SLOT( displayMail( QListViewItem * ) ) );
@@ -107,6 +101,19 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
QTimer::singleShot( 1000, this, SLOT( slotAdjustColumns() ) );
}
+
+void MainWindow::slotAdjustLayout() {
+
+ QWidget *d = QApplication::desktop();
+
+ if ( d->width() < d->height() ) {
+ layout->setDirection( QBoxLayout::TopToBottom );
+ } else {
+ layout->setDirection( QBoxLayout::LeftToRight );
+ }
+ delete d;
+}
+
void MainWindow::slotAdjustColumns()
{
bool hidden = folderView->isHidden();
@@ -149,7 +156,8 @@ void MainWindow::displayMail(QListViewItem*item)
RecBody body = folderView->fetchBody(mail);
ViewMail readMail( this );
- readMail.setMailInfo( mail.getFrom(), "", mail.getSubject(), "", "", body.Bodytext() );
+
+ readMail.setMailInfo( mail.getFrom(), mail.To(), mail.getSubject(), mail.CC(), mail.Bcc(), mail.getDate(), body.Bodytext() );
readMail.showMaximized();
readMail.exec();
}