-rw-r--r-- | korganizer/kdatenavigator.cpp | 4 | ||||
-rw-r--r-- | korganizer/kdatenavigator.h | 2 | ||||
-rw-r--r-- | korganizer/kodaymatrix.cpp | 8 |
3 files changed, 9 insertions, 5 deletions
diff --git a/korganizer/kdatenavigator.cpp b/korganizer/kdatenavigator.cpp index 4b50b5a..2321acb 100644 --- a/korganizer/kdatenavigator.cpp +++ b/korganizer/kdatenavigator.cpp @@ -163,26 +163,26 @@ QSize KDateNavigator::sizeHintTwoButtons() const QSize day = daymatrix->sizeHint(); QSize nav = mNavigatorBar->sizeHintTwoButtons(); int wid = fm.width( "30") + day.width()+3; int hei = fm.height() +day.height()+nav.height()+2; if ( wid < nav.width() ) wid = nav.width() ; //qDebug("KDateNavigator+++++++++++++ %d %d", wid , hei); return QSize ( wid, hei ); } void KDateNavigator::slotMonthSelected( int m ) { if ( m_MthYr.month() <= mMonthSignalOffset) - m += 12; - int mo = m - mMonthSignalOffset; + m += 12; + //qDebug("%d mMonthSignalOffset %d emit %d", m, mMonthSignalOffset, m - mMonthSignalOffset); emit monthSelected( m - mMonthSignalOffset ); } void KDateNavigator::setCalendar( Calendar *cal ) { daymatrix->setCalendar( cal ); } void KDateNavigator::setBaseDate( const QDate &date , bool doRepaint ) // = true { m_MthYr = date; diff --git a/korganizer/kdatenavigator.h b/korganizer/kdatenavigator.h index d1f32b6..77b9b7c 100644 --- a/korganizer/kdatenavigator.h +++ b/korganizer/kdatenavigator.h @@ -54,25 +54,25 @@ class KDateNavigator: public QFrame * With FollowMonth, it has the same effect * as FollowDay but also adjusts the month that is * visible and emits monthPassed() when the month changes. */ enum RolloverType { None, FollowDay, FollowMonth } ; void enableRollover( RolloverType ); void setShowWeekNums( bool enabled ); void setCalendar( Calendar * ); void setBaseDate( const QDate & , bool doRepaint = true ); KCal::DateList selectedDates() const { return mSelectedDates; } NavigatorBar *navigatorBar() const { return mNavigatorBar; } - void setMonthSignalOffset ( int off ) { mMonthSignalOffset = off;} + void setMonthSignalOffset ( int off ) { mMonthSignalOffset = off%12;} QSize yourSizeHint() { return mySizeHint; } QFont yourFontHint( QSize , bool * b); bool fontChanged() {return mFontChanged; } void unsetFontChanged() { mFontChanged = false; } KODayMatrix *dayMatrix() { return daymatrix ;} QSize sizeHint() const; QSize sizeHintTwoButtons() const; void changeFont ( QFont fo ); public slots: void selectDates( const KCal::DateList & ); void updateView(); void updateConfig(); diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp index 9baff20..493382d 100644 --- a/korganizer/kodaymatrix.cpp +++ b/korganizer/kodaymatrix.cpp @@ -402,26 +402,26 @@ void KODayMatrix::updateView(QDate actdate) mSelEnd = mSelEnd + tmp; } } startdate = actdate; mDayChanged = true; recalculateToday(); } //qDebug("restart Timer %d vis: %d", mDayChanged, isVisible() ); if ( !isVisible() ) { mPendingUpdateBeforeRepaint = true; } else { #ifdef DESKTOP_VERSION - //mRepaintTimer->start( 150 ); - mUpdateTimer->start( 150 ); + //mRepaintTimer->start( 100 ); + mUpdateTimer->start( 100 ); #else mRepaintTimer->start( 350 ); mUpdateTimer->start( 1200 ); #endif } } void KODayMatrix::updateEvents() { if ( !mCalendar ) return; for( int i = 0; i < NUMDAYS; i++ ) { // if events are set for the day then remember to draw it bold @@ -826,24 +826,26 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent) int addCol = 0; int addRow = 0; if (rowModulo) { if ( row >= 6 - rowModulo ) addRow = row - 5 + rowModulo; } if ( colModulo ) { if ( col >= 7 - colModulo ) addCol = col - 6 + colModulo-1; } + if ( col == 0 ) + addCol = 1; p.drawRect(col*dwidth+addCol, row*dheight+addRow, dwidth, dheight+1); p.setPen(tmppen); } // if any events are on that day then draw it using a bold font if (events[i] > 0) { QFont myFont = font(); myFont.setBold(true); p.setFont(myFont); } // if it is a holiday then use the default holiday color @@ -868,24 +870,26 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent) int addCol = 0; int addRow = 0; if ( colModulo ) { if ( col >= 7 - colModulo ) addCol = col - 7 + colModulo; } if ( rowModulo ) { if ( row >= 6 - rowModulo ) addRow = row - 5 + rowModulo; } //qDebug("add %d %d -- %d %d ", col, addCol, row, addRow); ++addCol;//++addCol; + if ( row == 0) + addRow = 1; p.drawText(col*dwidth+addCol, row*dheight+addRow, dwidth, dheight, Qt::AlignHCenter | Qt::AlignVCenter, daylbls[i]); // reset color to actual color if (!mHolidays[i].isNull()) { p.setPen(actcol); } // reset bold font to plain font if (events[i] > 0) { QFont myFont = font(); myFont.setBold(false); p.setFont(myFont); |