Diffstat (limited to 'korganizer/datenavigatorcontainer.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | korganizer/datenavigatorcontainer.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/korganizer/datenavigatorcontainer.cpp b/korganizer/datenavigatorcontainer.cpp index b147427..ab0dd50 100644 --- a/korganizer/datenavigatorcontainer.cpp +++ b/korganizer/datenavigatorcontainer.cpp @@ -45,6 +45,7 @@ DateNavigatorContainer::DateNavigatorContainer( QWidget *parent, mNavigatorView = new KDateNavigator( this, name ); connectNavigatorView( mNavigatorView ); + //setSizePolicy( QSizePolicy (QSizePolicy::Expanding,QSizePolicy::Expanding) ); } DateNavigatorContainer::~DateNavigatorContainer() @@ -175,17 +176,24 @@ void DateNavigatorContainer::resizeEvent( QResizeEvent * e ) //qDebug(" wattdatt %d new %d %d ", size().width() ,e->size().width() , minSize.width() ); //qDebug("COUNT %d %d %d %d ", verticalCount, horizontalCount , mVerticalCount, mHorizontalCount ); bool fontchange = false; + if ( horizontalCount == 1) + horizontalCount = size().width() / mNavigatorView->yourFullSizeHint().width(); QFont fo; if ( horizontalCount != mHorizontalCount || verticalCount != mVerticalCount ) { uint count = horizontalCount * verticalCount; if ( count == 0 ) { bool ok; - fo = mNavigatorView->yourFontHint( size() , &ok); + fo = mNavigatorView->yourFontHint( size() , &ok ); //mNavigatorView->resize( size() ); //if ( ! ok ) // return; - minSize = mNavigatorView->sizeHintTwoButtons(); + int butt = 2; + horizontalCount = size().width() / mNavigatorView->sizeHintTwoButtons( ).width(); + if ( horizontalCount <= 1 ) + minSize = mNavigatorView->sizeHintTwoButtons( 4 ); + else + minSize = mNavigatorView->sizeHintTwoButtons(); verticalCount = size().height() / minSize.height(); horizontalCount = size().width() / minSize.width(); if ( horizontalCount == 0 ) @@ -231,6 +239,7 @@ void DateNavigatorContainer::resizeEvent( QResizeEvent * e ) mHorizontalCount = horizontalCount; mVerticalCount = verticalCount; } + //qDebug("COUNT %d ", mExtraViews.count()); int height = size().height() / verticalCount; int width = size().width() / horizontalCount; |