summaryrefslogtreecommitdiff
path: root/core/launcher/desktop.cpp
authorsimon <simon>2003-03-25 20:30:12 (UTC)
committer simon <simon>2003-03-25 20:30:12 (UTC)
commit3a4ee8d8a53ca17703b34f84e1a411056ee7e50f (patch) (side-by-side diff)
tree6010cc8c464767725a7ab8b973428945dca62994 /core/launcher/desktop.cpp
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/launcher/desktop.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/desktop.cpp31
1 files changed, 24 insertions, 7 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
@@ -507,7 +507,7 @@ Desktop::Desktop() :
QSize sz = tb->sizeHint();
setGeometry( 0, displayh - sz.height(), displayw, sz.height() );
- tb->setGeometry( 0, displayh - sz.height(), displayw, sz.height() );
+ layout();
tb->show();
launcher->showMaximized();
@@ -524,6 +524,7 @@ Desktop::Desktop() :
packageSlave = new PackageSlave( this );
qApp->installEventFilter( this );
+ qApp->desktop()->installEventFilter( this );
qApp-> setMainWidget ( launcher );
}
@@ -732,12 +733,7 @@ void Desktop::toggleCapsLockState()
void Desktop::styleChange( QStyle &s )
{
QWidget::styleChange( s );
- int displayw = qApp->desktop() ->width();
- int displayh = qApp->desktop() ->height();
-
- QSize sz = tb->sizeHint();
-
- tb->setGeometry( 0, displayh - sz.height(), displayw, sz.height() );
+ layout();
}
void DesktopApplication::shutdown()
@@ -806,6 +802,17 @@ void DesktopApplication::restart()
#endif
}
+void Desktop::layout()
+{
+ int displayw = qApp->desktop() ->width();
+ int displayh = qApp->desktop() ->height();
+
+ QSize sz = tb->sizeHint();
+
+ tb->setGeometry( 0, displayh - sz.height(), displayw, sz.height() );
+ tb->calcMaxWindowRect();
+}
+
void Desktop::startTransferServer()
{
// start qcop bridge server
@@ -830,6 +837,16 @@ void Desktop::timerEvent( QTimerEvent *e )
startTransferServer();
}
+bool Desktop::eventFilter( QObject *o, QEvent *ev )
+{
+ if ( o != qApp->desktop() || ev->type() != QEvent::Resize )
+ return QWidget::eventFilter( o, ev );
+
+ layout();
+
+ return QWidget::eventFilter( o, ev );
+}
+
void Desktop::terminateServers()
{
delete transferServer;