author | zecke <zecke> | 2003-08-28 14:45:00 (UTC) |
---|---|---|
committer | zecke <zecke> | 2003-08-28 14:45:00 (UTC) |
commit | 5665c2c773a82b6c8a13ae7019a1d60bc0ab7778 (patch) (unidiff) | |
tree | 0cdb4eb43c9bab11c9be3ed02c5349f3480435fd | |
parent | 20c41310c4669bb0e349dc14745f42a9241a7f1c (diff) | |
download | opie-5665c2c773a82b6c8a13ae7019a1d60bc0ab7778.zip opie-5665c2c773a82b6c8a13ae7019a1d60bc0ab7778.tar.gz opie-5665c2c773a82b6c8a13ae7019a1d60bc0ab7778.tar.bz2 |
rotation and docking fixes
-rw-r--r-- | core/launcher/serverinterface.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/core/launcher/serverinterface.cpp b/core/launcher/serverinterface.cpp index 7002243..9eb7f75 100644 --- a/core/launcher/serverinterface.cpp +++ b/core/launcher/serverinterface.cpp | |||
@@ -78,60 +78,62 @@ bool LayoutManager::eventFilter( QObject *object, QEvent *event ) | |||
78 | if ( item ) { | 78 | if ( item ) { |
79 | docked.removeRef( item ); | 79 | docked.removeRef( item ); |
80 | layout(); | 80 | layout(); |
81 | } | 81 | } |
82 | break; | 82 | break; |
83 | 83 | ||
84 | case QEvent::Hide: | 84 | case QEvent::Hide: |
85 | case QEvent::Show: | 85 | case QEvent::Show: |
86 | item = findWidget( (QWidget *)object ); | 86 | item = findWidget( (QWidget *)object ); |
87 | if ( item ) | 87 | if ( item ) |
88 | layout(); | 88 | layout(); |
89 | break; | 89 | break; |
90 | 90 | ||
91 | default: | 91 | default: |
92 | break; | 92 | break; |
93 | } | 93 | } |
94 | 94 | ||
95 | return QObject::eventFilter( object, event ); | 95 | return QObject::eventFilter( object, event ); |
96 | } | 96 | } |
97 | 97 | ||
98 | void LayoutManager::layout() | 98 | void LayoutManager::layout() |
99 | { | 99 | { |
100 | QRect mwr( qApp->desktop()->geometry() ); | 100 | QRect mwr( qApp->desktop()->geometry() ); |
101 | QListIterator<Item> it( docked ); | 101 | QListIterator<Item> it( docked ); |
102 | Item *item; | 102 | Item *item; |
103 | for ( ; (item = it.current()); ++it ) { | 103 | for ( ; (item = it.current()); ++it ) { |
104 | QWidget *w = item->w; | 104 | QWidget *w = item->w; |
105 | if ( !w->isVisible() ) | 105 | if ( !w->isVisible() ) |
106 | continue; | 106 | continue; |
107 | |||
108 | QSize sh = w->sizeHint(); | ||
107 | switch ( item->p ) { | 109 | switch ( item->p ) { |
108 | case ServerInterface::Top: | 110 | case ServerInterface::Top: |
109 | w->resize( mwr.width(), w->sizeHint().height() ); | 111 | w->setGeometry( mwr.left(), mwr.top(), |
110 | w->move( mwr.topLeft() ); | 112 | mwr.width(), sh.height() ); |
111 | mwr.setTop( w->geometry().bottom() + 1 ); | 113 | mwr.setTop( w->geometry().bottom() + 1 ); |
112 | break; | 114 | break; |
113 | case ServerInterface::Bottom: | 115 | case ServerInterface::Bottom: |
114 | w->resize( mwr.width(), w->sizeHint().height() ); | 116 | w->setGeometry( mwr.left(), mwr.bottom() - sh.height(), |
115 | w->move( mwr.left(), mwr.bottom()-w->height()+1 ); | 117 | mwr.width(), sh.height() ); |
116 | mwr.setBottom( w->geometry().top() - 1 ); | 118 | mwr.setBottom( w->geometry().top() - 1 ); |
117 | break; | 119 | break; |
118 | case ServerInterface::Left: | 120 | case ServerInterface::Left: |
119 | w->resize( w->sizeHint().width(), mwr.height() ); | 121 | w->setGeometry( mwr.left(), mwr.top(), |
120 | w->move( mwr.topLeft() ); | 122 | sh.width(), mwr.height() ); |
121 | mwr.setLeft( w->geometry().right() + 1 ); | 123 | mwr.setLeft( w->geometry().right() + 1 ); |
122 | break; | 124 | break; |
123 | case ServerInterface::Right: | 125 | case ServerInterface::Right: |
124 | w->resize( w->sizeHint().width(), mwr.height() ); | 126 | w->setGeometry( mwr.right() - sh.width(), mwr.top(), |
125 | w->move( mwr.right()-w->width()+1, mwr.top() ); | 127 | sh.width(), mwr.height() ); |
126 | mwr.setRight( w->geometry().left() - 1 ); | 128 | mwr.setRight( w->geometry().left() - 1 ); |
127 | break; | 129 | break; |
128 | } | 130 | } |
129 | } | 131 | } |
130 | 132 | ||
131 | #ifdef Q_WS_QWS | 133 | #ifdef Q_WS_QWS |
132 | # if QT_VERSION < 0x030000 | 134 | # if QT_VERSION < 0x030000 |
133 | QWSServer::setMaxWindowRect( qt_screen->mapToDevice(mwr, | 135 | QWSServer::setMaxWindowRect( qt_screen->mapToDevice(mwr, |
134 | QSize(qt_screen->width(),qt_screen->height())) ); | 136 | QSize(qt_screen->width(),qt_screen->height())) ); |
135 | # else | 137 | # else |
136 | QWSServer::setMaxWindowRect( mwr ); | 138 | QWSServer::setMaxWindowRect( mwr ); |
137 | # endif | 139 | # endif |
@@ -327,25 +329,25 @@ LayoutManager::Item *LayoutManager::findWidget( const QWidget *w ) const | |||
327 | <li> \c Right - the Right of the screen. | 329 | <li> \c Right - the Right of the screen. |
328 | </ul> | 330 | </ul> |
329 | */ | 331 | */ |
330 | 332 | ||
331 | /*! | 333 | /*! |
332 | \fn ServerInterface::dockWidget(QWidget *w, DockArea placement) | 334 | \fn ServerInterface::dockWidget(QWidget *w, DockArea placement) |
333 | 335 | ||
334 | Docks a top-level widget \a w on a side of the screen specified by | 336 | Docks a top-level widget \a w on a side of the screen specified by |
335 | \a placement. The widget is placed | 337 | \a placement. The widget is placed |
336 | according to the order that it was docked, its sizeHint() and whether | 338 | according to the order that it was docked, its sizeHint() and whether |
337 | previously docked widgets are visible. The desktop area available to | 339 | previously docked widgets are visible. The desktop area available to |
338 | QWidget::showMaximized() will exclude any visible docked widgets. | 340 | QWidget::showMaximized() will exclude any visible docked widgets. |
339 | 341 | ||
340 | For example, if a widget is | 342 | For example, if a widget is |
341 | docked at the bottom of the screen, its sizeHint() will define its | 343 | docked at the bottom of the screen, its sizeHint() will define its |
342 | height and it will use the full width of the screen. If a widget is | 344 | height and it will use the full width of the screen. If a widget is |
343 | then docked to the right, its sizeHint() will define its width and | 345 | then docked to the right, its sizeHint() will define its width and |
344 | it will be as high as possible without covering | 346 | it will be as high as possible without covering |
345 | the widget docked at the bottom. | 347 | the widget docked at the bottom. |
346 | 348 | ||
347 | This function is useful for reserving system areas such as taskbars | 349 | This function is useful for reserving system areas such as taskbars |
348 | and input methods that should not be covered by applications. | 350 | and input methods that should not be covered by applications. |
349 | */ | 351 | */ |
350 | 352 | ||
351 | 353 | ||