summaryrefslogtreecommitdiffabout
path: root/korganizer/kodaymatrix.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/kodaymatrix.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kodaymatrix.cpp42
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
@@ -461,2 +461,4 @@ void KODayMatrix::mousePressEvent (QMouseEvent* e)
mSelInit = mSelStart;
+ mSelEnd = mSelStart;
+ repaint(false);
}
@@ -642,3 +644,3 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent)
int rowModulo = sz.height() % 6;
- //qDebug("off %d col %d row %d ",xyOff,colModulo,rowModulo );
+ qDebug("col %d row %d ",colModulo,rowModulo );
@@ -678,5 +680,2 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent)
QColor selcol = KOPrefs::instance()->mHighlightColor;
-
-
-
int addCol = 0;
@@ -685,17 +684,2 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent)
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) {
@@ -794,4 +778,6 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent)
QPen mTodayPen(p.pen());
-
- mTodayPen.setWidth(mTodayMarginWidth);
+ if ( daysize.width() < 20 )
+ mTodayPen.setWidth(1);
+ else
+ mTodayPen.setWidth(mTodayMarginWidth);
//draw red rectangle for holidays
@@ -810,3 +796,15 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent)
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);