summaryrefslogtreecommitdiff
authorharlekin <harlekin>2003-12-09 12:20:41 (UTC)
committer harlekin <harlekin>2003-12-09 12:20:41 (UTC)
commite7d88d21f5b5daede2d04479b7e1157c2ffe7396 (patch) (unidiff)
treece334f5144e5c8884852eb571e40e7aa422cc6d3
parent7dac080b72cc36559e72563ffc9ad88f71b0574a (diff)
downloadopie-e7d88d21f5b5daede2d04479b7e1157c2ffe7396.zip
opie-e7d88d21f5b5daede2d04479b7e1157c2ffe7396.tar.gz
opie-e7d88d21f5b5daede2d04479b7e1157c2ffe7396.tar.bz2
more flexible layout, and different base layouts based on current screen rotation
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
@@ -2,7 +2,9 @@
2#include <qvbox.h> 2#include <qvbox.h>
3#include <qheader.h> 3#include <qheader.h>
4#include <qtimer.h> 4#include <qtimer.h>
5#include <qlayout.h>
5 6
7#include <qpe/qpeapplication.h>
6 8
7#include "defines.h" 9#include "defines.h"
8#include "mainwindow.h" 10#include "mainwindow.h"
@@ -64,23 +66,37 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
64 0, 0, this ); 66 0, 0, this );
65 editAccounts->addTo( settingsMenu ); 67 editAccounts->addTo( settingsMenu );
66 68
67 QVBox *view = new QVBox( this ); 69 QWidget *view = new QWidget( this );
68 setCentralWidget( view ); 70 setCentralWidget( view );
69 71
72
73 QWidget *d = QApplication::desktop();
74 QBoxLayout *layout;
75
76 if ( d->width() < d->height() ) {
77 layout = new QVBoxLayout( view );
78 } else {
79 layout = new QHBoxLayout( view );
80 }
81
70 folderView = new AccountView( view ); 82 folderView = new AccountView( view );
71 folderView->header()->hide(); 83 folderView->header()->hide();
72 folderView->setMinimumHeight( 90 );
73 folderView->setMaximumHeight( 90 );
74 folderView->addColumn( tr( "Mailbox" ) ); 84 folderView->addColumn( tr( "Mailbox" ) );
75 folderView->hide(); 85 folderView->hide();
76 86
87 layout->addWidget( folderView );
88
77 mailView = new QListView( view ); 89 mailView = new QListView( view );
78 mailView->setMinimumHeight( 50 );
79 mailView->addColumn( tr( "Subject" ),QListView::Manual ); 90 mailView->addColumn( tr( "Subject" ),QListView::Manual );
80 mailView->addColumn( tr( "Sender" ),QListView::Manual ); 91 mailView->addColumn( tr( "Sender" ),QListView::Manual );
81 mailView->addColumn( tr( "Date" )); 92 mailView->addColumn( tr( "Date" ));
82 mailView->setAllColumnsShowFocus(true); 93 mailView->setAllColumnsShowFocus(true);
83 mailView->setSorting(-1); 94 mailView->setSorting(-1);
95
96 layout->addWidget( mailView );
97 layout->setStretchFactor( folderView, 1 );
98 layout->setStretchFactor( mailView, 2 );
99
84 connect( mailView, SIGNAL( clicked( QListViewItem * ) ),this, 100 connect( mailView, SIGNAL( clicked( QListViewItem * ) ),this,
85 SLOT( displayMail( QListViewItem * ) ) ); 101 SLOT( displayMail( QListViewItem * ) ) );
86 102