author | harlekin <harlekin> | 2003-12-09 12:20:41 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2003-12-09 12:20:41 (UTC) |
commit | e7d88d21f5b5daede2d04479b7e1157c2ffe7396 (patch) (side-by-side diff) | |
tree | ce334f5144e5c8884852eb571e40e7aa422cc6d3 /noncore/net/mail | |
parent | 7dac080b72cc36559e72563ffc9ad88f71b0574a (diff) | |
download | opie-e7d88d21f5b5daede2d04479b7e1157c2ffe7396.zip opie-e7d88d21f5b5daede2d04479b7e1157c2ffe7396.tar.gz opie-e7d88d21f5b5daede2d04479b7e1157c2ffe7396.tar.bz2 |
more flexible layout, and different base layouts based on current screen rotation
-rw-r--r-- | noncore/net/mail/mainwindow.cpp | 24 |
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 @@ -4,3 +4,5 @@ #include <qtimer.h> +#include <qlayout.h> +#include <qpe/qpeapplication.h> @@ -66,9 +68,17 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) - 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" ) ); @@ -76,4 +86,5 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) + layout->addWidget( folderView ); + mailView = new QListView( view ); - mailView->setMinimumHeight( 50 ); mailView->addColumn( tr( "Subject" ),QListView::Manual ); @@ -83,2 +94,7 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) mailView->setSorting(-1); + + layout->addWidget( mailView ); + layout->setStretchFactor( folderView, 1 ); + layout->setStretchFactor( mailView, 2 ); + connect( mailView, SIGNAL( clicked( QListViewItem * ) ),this, |