author | zautrix <zautrix> | 2004-09-17 12:38:04 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-09-17 12:38:04 (UTC) |
commit | 053b3550aa2b987d7aeaf74cc458754d7e80a67b (patch) (unidiff) | |
tree | 4190b96b6b581c18943ac7e1cdd5cbca96741eae | |
parent | dd33ac512eb4b4b647fb3423f7cdb39ec322221b (diff) | |
download | kdepimpi-053b3550aa2b987d7aeaf74cc458754d7e80a67b.zip kdepimpi-053b3550aa2b987d7aeaf74cc458754d7e80a67b.tar.gz kdepimpi-053b3550aa2b987d7aeaf74cc458754d7e80a67b.tar.bz2 |
Better datepicker
-rw-r--r-- | microkde/kdatetbl.cpp | 28 | ||||
-rw-r--r-- | microkde/kdatetbl.h | 1 |
2 files changed, 21 insertions, 8 deletions
diff --git a/microkde/kdatetbl.cpp b/microkde/kdatetbl.cpp index 0a2d1f5..146291b 100644 --- a/microkde/kdatetbl.cpp +++ b/microkde/kdatetbl.cpp | |||
@@ -97,2 +97,3 @@ KDateTable::KDateTable(QWidget *parent, QDate date_, const char* name, WFlags f) | |||
97 | #endif | 97 | #endif |
98 | mMarkCurrent = false; | ||
98 | setDate(date_); // this initializes firstday, numdays, numDaysPrevMonth | 99 | setDate(date_); // this initializes firstday, numdays, numDaysPrevMonth |
@@ -172,9 +173,11 @@ KDateTable::paintCell(QPainter *painter, int row, int col) | |||
172 | { | 173 | { |
174 | if(mMarkCurrent && firstday+QDate::currentDate().day()-1==pos) | ||
175 | painter->setPen(green); | ||
176 | else | ||
177 | painter->setPen(red); | ||
173 | if(hasFocus()) | 178 | if(hasFocus()) |
174 | { // draw the currently selected date | 179 | { |
175 | painter->setPen(red); | 180 | painter->setBrush(darkRed); |
176 | painter->setBrush(darkRed); | 181 | pen=white; |
177 | pen=white; | ||
178 | } else { | 182 | } else { |
179 | painter->setPen(darkGray); | ||
180 | painter->setBrush(darkGray); | 183 | painter->setBrush(darkGray); |
@@ -183,5 +186,12 @@ KDateTable::paintCell(QPainter *painter, int row, int col) | |||
183 | } else { | 186 | } else { |
184 | painter->setBrush(QColor(220,245,255)); | 187 | if(mMarkCurrent && firstday+QDate::currentDate().day()-1==pos) |
185 | painter->setPen(QColor(220,245,255)); | 188 | { |
186 | } | 189 | painter->setPen(green); |
190 | painter->setBrush(darkGreen); | ||
191 | pen=white; | ||
192 | } else { | ||
193 | painter->setBrush(QColor(220,245,255)); | ||
194 | painter->setPen(QColor(220,245,255)); | ||
195 | } | ||
196 | } | ||
187 | painter->drawRect(0, 0, w, h); | 197 | painter->drawRect(0, 0, w, h); |
@@ -359,2 +369,3 @@ KDateTable::setDate(const QDate& date_) | |||
359 | QDate temp; | 369 | QDate temp; |
370 | mMarkCurrent = false; | ||
360 | // ----- | 371 | // ----- |
@@ -370,2 +381,3 @@ KDateTable::setDate(const QDate& date_) | |||
370 | } | 381 | } |
382 | mMarkCurrent = ( date.month() == QDate::currentDate().month() && date.year() == QDate::currentDate().year() ); | ||
371 | temp.setYMD(date.year(), date.month(), 1); | 383 | temp.setYMD(date.year(), date.month(), 1); |
diff --git a/microkde/kdatetbl.h b/microkde/kdatetbl.h index df7b7ef..b4d3e16 100644 --- a/microkde/kdatetbl.h +++ b/microkde/kdatetbl.h | |||
@@ -247,2 +247,3 @@ public: | |||
247 | protected: | 247 | protected: |
248 | bool mMarkCurrent; | ||
248 | /** | 249 | /** |