summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/mainwindow.cpp24
1 files changed, 20 insertions, 4 deletions
diff --git a/noncore/net/mail/mainwindow.cpp b/noncore/net/mail/mainwindow.cpp
index 6e8f4d3..7af7d83 100644
--- a/noncore/net/mail/mainwindow.cpp
+++ b/noncore/net/mail/mainwindow.cpp
@@ -1,11 +1,13 @@
#include <qlabel.h>
#include <qvbox.h>
#include <qheader.h>
#include <qtimer.h>
+#include <qlayout.h>
+#include <qpe/qpeapplication.h>
#include "defines.h"
#include "mainwindow.h"
#include "viewmail.h"
MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
@@ -61,29 +63,43 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
editSettings->addTo( settingsMenu );
editAccounts = new QAction( tr( "Configure accounts" ), ICON_EDITACCOUNTS,
0, 0, this );
editAccounts->addTo( settingsMenu );
- QVBox *view = new QVBox( this );
+ 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 );
+ }
+
folderView = new AccountView( view );
folderView->header()->hide();
- folderView->setMinimumHeight( 90 );
- folderView->setMaximumHeight( 90 );
folderView->addColumn( tr( "Mailbox" ) );
folderView->hide();
+ layout->addWidget( folderView );
+
mailView = new QListView( view );
- mailView->setMinimumHeight( 50 );
mailView->addColumn( tr( "Subject" ),QListView::Manual );
mailView->addColumn( tr( "Sender" ),QListView::Manual );
mailView->addColumn( tr( "Date" ));
mailView->setAllColumnsShowFocus(true);
mailView->setSorting(-1);
+
+ layout->addWidget( mailView );
+ layout->setStretchFactor( folderView, 1 );
+ layout->setStretchFactor( mailView, 2 );
+
connect( mailView, SIGNAL( clicked( QListViewItem * ) ),this,
SLOT( displayMail( QListViewItem * ) ) );
connect(folderView,SIGNAL(refreshMailview(Maillist*)),this,SLOT(refreshMailView(Maillist*)));
QTimer::singleShot( 1000, this, SLOT( slotAdjustColumns() ) );