summaryrefslogtreecommitdiffabout
path: root/korganizer
Side-by-side diff
Diffstat (limited to 'korganizer') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/kodaymatrix.cpp40
1 files changed, 19 insertions, 21 deletions
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp
index 507f18e..f864022 100644
--- a/korganizer/kodaymatrix.cpp
+++ b/korganizer/kodaymatrix.cpp
@@ -459,6 +459,8 @@ void KODayMatrix::mousePressEvent (QMouseEvent* e)
mSelStart = getDayIndexFrom(e->x(), e->y());
if (mSelStart > NUMDAYS-1) mSelStart=NUMDAYS-1;
mSelInit = mSelStart;
+ mSelEnd = mSelStart;
+ repaint(false);
}
void KODayMatrix::mouseReleaseEvent (QMouseEvent* e)
@@ -640,7 +642,7 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent)
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();
@@ -676,28 +678,10 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent)
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 )
@@ -792,7 +776,9 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent)
if (today == i) {
tmppen = p.pen();
QPen mTodayPen(p.pen());
-
+ if ( daysize.width() < 20 )
+ mTodayPen.setWidth(1);
+ else
mTodayPen.setWidth(mTodayMarginWidth);
//draw red rectangle for holidays
if (!mHolidays[i].isNull()) {
@@ -808,7 +794,19 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent)
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);
}