-rw-r--r-- | korganizer/komonthview.cpp | 40 |
1 files changed, 35 insertions, 5 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 @@ #define PIXMAP_SIZE 5 - +#ifdef DESKTOP_VERSION + QToolTipGroup *MonthViewCell::mToolTipGroup = 0; +#endif class KNOWhatsThis :public QWhatsThis @@ -86,3 +88,3 @@ QString KNoScrollListBox::getWhatsThisText(QPoint p) if ( ! item ) { - return i18n("Click in the cell or\non the date label\nto add an event!"); + return i18n("Click in the cell\nto add an event!"); } @@ -297,3 +299,10 @@ MonthViewCell::MonthViewCell( KOMonthView *parent) } - +#ifdef DESKTOP_VERSION +QToolTipGroup *MonthViewCell::toolTipGroup() +{ + if (!mToolTipGroup) mToolTipGroup = new QToolTipGroup(0); + return mToolTipGroup; +} +#endif + void MonthViewCell::setDate( const QDate &date ) @@ -394,2 +403,6 @@ void MonthViewCell::updateCell() mItemList->clear(); +#ifdef DESKTOP_VERSION + QToolTip::remove(this); +#endif + QString tipText(""); //qApp->processEvents(); @@ -399,2 +412,3 @@ void MonthViewCell::updateCell() mItemList->insertItem( item ); + tipText += mHolidayString+"\n"; } @@ -430,5 +444,8 @@ void MonthViewCell::updateCell() text = prefix + event->summary(); + tipText += text; } else { - if (event->doesFloat()) + if (event->doesFloat()) { text = event->summary(); + tipText += text; + } else { @@ -436,2 +453,3 @@ void MonthViewCell::updateCell() text += " " + event->summary(); + tipText += KGlobal::locale()->formatTime(event->dtStart().time()) +"-"+KGlobal::locale()->formatTime(event->dtEnd().time())+" " + event->summary(); } @@ -485,4 +503,7 @@ void MonthViewCell::updateCell() } - if ( insert ) + if ( insert ) { mItemList->insertItem( item ); + tipText += "\n"; + } else + tipText = ""; } @@ -529,3 +550,9 @@ void MonthViewCell::updateCell() mItemList->insertItem( item ); + tipText += text+"\n"; } +#ifdef DESKTOP_VERSION + if (tipText != "") + QToolTip::add(this,tipText,toolTipGroup(),""); +#endif + //setMyPalette(); @@ -816,2 +843,5 @@ void KOMonthView::updateConfig() } +#ifdef DESKTOP_VERSION + MonthViewCell::toolTipGroup()->setEnabled(KOPrefs::instance()->mEnableToolTips); +#endif } |