author | zautrix <zautrix> | 2005-03-20 20:24:06 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-20 20:24:06 (UTC) |
commit | b32c8de5dcd6c4f8dce9415fb686970e2c991ebb (patch) (side-by-side diff) | |
tree | ee5ba00bcc830d011a816981fd20dcf781b9cbf5 | |
parent | 64068741e3b82a34c1b8a67da412ac88841b640c (diff) | |
download | kdepimpi-b32c8de5dcd6c4f8dce9415fb686970e2c991ebb.zip kdepimpi-b32c8de5dcd6c4f8dce9415fb686970e2c991ebb.tar.gz kdepimpi-b32c8de5dcd6c4f8dce9415fb686970e2c991ebb.tar.bz2 |
nf
-rw-r--r-- | korganizer/kodaymatrix.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp index f864022..ae0a051 100644 --- a/korganizer/kodaymatrix.cpp +++ b/korganizer/kodaymatrix.cpp @@ -437,19 +437,29 @@ QString KODayMatrix::getHolidayLabel(int offset) if (offset < 0 || offset > NUMDAYS-1) { qDebug("Wrong offset1 "); return 0; } return mHolidays[offset]; } int KODayMatrix::getDayIndexFrom(int x, int y) -{ +{ + int colModulo = (width()-2) % 7; + int rowModulo = (height()-2) % 6; +#if 0 return 7*(y/daysize.height()) + (KOGlobals::self()->reverseLayout() ? 6 - x/daysize.width() : x/daysize.width()); +#endif + int xVal = (x-colModulo/2-2)/daysize.width(); + int yVal = (y-rowModulo/2-2)/daysize.height(); + + + return 7*(yVal) + xVal; + } // ---------------------------------------------------------------------------- // M O U S E E V E N T H A N D L I N G // ---------------------------------------------------------------------------- void KODayMatrix::mousePressEvent (QMouseEvent* e) { @@ -637,17 +647,17 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent) int dheight = daysize.height(); int dwidth = daysize.width(); int row,col; int selw, selh; int xyOff = frameWidth(); int colModulo = sz.width() % 7; int rowModulo = sz.height() % 6; - qDebug("col %d row %d ",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); p.drawRect(0, 0, sz.width()+1, sz.height()+1); int mSelStartT = mSelStart; |