-rw-r--r-- | libqtaux/qsplitter.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libqtaux/qsplitter.cpp b/libqtaux/qsplitter.cpp index 39321f8..959d5e1 100644 --- a/libqtaux/qsplitter.cpp +++ b/libqtaux/qsplitter.cpp | |||
@@ -682,97 +682,97 @@ void QSplitter::doResize() | |||
682 | } else if ( s->mode == KeepSize ) { | 682 | } else if ( s->mode == KeepSize ) { |
683 | a[i].stretch = 0; | 683 | a[i].stretch = 0; |
684 | a[i].minimumSize = pick( minSize(s->wid) ); | 684 | a[i].minimumSize = pick( minSize(s->wid) ); |
685 | a[i].sizeHint = s->sizer; | 685 | a[i].sizeHint = s->sizer; |
686 | a[i].maximumSize = pick( s->wid->maximumSize() ); | 686 | a[i].maximumSize = pick( s->wid->maximumSize() ); |
687 | a[i].empty = FALSE; | 687 | a[i].empty = FALSE; |
688 | } else if ( s->mode == FollowSizeHint ) { | 688 | } else if ( s->mode == FollowSizeHint ) { |
689 | a[i].stretch = 0; | 689 | a[i].stretch = 0; |
690 | a[i].minimumSize = a[i].sizeHint = pick( s->wid->sizeHint() ); | 690 | a[i].minimumSize = a[i].sizeHint = pick( s->wid->sizeHint() ); |
691 | a[i].maximumSize = pick( s->wid->maximumSize() ); | 691 | a[i].maximumSize = pick( s->wid->maximumSize() ); |
692 | a[i].empty = FALSE; | 692 | a[i].empty = FALSE; |
693 | } else { //proportional | 693 | } else { //proportional |
694 | a[i].stretch = s->sizer; | 694 | a[i].stretch = s->sizer; |
695 | a[i].maximumSize = pick( s->wid->maximumSize() ); | 695 | a[i].maximumSize = pick( s->wid->maximumSize() ); |
696 | a[i].sizeHint = a[i].minimumSize = pick( minSize(s->wid) ); | 696 | a[i].sizeHint = a[i].minimumSize = pick( minSize(s->wid) ); |
697 | a[i].empty = FALSE; | 697 | a[i].empty = FALSE; |
698 | } | 698 | } |
699 | } | 699 | } |
700 | 700 | ||
701 | qGeomCalc( a, 0, n, pick( r.topLeft() ), pick( r.size() ), 0 ); | 701 | qGeomCalc( a, 0, n, pick( r.topLeft() ), pick( r.size() ), 0 ); |
702 | for ( i = 0; i< n; i++ ) { | 702 | for ( i = 0; i< n; i++ ) { |
703 | QSplitterLayoutStruct *s = data->list.at(i); | 703 | QSplitterLayoutStruct *s = data->list.at(i); |
704 | if ( orient == Horizontal ) | 704 | if ( orient == Horizontal ) |
705 | s->wid->setGeometry( a[i].pos, r.top(), a[i].size, r.height() ); | 705 | s->wid->setGeometry( a[i].pos, r.top(), a[i].size, r.height() ); |
706 | else | 706 | else |
707 | s->wid->setGeometry( r.left(), a[i].pos, r.width(), a[i].size ); | 707 | s->wid->setGeometry( r.left(), a[i].pos, r.width(), a[i].size ); |
708 | } | 708 | } |
709 | 709 | ||
710 | } | 710 | } |
711 | 711 | ||
712 | 712 | ||
713 | void QSplitter::recalc( bool update ) | 713 | void QSplitter::recalc( bool update ) |
714 | { | 714 | { |
715 | int fi = 2*frameWidth(); | 715 | int fi = 2*frameWidth(); |
716 | int maxl = fi; | 716 | int maxl = fi; |
717 | int minl = fi; | 717 | int minl = fi; |
718 | int maxt = QWIDGETSIZE_MAX; | 718 | int maxt = QWIDGETSIZE_MAX; |
719 | int mint = fi; | 719 | int mint = fi; |
720 | int n = data->list.count(); | 720 | int n = data->list.count(); |
721 | bool first = TRUE; | 721 | bool first = TRUE; |
722 | /* | 722 | /* |
723 | The splitter before a hidden widget is always hidden. | 723 | The splitter before a hidden widget is always hidden. |
724 | The splitter before the first visible widget is hidden. | 724 | The splitter before the first visible widget is hidden. |
725 | The splitter before any other visible widget is visible. | 725 | The splitter before any other visible widget is visible. |
726 | */ | 726 | */ |
727 | for ( int i = 0; i< n; i++ ) { | 727 | for ( int i = 0; i< n; i++ ) { |
728 | QSplitterLayoutStruct *s = data->list.at(i); | 728 | QSplitterLayoutStruct *s = data->list.at(i); |
729 | if ( !s->isSplitter ) { | 729 | if ( !s->isSplitter ) { |
730 | QSplitterLayoutStruct *p = (i > 0) ? p = data->list.at( i-1 ) : 0; | 730 | QSplitterLayoutStruct *p = (i > 0) ? data->list.at( i-1 ) : 0; |
731 | if ( p && p->isSplitter ) | 731 | if ( p && p->isSplitter ) |
732 | if ( first || s->wid->isHidden() ) | 732 | if ( first || s->wid->isHidden() ) |
733 | p->wid->hide(); //may trigger new recalc | 733 | p->wid->hide(); //may trigger new recalc |
734 | else | 734 | else |
735 | p->wid->show(); //may trigger new recalc | 735 | p->wid->show(); //may trigger new recalc |
736 | if ( !s->wid->isHidden() ) | 736 | if ( !s->wid->isHidden() ) |
737 | first = FALSE; | 737 | first = FALSE; |
738 | } | 738 | } |
739 | } | 739 | } |
740 | 740 | ||
741 | bool empty=TRUE; | 741 | bool empty=TRUE; |
742 | for ( int j = 0; j< n; j++ ) { | 742 | for ( int j = 0; j< n; j++ ) { |
743 | QSplitterLayoutStruct *s = data->list.at(j); | 743 | QSplitterLayoutStruct *s = data->list.at(j); |
744 | if ( !s->wid->isHidden() ) { | 744 | if ( !s->wid->isHidden() ) { |
745 | empty = FALSE; | 745 | empty = FALSE; |
746 | if ( s->isSplitter ) { | 746 | if ( s->isSplitter ) { |
747 | minl += s->sizer; | 747 | minl += s->sizer; |
748 | maxl += s->sizer; | 748 | maxl += s->sizer; |
749 | } else { | 749 | } else { |
750 | QSize minS = minSize(s->wid); | 750 | QSize minS = minSize(s->wid); |
751 | minl += pick( minS ); | 751 | minl += pick( minS ); |
752 | maxl += pick( s->wid->maximumSize() ); | 752 | maxl += pick( s->wid->maximumSize() ); |
753 | mint = QMAX( mint, trans( minS )); | 753 | mint = QMAX( mint, trans( minS )); |
754 | int tm = trans( s->wid->maximumSize() ); | 754 | int tm = trans( s->wid->maximumSize() ); |
755 | if ( tm > 0 ) | 755 | if ( tm > 0 ) |
756 | maxt = QMIN( maxt, tm ); | 756 | maxt = QMIN( maxt, tm ); |
757 | } | 757 | } |
758 | } | 758 | } |
759 | } | 759 | } |
760 | if ( empty ) | 760 | if ( empty ) |
761 | maxl = maxt = 0; | 761 | maxl = maxt = 0; |
762 | else | 762 | else |
763 | maxl = QMIN( maxl, QWIDGETSIZE_MAX ); | 763 | maxl = QMIN( maxl, QWIDGETSIZE_MAX ); |
764 | if ( maxt < mint ) | 764 | if ( maxt < mint ) |
765 | maxt = mint; | 765 | maxt = mint; |
766 | 766 | ||
767 | if ( orient == Horizontal ) { | 767 | if ( orient == Horizontal ) { |
768 | setMaximumSize( maxl, maxt ); | 768 | setMaximumSize( maxl, maxt ); |
769 | setMinimumSize( minl, mint ); | 769 | setMinimumSize( minl, mint ); |
770 | } else { | 770 | } else { |
771 | setMaximumSize( maxt, maxl ); | 771 | setMaximumSize( maxt, maxl ); |
772 | setMinimumSize( mint, minl ); | 772 | setMinimumSize( mint, minl ); |
773 | } | 773 | } |
774 | if ( update ) | 774 | if ( update ) |
775 | doResize(); | 775 | doResize(); |
776 | } | 776 | } |
777 | 777 | ||
778 | /*! \enum QSplitter::ResizeMode | 778 | /*! \enum QSplitter::ResizeMode |