summaryrefslogtreecommitdiffabout
path: root/korganizer/kodaymatrix.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/kodaymatrix.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/kodaymatrix.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp
index 9baff20..493382d 100644
--- a/korganizer/kodaymatrix.cpp
+++ b/korganizer/kodaymatrix.cpp
@@ -390,50 +390,50 @@ void KODayMatrix::updateView(QDate actdate)
// reset index of selection according to shift of starting date from startdate to actdate
if (mSelStart != NOSELECTION) {
int tmp = actdate.daysTo(startdate);
//kdDebug() << "Shift of Selection1: " << mSelStart << " - " << mSelEnd << " -> " << tmp << "(" << offset << ")" << endl;
// shift selection if new one would be visible at least partly !
if (mSelStart+tmp < NUMDAYS && mSelEnd+tmp >= 0) {
// nested if is required for next X display pushed from a different month - correction required
// otherwise, for month forward and backward, it must be avoided
if( mSelStart > NUMDAYS || mSelStart < 0 )
mSelStart = mSelStart + tmp;
if( mSelEnd > NUMDAYS || mSelEnd < 0 )
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
QPtrList<Event> eventlist = mCalendar->events( days[ i ] );
int numEvents = eventlist.count();
Event *event;
for( event = eventlist.first(); event != 0;event=eventlist.next()) {
ushort recurType = event->doesRecur();
if ( ( recurType == Recurrence::rDaily &&
!KOPrefs::instance()->mDailyRecur ) ||
( recurType == Recurrence::rWeekly &&
!KOPrefs::instance()->mWeeklyRecur ) ) {
numEvents--;
}
@@ -814,90 +814,94 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent)
if (actcol == mDefaultTextColor) {
mTodayPen.setColor(KOPrefs::instance()->mHolidayColor);
} else {
mTodayPen.setColor(mHolidayColorShaded);
}
}
//draw gray rectangle for today if in selection
if (i >= mSelStartT && i <= mSelEndT) {
QColor grey("grey");
mTodayPen.setColor(grey);
}
p.setPen(mTodayPen);
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
if (!mHolidays[i].isNull()) {
if ( bDays.testBit(i) ) {
p.setPen(Qt::green);
} else {
if (actcol == mDefaultTextColor) {
p.setPen(KOPrefs::instance()->mHolidayColor);
} else {
p.setPen(mHolidayColorShaded);
}
}
}
// draw selected days with special color
// DO NOT specially highlight holidays in selection !
if (i >= mSelStartT && i <= mSelEndT) {
;//p.setPen(mSelectedDaysColor);
}
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);
}
}
int off = xyOff;
bitBlt (this, off, off, &myPix, 0 ,0,width(), height() ,CopyROP);
//qDebug("ffffffffff %d ", off);
}
// ----------------------------------------------------------------------------
// R E SI Z E E V E N T H A N D L I N G
// ----------------------------------------------------------------------------
void KODayMatrix::resizeEvent(QResizeEvent *)