summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opieui/big-screen/owidgetstack.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/libopie2/opieui/big-screen/owidgetstack.cpp b/libopie2/opieui/big-screen/owidgetstack.cpp
index 00194b4..ac46cca 100644
--- a/libopie2/opieui/big-screen/owidgetstack.cpp
+++ b/libopie2/opieui/big-screen/owidgetstack.cpp
@@ -300,25 +300,25 @@ void OWidgetStack::hideWidget( int id) {
300 * This is overloaded and only differs in the parameters 300 * This is overloaded and only differs in the parameters
301 * it takes. 301 * it takes.
302 */ 302 */
303void OWidgetStack::hideWidget( QWidget* wid) { 303void OWidgetStack::hideWidget( QWidget* wid) {
304 /* still not smart */ 304 /* still not smart */
305 if ( m_mode == BigScreen && m_last != m_mWidget ) 305 if ( m_mode == BigScreen && m_last != m_mWidget )
306 m_last->hide(); 306 m_last->hide();
307 307
308 raiseWidget( wid ); 308 raiseWidget( wid );
309} 309}
310 310
311 311
312bool OWidgetStack::eventFilter( QObject* obj, QEvent* e) { 312bool OWidgetStack::eventFilter( QObject*, QEvent* e) {
313 if ( e->type() == QEvent::Resize && !m_forced ) { 313 if ( e->type() == QEvent::Resize && !m_forced ) {
314 QResizeEvent *res = static_cast<QResizeEvent*>( e ); 314 QResizeEvent *res = static_cast<QResizeEvent*>( e );
315 QSize size = res->size(); 315 QSize size = res->size();
316 if ( size.width() >= mode_size ) 316 if ( size.width() >= mode_size )
317 switchTop(); 317 switchTop();
318 else 318 else
319 switchStack(); 319 switchStack();
320 } 320 }
321 return false; 321 return false;
322} 322}
323 323
324 324
@@ -379,38 +379,43 @@ void OWidgetStack::setMainWindow( int id) {
379 379
380/* 380/*
381 * this function switches to a stack ;) 381 * this function switches to a stack ;)
382 */ 382 */
383void OWidgetStack::switchStack() { 383void OWidgetStack::switchStack() {
384 if (m_stack ) { 384 if (m_stack ) {
385 m_stack->setGeometry( frameRect() ); 385 m_stack->setGeometry( frameRect() );
386 return; 386 return;
387 } 387 }
388 388
389 m_mode = SmallScreen; 389 m_mode = SmallScreen;
390 m_stack = new QWidgetStack(this); 390 m_stack = new QWidgetStack(this);
391 m_stack->setGeometry( frameRect() );
392 m_stack->show();
391 393
392 connect(m_stack, SIGNAL(aboutToShow(QWidget*) ), 394 connect(m_stack, SIGNAL(aboutToShow(QWidget*) ),
393 this, SIGNAL(aboutToShow(QWidget*) ) ); 395 this, SIGNAL(aboutToShow(QWidget*) ) );
394 connect(m_stack, SIGNAL(aboutToShow(int) ), 396 connect(m_stack, SIGNAL(aboutToShow(int) ),
395 this, SIGNAL(aboutToShow(int) ) ); 397 this, SIGNAL(aboutToShow(int) ) );
396 398
397 /* now reparent the widgets... luckily QWidgetSatck does most of the work */ 399 /* now reparent the widgets... luckily QWidgetSatck does most of the work */
398 if (m_list.isEmpty() ) 400 if (m_list.isEmpty() )
399 return; 401 return;
400 402
401 QMap<int, QWidget*>::Iterator it = m_list.begin(); 403 QMap<int, QWidget*>::Iterator it = m_list.begin();
402 for ( ; it != m_list.end(); ++it ) 404 for ( ; it != m_list.end(); ++it )
403 m_stack->addWidget( it.data(), it.key() ); 405 m_stack->addWidget( it.data(), it.key() );
404 406
407 if ( m_mWidget )
408 m_stack->raiseWidget( m_mWidget );
409
405 410
406} 411}
407 412
408/* 413/*
409 * we will switch to top level mode 414 * we will switch to top level mode
410 * reparent the list of widgets and then delete the stack 415 * reparent the list of widgets and then delete the stack
411 */ 416 */
412void OWidgetStack::switchTop() { 417void OWidgetStack::switchTop() {
413 m_mode = BigScreen; 418 m_mode = BigScreen;
414 /* this works because it is guaranteed that switchStack was called at least once*/ 419 /* this works because it is guaranteed that switchStack was called at least once*/
415 if (!m_stack && m_mWidget) { 420 if (!m_stack && m_mWidget) {
416 m_mWidget->setGeometry( frameRect() ); 421 m_mWidget->setGeometry( frameRect() );