summaryrefslogtreecommitdiffabout
path: root/korganizer/datenavigatorcontainer.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/datenavigatorcontainer.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/datenavigatorcontainer.cpp13
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
@@ -44,8 +44,9 @@ DateNavigatorContainer::DateNavigatorContainer( QWidget *parent,
mNavigatorView = new KDateNavigator( this, name );
connectNavigatorView( mNavigatorView );
+ //setSizePolicy( QSizePolicy (QSizePolicy::Expanding,QSizePolicy::Expanding) );
}
DateNavigatorContainer::~DateNavigatorContainer()
{
@@ -174,19 +175,26 @@ void DateNavigatorContainer::resizeEvent( QResizeEvent * e )
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;
@@ -230,8 +238,9 @@ void DateNavigatorContainer::resizeEvent( QResizeEvent * e )
}
mHorizontalCount = horizontalCount;
mVerticalCount = verticalCount;
}
+ //qDebug("COUNT %d ", mExtraViews.count());
int height = size().height() / verticalCount;
int width = size().width() / horizontalCount;
NavigatorBar *bar = mNavigatorView->navigatorBar();