author | zautrix <zautrix> | 2005-01-11 15:48:26 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-01-11 15:48:26 (UTC) |
commit | ff808c2b4cd2751e7f99dd7cb5c1e44886ac151f (patch) (unidiff) | |
tree | 7cd2fdcfea35ca54b94aff1b113c92482a904fae /korganizer | |
parent | 7738615474fd5186928e3f4dcdc58b483f7ad1a9 (diff) | |
download | kdepimpi-ff808c2b4cd2751e7f99dd7cb5c1e44886ac151f.zip kdepimpi-ff808c2b4cd2751e7f99dd7cb5c1e44886ac151f.tar.gz kdepimpi-ff808c2b4cd2751e7f99dd7cb5c1e44886ac151f.tar.bz2 |
tooltips added
-rw-r--r-- | korganizer/komonthview.cpp | 40 | ||||
-rw-r--r-- | korganizer/komonthview.h | 11 |
2 files changed, 45 insertions, 6 deletions
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 08232e2..9344567 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp | |||
@@ -56,3 +56,5 @@ | |||
56 | #define PIXMAP_SIZE 5 | 56 | #define PIXMAP_SIZE 5 |
57 | 57 | #ifdef DESKTOP_VERSION | |
58 | QToolTipGroup *MonthViewCell::mToolTipGroup = 0; | ||
59 | #endif | ||
58 | class KNOWhatsThis :public QWhatsThis | 60 | class KNOWhatsThis :public QWhatsThis |
@@ -86,3 +88,3 @@ QString KNoScrollListBox::getWhatsThisText(QPoint p) | |||
86 | if ( ! item ) { | 88 | if ( ! item ) { |
87 | return i18n("Click in the cell or\non the date label\nto add an event!"); | 89 | return i18n("Click in the cell\nto add an event!"); |
88 | } | 90 | } |
@@ -297,3 +299,10 @@ MonthViewCell::MonthViewCell( KOMonthView *parent) | |||
297 | } | 299 | } |
298 | 300 | #ifdef DESKTOP_VERSION | |
301 | QToolTipGroup *MonthViewCell::toolTipGroup() | ||
302 | { | ||
303 | if (!mToolTipGroup) mToolTipGroup = new QToolTipGroup(0); | ||
304 | return mToolTipGroup; | ||
305 | } | ||
306 | #endif | ||
307 | |||
299 | void MonthViewCell::setDate( const QDate &date ) | 308 | void MonthViewCell::setDate( const QDate &date ) |
@@ -394,2 +403,6 @@ void MonthViewCell::updateCell() | |||
394 | mItemList->clear(); | 403 | mItemList->clear(); |
404 | #ifdef DESKTOP_VERSION | ||
405 | QToolTip::remove(this); | ||
406 | #endif | ||
407 | QString tipText(""); | ||
395 | //qApp->processEvents(); | 408 | //qApp->processEvents(); |
@@ -399,2 +412,3 @@ void MonthViewCell::updateCell() | |||
399 | mItemList->insertItem( item ); | 412 | mItemList->insertItem( item ); |
413 | tipText += mHolidayString+"\n"; | ||
400 | } | 414 | } |
@@ -430,5 +444,8 @@ void MonthViewCell::updateCell() | |||
430 | text = prefix + event->summary(); | 444 | text = prefix + event->summary(); |
445 | tipText += text; | ||
431 | } else { | 446 | } else { |
432 | if (event->doesFloat()) | 447 | if (event->doesFloat()) { |
433 | text = event->summary(); | 448 | text = event->summary(); |
449 | tipText += text; | ||
450 | } | ||
434 | else { | 451 | else { |
@@ -436,2 +453,3 @@ void MonthViewCell::updateCell() | |||
436 | text += " " + event->summary(); | 453 | text += " " + event->summary(); |
454 | tipText += KGlobal::locale()->formatTime(event->dtStart().time()) +"-"+KGlobal::locale()->formatTime(event->dtEnd().time())+" " + event->summary(); | ||
437 | } | 455 | } |
@@ -485,4 +503,7 @@ void MonthViewCell::updateCell() | |||
485 | } | 503 | } |
486 | if ( insert ) | 504 | if ( insert ) { |
487 | mItemList->insertItem( item ); | 505 | mItemList->insertItem( item ); |
506 | tipText += "\n"; | ||
507 | } else | ||
508 | tipText = ""; | ||
488 | } | 509 | } |
@@ -529,3 +550,9 @@ void MonthViewCell::updateCell() | |||
529 | mItemList->insertItem( item ); | 550 | mItemList->insertItem( item ); |
551 | tipText += text+"\n"; | ||
530 | } | 552 | } |
553 | #ifdef DESKTOP_VERSION | ||
554 | if (tipText != "") | ||
555 | QToolTip::add(this,tipText,toolTipGroup(),""); | ||
556 | #endif | ||
557 | |||
531 | //setMyPalette(); | 558 | //setMyPalette(); |
@@ -816,2 +843,5 @@ void KOMonthView::updateConfig() | |||
816 | } | 843 | } |
844 | #ifdef DESKTOP_VERSION | ||
845 | MonthViewCell::toolTipGroup()->setEnabled(KOPrefs::instance()->mEnableToolTips); | ||
846 | #endif | ||
817 | } | 847 | } |
diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h index 5124057..4c1567c 100644 --- a/korganizer/komonthview.h +++ b/korganizer/komonthview.h | |||
@@ -38,2 +38,6 @@ | |||
38 | 38 | ||
39 | #ifdef DESKTOP_VERSION | ||
40 | class QToolTipGroup; | ||
41 | #endif | ||
42 | |||
39 | class KOWeekButton : public QPushButton | 43 | class KOWeekButton : public QPushButton |
@@ -142,2 +146,5 @@ class MonthViewCell : public QWidget | |||
142 | 146 | ||
147 | #ifdef DESKTOP_VERSION | ||
148 | static QToolTipGroup *toolTipGroup(); | ||
149 | #endif | ||
143 | signals: | 150 | signals: |
@@ -169,3 +176,5 @@ class MonthViewCell : public QWidget | |||
169 | QListBox *mItemList; | 176 | QListBox *mItemList; |
170 | 177 | #ifdef DESKTOP_VERSION | |
178 | static QToolTipGroup *mToolTipGroup; | ||
179 | #endif | ||
171 | QSize mLabelSize; | 180 | QSize mLabelSize; |