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 @@ -42,12 +42,13 @@ DateNavigatorContainer::DateNavigatorContainer( QWidget *parent, { mExtraViews.setAutoDelete( true ); mNavigatorView = new KDateNavigator( this, name ); connectNavigatorView( mNavigatorView ); + //setSizePolicy( QSizePolicy (QSizePolicy::Expanding,QSizePolicy::Expanding) ); } DateNavigatorContainer::~DateNavigatorContainer() { } @@ -172,23 +173,30 @@ void DateNavigatorContainer::resizeEvent( QResizeEvent * e ) int verticalCount = size().height() / minSize.height(); int horizontalCount = size().width() / minSize.width(); //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 ) horizontalCount = 1; if ( verticalCount == 0 ) verticalCount = 1; @@ -228,12 +236,13 @@ void DateNavigatorContainer::resizeEvent( QResizeEvent * e ) view->changeFont( fo ); } } mHorizontalCount = horizontalCount; mVerticalCount = verticalCount; } + //qDebug("COUNT %d ", mExtraViews.count()); int height = size().height() / verticalCount; int width = size().width() / horizontalCount; NavigatorBar *bar = mNavigatorView->navigatorBar(); if ( horizontalCount > 1 ) bar->showButtons( true, false ); else bar->showButtons( true, true ); |