summaryrefslogtreecommitdiffabout
path: root/korganizer
Unidiff
Diffstat (limited to 'korganizer') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/datenavigatorcontainer.cpp28
-rw-r--r--korganizer/kdatenavigator.cpp1
2 files changed, 13 insertions, 16 deletions
diff --git a/korganizer/datenavigatorcontainer.cpp b/korganizer/datenavigatorcontainer.cpp
index 27ba9e0..f6f62a4 100644
--- a/korganizer/datenavigatorcontainer.cpp
+++ b/korganizer/datenavigatorcontainer.cpp
@@ -196,58 +196,56 @@ void DateNavigatorContainer::checkUpdateDayMatrixDates()
196 if ( horizontalCount <= 1 ) 196 if ( horizontalCount <= 1 )
197 minSize = mNavigatorView->sizeHintTwoButtons( 4 ); 197 minSize = mNavigatorView->sizeHintTwoButtons( 4 );
198 else 198 else
199 minSize = mNavigatorView->sizeHintTwoButtons(); 199 minSize = mNavigatorView->sizeHintTwoButtons();
200 verticalCount = size().height() / minSize.height(); 200 verticalCount = size().height() / minSize.height();
201 horizontalCount = size().width() / minSize.width(); 201 horizontalCount = size().width() / minSize.width();
202 if ( horizontalCount == 0 ) 202 if ( horizontalCount == 0 )
203 horizontalCount = 1; 203 horizontalCount = 1;
204 if ( verticalCount == 0 ) 204 if ( verticalCount == 0 )
205 verticalCount = 1; 205 verticalCount = 1;
206 fontchange = true; 206 fontchange = true;
207 count = horizontalCount * verticalCount; 207 count = horizontalCount * verticalCount;
208 } else {
209 if ( mNavigatorView->fontChanged() ) {
210 fontchange = true;
211 fo = KOPrefs::instance()->mDateNavigatorFont;
212 mNavigatorView->changeFont( fo );
213 mNavigatorView->unsetFontChanged();
214 }
215 } 208 }
216 209
217 mLastDisplayedDN = horizontalCount*verticalCount-1; 210 mLastDisplayedDN = horizontalCount*verticalCount-1;
218 while ( count > ( mExtraViews.count() + 1 ) ) { 211 while ( count > ( mExtraViews.count() + 1 ) ) {
219 KDateNavigator *n = new KDateNavigator( this ); 212 KDateNavigator *n = new KDateNavigator( this );
220 n->setMonthSignalOffset ( mExtraViews.count()+1 ); 213 n->setMonthSignalOffset ( mExtraViews.count()+1 );
221 mExtraViews.append( n ); 214 mExtraViews.append( n );
222 n->setCalendar( mCalendar ); 215 n->setCalendar( mCalendar );
223 connectNavigatorView( n ); 216 connectNavigatorView( n );
224 // n->show(); 217 // n->show();
225 } 218 }
226 219
227
228 setBaseDates(); 220 setBaseDates();
221 mHorizontalCount = horizontalCount;
222 mVerticalCount = verticalCount;
223
224 }
225 if ( !fontchange ) {
226 if ( mNavigatorView->fontChanged() ) {
227 fontchange = true;
228 fo = KOPrefs::instance()->mDateNavigatorFont;
229 mNavigatorView->changeFont( fo );
230 mNavigatorView->unsetFontChanged();
231 }
232 }
229 if ( fontchange ) { 233 if ( fontchange ) {
230 //mNavigatorView->changeFont( fo );
231 uint i; 234 uint i;
232 for( i = 0; i < mExtraViews.count(); ++i ) { 235 for( i = 0; i < mLastDisplayedDN; ++i ) {
233 KDateNavigator *view = mExtraViews.at( i ); 236 KDateNavigator *view = mExtraViews.at( i );
234 view->changeFont( fo ); 237 view->changeFont( fo );
235 } 238 }
236 } 239 }
237 mHorizontalCount = horizontalCount;
238 mVerticalCount = verticalCount;
239
240 }
241
242 int theight = height() / mVerticalCount; 240 int theight = height() / mVerticalCount;
243 int twidth = width() / mHorizontalCount; 241 int twidth = width() / mHorizontalCount;
244 242
245 NavigatorBar *bar = mNavigatorView->navigatorBar(); 243 NavigatorBar *bar = mNavigatorView->navigatorBar();
246 if ( mHorizontalCount > 1 ) bar->showButtons( true, false ); 244 if ( mHorizontalCount > 1 ) bar->showButtons( true, false );
247 else bar->showButtons( true, true ); 245 else bar->showButtons( true, true );
248 246
249 mNavigatorView->setGeometry(0, 247 mNavigatorView->setGeometry(0,
250 0, twidth, theight ); 248 0, twidth, theight );
251 for( uint i = 0; i < mLastDisplayedDN; ++i ) { 249 for( uint i = 0; i < mLastDisplayedDN; ++i ) {
252 int x = ( i + 1 ) % mHorizontalCount; 250 int x = ( i + 1 ) % mHorizontalCount;
253 int y = ( i + 1 ) / mHorizontalCount; 251 int y = ( i + 1 ) / mHorizontalCount;
diff --git a/korganizer/kdatenavigator.cpp b/korganizer/kdatenavigator.cpp
index 2fca49e..1d09f40 100644
--- a/korganizer/kdatenavigator.cpp
+++ b/korganizer/kdatenavigator.cpp
@@ -52,25 +52,24 @@ KDateNavigator::KDateNavigator( QWidget *parent, const char *name )
52 setFrameStyle(QFrame::NoFrame); 52 setFrameStyle(QFrame::NoFrame);
53 QDate startDate = QDate::currentDate(); 53 QDate startDate = QDate::currentDate();
54 QGridLayout *topLayout = new QGridLayout(this,8,8); 54 QGridLayout *topLayout = new QGridLayout(this,8,8);
55 55
56 if (! startDate.isValid()) { 56 if (! startDate.isValid()) {
57 qDebug("KDateNavigator::invalid startdate "); 57 qDebug("KDateNavigator::invalid startdate ");
58 startDate = QDate::currentDate(); 58 startDate = QDate::currentDate();
59 } 59 }
60 mMonthSignalOffset = 0; 60 mMonthSignalOffset = 0;
61 mSelectedDates.append(startDate); 61 mSelectedDates.append(startDate);
62 m_MthYr = startDate; 62 m_MthYr = startDate;
63 m_bShowWeekNums = true; 63 m_bShowWeekNums = true;
64
65 setFont( KOPrefs::instance()->mDateNavigatorFont ); 64 setFont( KOPrefs::instance()->mDateNavigatorFont );
66 mNavigatorBar = new NavigatorBar( startDate, this ); 65 mNavigatorBar = new NavigatorBar( startDate, this );
67 topLayout->addMultiCellWidget( mNavigatorBar, 0, 0, 0, 7 ); 66 topLayout->addMultiCellWidget( mNavigatorBar, 0, 0, 0, 7 );
68 //mNavigatorBar->resize( 1,1); 67 //mNavigatorBar->resize( 1,1);
69 connect( mNavigatorBar, SIGNAL( goPrevYear() ), SIGNAL( goPrevYear() ) ); 68 connect( mNavigatorBar, SIGNAL( goPrevYear() ), SIGNAL( goPrevYear() ) );
70 connect( mNavigatorBar, SIGNAL( goPrevMonth() ), SIGNAL( goPrevMonth() ) ); 69 connect( mNavigatorBar, SIGNAL( goPrevMonth() ), SIGNAL( goPrevMonth() ) );
71 connect( mNavigatorBar, SIGNAL( goNextMonth() ), SIGNAL( goNextMonth() ) ); 70 connect( mNavigatorBar, SIGNAL( goNextMonth() ), SIGNAL( goNextMonth() ) );
72 connect( mNavigatorBar, SIGNAL( goNextYear() ), SIGNAL( goNextYear() ) ); 71 connect( mNavigatorBar, SIGNAL( goNextYear() ), SIGNAL( goNextYear() ) );
73 connect( mNavigatorBar, SIGNAL( monthSelected( int ) ), SLOT( slotMonthSelected( int ) ) ); 72 connect( mNavigatorBar, SIGNAL( monthSelected( int ) ), SLOT( slotMonthSelected( int ) ) );
74 73
75 // get the day of the week on the first day 74 // get the day of the week on the first day
76 QDate dayone(m_MthYr.year(), m_MthYr.month(), 1); 75 QDate dayone(m_MthYr.year(), m_MthYr.month(), 1);