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.cpp36
1 files changed, 23 insertions, 13 deletions
diff --git a/korganizer/datenavigatorcontainer.cpp b/korganizer/datenavigatorcontainer.cpp
index f6f62a4..92abae6 100644
--- a/korganizer/datenavigatorcontainer.cpp
+++ b/korganizer/datenavigatorcontainer.cpp
@@ -155,25 +155,25 @@ void DateNavigatorContainer::setCalendar( Calendar *cal )
for( uint i = 0; i < mLastDisplayedDN; ++i ) {
KDateNavigator *n = mExtraViews.at( i );
n->setCalendar( cal );
}
}
void DateNavigatorContainer::checkUpdateDayMatrixDates()
{
//qDebug("KODNC: wid %d hei %d ", width(), height());
mUpdateTimer->stop();
//return;
if ( width() < 3 || height() < 3 )
return;
- static int lastWid = 0;
+ static int lastWid = 0;
static int lastHei = 0;
if ( lastWid == width() && height() == lastHei ) {
qDebug("KODNC: No layout computing needed. ");
} else {
lastWid = width();
lastHei = height();
QSize minSize = mNavigatorView->yourSizeHint();
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() );
@@ -196,52 +196,62 @@ void DateNavigatorContainer::checkUpdateDayMatrixDates()
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;
fontchange = true;
count = horizontalCount * verticalCount;
- }
-
+ } else {
+ if ( mNavigatorView->fontChanged() ) {
+ fontchange = true;
+ fo = KOPrefs::instance()->mDateNavigatorFont;
+ mNavigatorView->changeFont( fo );
+ mNavigatorView->unsetFontChanged();
+ }
+ }
mLastDisplayedDN = horizontalCount*verticalCount-1;
while ( count > ( mExtraViews.count() + 1 ) ) {
KDateNavigator *n = new KDateNavigator( this );
n->setMonthSignalOffset ( mExtraViews.count()+1 );
mExtraViews.append( n );
n->setCalendar( mCalendar );
connectNavigatorView( n );
// n->show();
}
setBaseDates();
+ if ( fontchange ) {
+ //mNavigatorView->changeFont( fo );
+ uint i;
+ for( i = 0; i < mExtraViews.count(); ++i ) {
+ KDateNavigator *view = mExtraViews.at( i );
+ view->changeFont( fo );
+ }
+ }
mHorizontalCount = horizontalCount;
mVerticalCount = verticalCount;
}
- if ( !fontchange ) {
- if ( mNavigatorView->fontChanged() ) {
- fontchange = true;
- fo = KOPrefs::instance()->mDateNavigatorFont;
- mNavigatorView->changeFont( fo );
- mNavigatorView->unsetFontChanged();
- }
- }
- if ( fontchange ) {
+ if ( mNavigatorView->fontChanged() && ! fontchange ) {
+ qDebug("KDNC: Resetting all fonts ");
+ fo = KOPrefs::instance()->mDateNavigatorFont;
+ mNavigatorView->changeFont( fo );
+ mNavigatorView->unsetFontChanged();
uint i;
- for( i = 0; i < mLastDisplayedDN; ++i ) {
+ for( i = 0; i < mExtraViews.count(); ++i ) {
KDateNavigator *view = mExtraViews.at( i );
view->changeFont( fo );
}
}
int theight = height() / mVerticalCount;
int twidth = width() / mHorizontalCount;
NavigatorBar *bar = mNavigatorView->navigatorBar();
if ( mHorizontalCount > 1 ) bar->showButtons( true, false );
else bar->showButtons( true, true );
mNavigatorView->setGeometry(0,