author | zautrix <zautrix> | 2005-03-20 19:52:47 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-20 19:52:47 (UTC) |
commit | 64068741e3b82a34c1b8a67da412ac88841b640c (patch) (side-by-side diff) | |
tree | 70a665bab53da7aa211f523daebbdbff08136df4 /korganizer | |
parent | d998afaaf0fe1af0b9b5e3d6f4cb504e35e35025 (diff) | |
download | kdepimpi-64068741e3b82a34c1b8a67da412ac88841b640c.zip kdepimpi-64068741e3b82a34c1b8a67da412ac88841b640c.tar.gz kdepimpi-64068741e3b82a34c1b8a67da412ac88841b640c.tar.bz2 |
nf
-rw-r--r-- | korganizer/kodaymatrix.cpp | 42 |
1 files changed, 20 insertions, 22 deletions
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp index 507f18e..f864022 100644 --- a/korganizer/kodaymatrix.cpp +++ b/korganizer/kodaymatrix.cpp @@ -456,12 +456,14 @@ void KODayMatrix::mousePressEvent (QMouseEvent* e) if ( e->button() == LeftButton ) mouseDown = true; mSelStart = getDayIndexFrom(e->x(), e->y()); if (mSelStart > NUMDAYS-1) mSelStart=NUMDAYS-1; mSelInit = mSelStart; + mSelEnd = mSelStart; + repaint(false); } void KODayMatrix::mouseReleaseEvent (QMouseEvent* e) { if ( e->button() == LeftButton ) if ( ! mouseDown ) { @@ -637,13 +639,13 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent) int dwidth = daysize.width(); int row,col; int selw, selh; int xyOff = frameWidth(); int colModulo = sz.width() % 7; int rowModulo = sz.height() % 6; - //qDebug("off %d col %d row %d ",xyOff,colModulo,rowModulo ); + qDebug("col %d row %d ",colModulo,rowModulo ); bool isRTL = KOGlobals::self()->reverseLayout(); // draw background and topleft frame p.fillRect(pevent->rect(), mDefaultBackColor); p.setPen(mDefaultTextColor); @@ -673,34 +675,16 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent) } } if ( ! skip ) { row = mSelStartT/7; col = mSelStartT -row*7; QColor selcol = KOPrefs::instance()->mHighlightColor; - - - int addCol = 0; int addRow = 0; int addRow2 = 0; int addCol2 = 0; -#if 0 - if ( colModulo ) { - if ( col >= 7 - colModulo ) - addCol = col - 7 + colModulo; - } - if ( rowModulo ) { - if ( row >= 6 - rowModulo ) - addRow = row - 5 + rowModulo; - } -#endif - - - - - if (row == mSelEndT/7) { if ( rowModulo ) { if ( row >= 6 - rowModulo ) addRow = row - 5 + rowModulo; } if ( colModulo ) { @@ -789,14 +773,16 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent) } // if today then draw rectangle around day if (today == i) { tmppen = p.pen(); QPen mTodayPen(p.pen()); - - mTodayPen.setWidth(mTodayMarginWidth); + if ( daysize.width() < 20 ) + mTodayPen.setWidth(1); + else + mTodayPen.setWidth(mTodayMarginWidth); //draw red rectangle for holidays if (!mHolidays[i].isNull()) { if (actcol == mDefaultTextColor) { mTodayPen.setColor(KOPrefs::instance()->mHolidayColor); } else { mTodayPen.setColor(mHolidayColorShaded); @@ -805,13 +791,25 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent) //draw gray rectangle for today if in selection if (i >= mSelStartT && i <= mSelEndT) { QColor grey("grey"); mTodayPen.setColor(grey); } p.setPen(mTodayPen); - p.drawRect(col*dwidth, row*dheight, dwidth, dheight); + + + 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; + } + 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(); |