summaryrefslogtreecommitdiff
path: root/core
authorsimon <simon>2003-03-25 20:30:12 (UTC)
committer simon <simon>2003-03-25 20:30:12 (UTC)
commit3a4ee8d8a53ca17703b34f84e1a411056ee7e50f (patch) (unidiff)
tree6010cc8c464767725a7ab8b973428945dca62994 /core
parentf7395e72a415322101ee3e22cb0e10b6bdf60a63 (diff)
downloadopie-3a4ee8d8a53ca17703b34f84e1a411056ee7e50f.zip
opie-3a4ee8d8a53ca17703b34f84e1a411056ee7e50f.tar.gz
opie-3a4ee8d8a53ca17703b34f84e1a411056ee7e50f.tar.bz2
- keep an eye on resize events on the desktop widget, which are an
indication for things like life rotation. upon a resize re-layout things (taskbar, tabs and maxwindow rect)
Diffstat (limited to 'core') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/desktop.cpp31
-rw-r--r--core/launcher/desktop.h2
-rw-r--r--core/launcher/taskbar.h3
3 files changed, 28 insertions, 8 deletions
diff --git a/core/launcher/desktop.cpp b/core/launcher/desktop.cpp
index 86527f6..6def126 100644
--- a/core/launcher/desktop.cpp
+++ b/core/launcher/desktop.cpp
@@ -508,5 +508,5 @@ Desktop::Desktop() :
508 508
509 setGeometry( 0, displayh - sz.height(), displayw, sz.height() ); 509 setGeometry( 0, displayh - sz.height(), displayw, sz.height() );
510 tb->setGeometry( 0, displayh - sz.height(), displayw, sz.height() ); 510 layout();
511 511
512 tb->show(); 512 tb->show();
@@ -525,4 +525,5 @@ Desktop::Desktop() :
525 525
526 qApp->installEventFilter( this ); 526 qApp->installEventFilter( this );
527 qApp->desktop()->installEventFilter( this );
527 528
528 qApp-> setMainWidget ( launcher ); 529 qApp-> setMainWidget ( launcher );
@@ -733,10 +734,5 @@ void Desktop::styleChange( QStyle &s )
733{ 734{
734 QWidget::styleChange( s ); 735 QWidget::styleChange( s );
735 int displayw = qApp->desktop() ->width(); 736 layout();
736 int displayh = qApp->desktop() ->height();
737
738 QSize sz = tb->sizeHint();
739
740 tb->setGeometry( 0, displayh - sz.height(), displayw, sz.height() );
741} 737}
742 738
@@ -807,4 +803,15 @@ void DesktopApplication::restart()
807} 803}
808 804
805void Desktop::layout()
806{
807 int displayw = qApp->desktop() ->width();
808 int displayh = qApp->desktop() ->height();
809
810 QSize sz = tb->sizeHint();
811
812 tb->setGeometry( 0, displayh - sz.height(), displayw, sz.height() );
813 tb->calcMaxWindowRect();
814}
815
809void Desktop::startTransferServer() 816void Desktop::startTransferServer()
810{ 817{
@@ -831,4 +838,14 @@ void Desktop::timerEvent( QTimerEvent *e )
831} 838}
832 839
840bool Desktop::eventFilter( QObject *o, QEvent *ev )
841{
842 if ( o != qApp->desktop() || ev->type() != QEvent::Resize )
843 return QWidget::eventFilter( o, ev );
844
845 layout();
846
847 return QWidget::eventFilter( o, ev );
848}
849
833void Desktop::terminateServers() 850void Desktop::terminateServers()
834{ 851{
diff --git a/core/launcher/desktop.h b/core/launcher/desktop.h
index 4024c38..86d8aa8 100644
--- a/core/launcher/desktop.h
+++ b/core/launcher/desktop.h
@@ -135,4 +135,5 @@ protected:
135 void styleChange( QStyle & ); 135 void styleChange( QStyle & );
136 void timerEvent( QTimerEvent *e ); 136 void timerEvent( QTimerEvent *e );
137 virtual bool eventFilter( QObject *o, QEvent *ev );
137 138
138 QWidget *bg; 139 QWidget *bg;
@@ -141,4 +142,5 @@ protected:
141 142
142private: 143private:
144 void layout();
143 void startTransferServer(); 145 void startTransferServer();
144 bool recoverMemory(); 146 bool recoverMemory();
diff --git a/core/launcher/taskbar.h b/core/launcher/taskbar.h
index cd631ef..a0bf395 100644
--- a/core/launcher/taskbar.h
+++ b/core/launcher/taskbar.h
@@ -62,6 +62,7 @@ protected:
62 void setStatusMessage( const QString &text ); 62 void setStatusMessage( const QString &text );
63 63
64private slots: 64public slots:
65 void calcMaxWindowRect(); 65 void calcMaxWindowRect();
66private slots:
66 void receive( const QCString &msg, const QByteArray &data ); 67 void receive( const QCString &msg, const QByteArray &data );
67 68