-rw-r--r-- | core/launcher/desktop.cpp | 31 | ||||
-rw-r--r-- | core/launcher/desktop.h | 2 | ||||
-rw-r--r-- | core/launcher/taskbar.h | 3 |
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() : setGeometry( 0, displayh - sz.height(), displayw, sz.height() ); - tb->setGeometry( 0, displayh - sz.height(), displayw, sz.height() ); + layout(); tb->show(); @@ -525,4 +525,5 @@ Desktop::Desktop() : qApp->installEventFilter( this ); + qApp->desktop()->installEventFilter( this ); qApp-> setMainWidget ( launcher ); @@ -733,10 +734,5 @@ 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(); } @@ -807,4 +803,15 @@ void DesktopApplication::restart() } +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() { @@ -831,4 +838,14 @@ void Desktop::timerEvent( QTimerEvent *e ) } +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() { 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: void styleChange( QStyle & ); void timerEvent( QTimerEvent *e ); + virtual bool eventFilter( QObject *o, QEvent *ev ); QWidget *bg; @@ -141,4 +142,5 @@ protected: private: + void layout(); void startTransferServer(); 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: void setStatusMessage( const QString &text ); -private slots: +public slots: void calcMaxWindowRect(); +private slots: void receive( const QCString &msg, const QByteArray &data ); |