summaryrefslogtreecommitdiff
path: root/libopie2/qt3/opieui/ojanuswidget.cpp
Unidiff
Diffstat (limited to 'libopie2/qt3/opieui/ojanuswidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/qt3/opieui/ojanuswidget.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libopie2/qt3/opieui/ojanuswidget.cpp b/libopie2/qt3/opieui/ojanuswidget.cpp
index 063e393..8bdbc03 100644
--- a/libopie2/qt3/opieui/ojanuswidget.cpp
+++ b/libopie2/qt3/opieui/ojanuswidget.cpp
@@ -711,129 +711,129 @@ void OJanusWidget::slotFontChanged()
711 711
712 if ( mTitleLabel != 0 ) 712 if ( mTitleLabel != 0 )
713 { 713 {
714 mTitleLabel->setFont( KGlobalSettings::generalFont() ); 714 mTitleLabel->setFont( KGlobalSettings::generalFont() );
715 QFont titleFont( mTitleLabel->font() ); 715 QFont titleFont( mTitleLabel->font() );
716 titleFont.setBold( true ); 716 titleFont.setBold( true );
717 mTitleLabel->setFont( titleFont ); 717 mTitleLabel->setFont( titleFont );
718 } 718 }
719#endif 719#endif
720 720
721 if( mFace == IconList ) 721 if( mFace == IconList )
722 { 722 {
723 QFont listFont( mIconList->font() ); 723 QFont listFont( mIconList->font() );
724 listFont.setBold( true ); 724 listFont.setBold( true );
725 mIconList->setFont( listFont ); 725 mIconList->setFont( listFont );
726 mIconList->invalidateHeight(); 726 mIconList->invalidateHeight();
727 mIconList->invalidateWidth(); 727 mIconList->invalidateWidth();
728 } 728 }
729} 729}
730 730
731// makes the treelist behave like the list of kcontrol 731// makes the treelist behave like the list of kcontrol
732void OJanusWidget::slotItemClicked(QListViewItem *it) 732void OJanusWidget::slotItemClicked(QListViewItem *it)
733{ 733{
734 if(it && (it->childCount()>0)) 734 if(it && (it->childCount()>0))
735 it->setOpen(!it->isOpen()); 735 it->setOpen(!it->isOpen());
736} 736}
737 737
738void OJanusWidget::setFocus() 738void OJanusWidget::setFocus()
739{ 739{
740 if( mValid == false ) { return; } 740 if( mValid == false ) { return; }
741 if( mFace == TreeList ) 741 if( mFace == TreeList )
742 { 742 {
743 mTreeList->setFocus(); 743 mTreeList->setFocus();
744 } 744 }
745 if( mFace == IconList ) 745 if( mFace == IconList )
746 { 746 {
747 mIconList->setFocus(); 747 mIconList->setFocus();
748 } 748 }
749 else if( mFace == Tabbed ) 749 else if( mFace == Tabbed )
750 { 750 {
751 mTabControl->setFocus(); 751 mTabControl->setFocus();
752 } 752 }
753 else if( mFace == Swallow ) 753 else if( mFace == Swallow )
754 { 754 {
755 mSwallowPage->setFocus(); 755 mSwallowPage->setFocus();
756 } 756 }
757 else if( mFace == Plain ) 757 else if( mFace == Plain )
758 { 758 {
759 mPlainPage->setFocus(); 759 mPlainPage->setFocus();
760 } 760 }
761} 761}
762 762
763 763
764QSize OJanusWidget::minimumSizeHint() const 764QSize OJanusWidget::minimumSizeHint() const
765{ 765{
766 if( mFace == TreeList || mFace == IconList ) 766 if( mFace == TreeList || mFace == IconList )
767 { 767 {
768 QSize s1( ODialog::spacingHint(), ODialog::spacingHint()*2 ); 768 QSize s1( ODialog::spacingHint(), ODialog::spacingHint()*2 );
769 QSize s2(0,0); 769 QSize s2(0,0);
770 QSize s3(0,0); 770 QSize s3(0,0);
771 QSize s4( mPageStack->sizeHint() ); 771 QSize s4( mPageStack->sizeHint() );
772 772
773 if( mFace == TreeList ) 773 if( mFace == TreeList )
774 { 774 {
775#if QT_VERSION < 300 775#if QT_VERSION < 0x030000
776 s1.rwidth() += style().splitterWidth(); 776 s1.rwidth() += style().splitterWidth();
777#else 777#else
778 s1.rwidth() += style().pixelMetric( QStyle::PM_SplitterWidth ); 778 s1.rwidth() += style().pixelMetric( QStyle::PM_SplitterWidth );
779#endif 779#endif
780 s2 = mTreeList->minimumSize(); 780 s2 = mTreeList->minimumSize();
781 } 781 }
782 else 782 else
783 { 783 {
784 mIconList->updateMinimumHeight(); 784 mIconList->updateMinimumHeight();
785 mIconList->updateWidth(); 785 mIconList->updateWidth();
786 s2 = mIconList->minimumSize(); 786 s2 = mIconList->minimumSize();
787 } 787 }
788 788
789 if( mTitleLabel->isVisible() == true ) 789 if( mTitleLabel->isVisible() == true )
790 { 790 {
791 s3 += mTitleLabel->sizeHint(); 791 s3 += mTitleLabel->sizeHint();
792 s3.rheight() += mTitleSep->minimumSize().height(); 792 s3.rheight() += mTitleSep->minimumSize().height();
793 } 793 }
794 794
795 // 795 //
796 // Select the tallest item. It has only effect in IconList mode 796 // Select the tallest item. It has only effect in IconList mode
797 // 797 //
798 int h1 = s1.rheight() + s3.rheight() + s4.height(); 798 int h1 = s1.rheight() + s3.rheight() + s4.height();
799 int h2 = QMAX( h1, s2.rheight() ); 799 int h2 = QMAX( h1, s2.rheight() );
800 800
801 return( QSize( s1.width()+s2.width()+QMAX(s3.width(),s4.width()), h2 ) ); 801 return( QSize( s1.width()+s2.width()+QMAX(s3.width(),s4.width()), h2 ) );
802 } 802 }
803 else if( mFace == Tabbed ) 803 else if( mFace == Tabbed )
804 { 804 {
805 return( mTabControl->sizeHint() ); 805 return( mTabControl->sizeHint() );
806 } 806 }
807 else if( mFace == Swallow ) 807 else if( mFace == Swallow )
808 { 808 {
809 return( mSwallowPage->minimumSize() ); 809 return( mSwallowPage->minimumSize() );
810 } 810 }
811 else if( mFace == Plain ) 811 else if( mFace == Plain )
812 { 812 {
813 return( mPlainPage->sizeHint() ); 813 return( mPlainPage->sizeHint() );
814 } 814 }
815 else 815 else
816 { 816 {
817 return( QSize( 100, 100 ) ); // Should never happen though. 817 return( QSize( 100, 100 ) ); // Should never happen though.
818 } 818 }
819 819
820} 820}
821 821
822 822
823QSize OJanusWidget::sizeHint() const 823QSize OJanusWidget::sizeHint() const
824{ 824{
825 return( minimumSizeHint() ); 825 return( minimumSizeHint() );
826} 826}
827 827
828 828
829void OJanusWidget::setTreeListAutoResize( bool state ) 829void OJanusWidget::setTreeListAutoResize( bool state )
830{ 830{
831 if( mFace == TreeList ) 831 if( mFace == TreeList )
832 { 832 {
833 mTreeListResizeMode = state == false ? 833 mTreeListResizeMode = state == false ?
834 QSplitter::KeepSize : QSplitter::Stretch; 834 QSplitter::KeepSize : QSplitter::Stretch;
835 QSplitter *splitter = (QSplitter*)(mTreeList->parentWidget()); 835 QSplitter *splitter = (QSplitter*)(mTreeList->parentWidget());
836 splitter->setResizeMode( mTreeList, mTreeListResizeMode ); 836 splitter->setResizeMode( mTreeList, mTreeListResizeMode );
837 } 837 }
838} 838}
839 839