summaryrefslogtreecommitdiff
path: root/libopie
Unidiff
Diffstat (limited to 'libopie') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/big-screen/osplitter.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/libopie/big-screen/osplitter.cpp b/libopie/big-screen/osplitter.cpp
index 47f856d..b09bc94 100644
--- a/libopie/big-screen/osplitter.cpp
+++ b/libopie/big-screen/osplitter.cpp
@@ -389,44 +389,47 @@ void OSplitter::addToBox( const Opie::OSplitterContainer& con ) {
389 * Removes a widget from the tab 389 * Removes a widget from the tab
390 */ 390 */
391void OSplitter::removeFromTab( QWidget* wid ) { 391void OSplitter::removeFromTab( QWidget* wid ) {
392 if (m_parentTab ) 392 if (m_parentTab )
393 m_parentTab->removePage( wid ); 393 m_parentTab->removePage( wid );
394 else 394 else
395 m_tabWidget->removePage( wid ); 395 m_tabWidget->removePage( wid );
396} 396}
397 397
398/* 398/*
399 * switches over to a OTabWidget layout 399 * switches over to a OTabWidget layout
400 * it is recursive 400 * it is recursive
401 */ 401 */
402void OSplitter::changeTab() { 402void OSplitter::changeTab() {
403 /* if we're the owner of the tab widget */ 403 /* if we're the owner of the tab widget */
404 if (m_tabWidget ) { 404 if (m_tabWidget ) {
405 raise();
406 show();
405 m_tabWidget->setGeometry( frameRect() ); 407 m_tabWidget->setGeometry( frameRect() );
406 return; 408 return;
407 } 409 }
408 410
409 qWarning(" New Tab Widget %s", name() ); 411 qWarning(" New Tab Widget %s", name() );
410 /* 412 /*
411 * and add all widgets this will reparent them 413 * and add all widgets this will reparent them
412 * delete m_hbox set it to 0 414 * delete m_hbox set it to 0
413 * 415 *
414 */ 416 */
415 OTabWidget *tab; 417 OTabWidget *tab;
416 if ( m_parentTab ) { 418 if ( m_parentTab ) {
419 hide();
417 tab = m_parentTab; 420 tab = m_parentTab;
418 /* expensive but needed cause we're called from setTabWidget and resizeEvent*/ 421 /* expensive but needed cause we're called from setTabWidget and resizeEvent*/
419 if (!m_container.isEmpty() ) { 422 if (!m_container.isEmpty() ) {
420 ContainerList::Iterator it = m_container.begin(); 423 ContainerList::Iterator it = m_container.begin();
421 for (; it != m_container.end(); ++it ) 424 for (; it != m_container.end(); ++it )
422 m_parentTab->removePage( (*it).widget ); 425 m_parentTab->removePage( (*it).widget );
423 } 426 }
424 }else 427 }else
425 tab = m_tabWidget = new OTabWidget( this ); 428 tab = m_tabWidget = new OTabWidget( this );
426 429
427 connect(tab, SIGNAL(currentChanged(QWidget*) ), 430 connect(tab, SIGNAL(currentChanged(QWidget*) ),
428 this, SIGNAL(currentChanged(QWidget*) ) ); 431 this, SIGNAL(currentChanged(QWidget*) ) );
429 432
430 for ( ContainerList::Iterator it = m_container.begin(); it != m_container.end(); ++it ) { 433 for ( ContainerList::Iterator it = m_container.begin(); it != m_container.end(); ++it ) {
431 qWarning("Widget is %s", (*it).name.latin1() ); 434 qWarning("Widget is %s", (*it).name.latin1() );
432 addToTab( (*it) ); 435 addToTab( (*it) );
@@ -532,36 +535,34 @@ void OSplitter::setTabWidget( OTabWidget* wid) {
532 /* the parent Splitter changed so either make us indepent or dep */ 535 /* the parent Splitter changed so either make us indepent or dep */
533 536
534 m_parentTab = wid; 537 m_parentTab = wid;
535 538
536 QWidget *tab = m_tabWidget; 539 QWidget *tab = m_tabWidget;
537 QWidget *box = m_hbox; 540 QWidget *box = m_hbox;
538 m_hbox = 0; m_tabWidget = 0; 541 m_hbox = 0; m_tabWidget = 0;
539 542
540 if ( layoutMode() ) 543 if ( layoutMode() )
541 changeTab(); 544 changeTab();
542 else if (m_orient == Horizontal ) 545 else if (m_orient == Horizontal )
543 changeHBox(); 546 changeHBox();
544 else 547 else
545 changeVBox(); 548 changeVBox();
546 549
547 /* our own crap is added and children from change* */ 550 /* our own crap is added and children from change* */
548 if (m_parentTab ) { 551 delete tab;
549 delete tab; 552 delete box;
550 delete box;
551 }
552} 553}
553 554
554 555
555#if 0 556#if 0
556void OSplitter::reparentAll() { 557void OSplitter::reparentAll() {
557 if (m_container.isEmpty() ) 558 if (m_container.isEmpty() )
558 return; 559 return;
559 560
560 ContainerList::Iterator it = m_container.begin(); 561 ContainerList::Iterator it = m_container.begin();
561 for ( ; it != m_container.end(); ++it ) 562 for ( ; it != m_container.end(); ++it )
562 (*it).wid->reparent(0, 0, QPoint(0, 0) ); 563 (*it).wid->reparent(0, 0, QPoint(0, 0) );
563 564
564 565
565} 566}
566#endif 567#endif
567 568