author | zautrix <zautrix> | 2005-04-08 10:54:05 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-04-08 10:54:05 (UTC) |
commit | 59fb8a0ac35bf3b81f1c4e2e4fc6b61356d064ef (patch) (side-by-side diff) | |
tree | ab604082029c081fa8725c5535a51a23bb963ef2 /korganizer | |
parent | c82f9b40f6023dc7b39ac555cba8c4c313f15ca8 (diff) | |
download | kdepimpi-59fb8a0ac35bf3b81f1c4e2e4fc6b61356d064ef.zip kdepimpi-59fb8a0ac35bf3b81f1c4e2e4fc6b61356d064ef.tar.gz kdepimpi-59fb8a0ac35bf3b81f1c4e2e4fc6b61356d064ef.tar.bz2 |
fixes
-rw-r--r-- | korganizer/koagendaitem.cpp | 28 | ||||
-rw-r--r-- | korganizer/komonthview.cpp | 21 |
2 files changed, 35 insertions, 14 deletions
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp index 23afe7a..e545ca8 100644 --- a/korganizer/koagendaitem.cpp +++ b/korganizer/koagendaitem.cpp @@ -434,40 +434,49 @@ void KOAgendaItem::paintMe( bool selected, QPainter* paint ) pa.end(); } void KOAgendaItem::resizePixmap( int w , int h ) { paintPix()->resize( w, h ); paintPixSel()->resize( w, h ); } QPixmap * KOAgendaItem::paintPix() { static QPixmap* mPaintPix = 0; - if ( ! mPaintPix ) - mPaintPix = new QPixmap(1,1); + if ( ! mPaintPix ) { + int w = QApplication::desktop()->width(); + int h = QApplication::desktop()->height(); + mPaintPix = new QPixmap(w,h); + } return mPaintPix ; } QPixmap * KOAgendaItem::paintPixAllday() { static QPixmap* mPaintPixA = 0; - if ( ! mPaintPixA ) - mPaintPixA = new QPixmap(1,1); + if ( ! mPaintPixA ) { + int w = QApplication::desktop()->width(); + int h = QApplication::desktop()->height()/3; + mPaintPixA = new QPixmap(w,h); + } return mPaintPixA ; } QPixmap * KOAgendaItem::paintPixSel() { static QPixmap* mPaintPixSel = 0; - if ( ! mPaintPixSel ) - mPaintPixSel = new QPixmap(1,1); + if ( ! mPaintPixSel ) { + int w = QApplication::desktop()->width(); + int h = QApplication::desktop()->height(); + mPaintPixSel = new QPixmap(w,h); + } return mPaintPixSel ; } void KOAgendaItem::paintEvent ( QPaintEvent *e ) { if ( globalFlagBlockAgendaItemPaint ) return; if ( globalFlagBlockAgenda > 0 && globalFlagBlockAgenda < 5 ) return; int yy; if ( mAllDay ) yy = y(); @@ -516,53 +525,52 @@ void KOAgendaItem::paintEvent ( QPaintEvent *e ) if ( paintFrom->width() < xx+rw ) { rw = paintFrom->width() - xx; if ( rw <= 1 ) { //qDebug("KOAgendaItem::Width2 <= 1 (%d). Returning.%s ",rw,mDisplayedText.latin1() ); return; } } //qDebug("%d %d %d %d %d %d %d",rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh); bitBlt (this, rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh ,CopyROP); } void KOAgendaItem::computeText() { - mDisplayedText = mIncidence->summary(); if ( (mIncidence->type() == "Todo") ) { if ( static_cast<Todo*>(mIncidence)->hasDueDate() ) { if ( static_cast<Todo*>(mIncidence)->dtDue().date() < QDate::currentDate() ) mDisplayedText += i18n(" (") +KGlobal::locale()->formatDate((static_cast<Todo*>(mIncidence))->dtDue().date(), true)+")"; else if ( !(mIncidence->doesFloat())) mDisplayedText += i18n(" (") +KGlobal::locale()->formatTime((static_cast<Todo*>(mIncidence))->dtDue().time())+")"; } } else { if ( !(mIncidence->doesFloat()) && KOPrefs::instance()->mShowTimeInAgenda) - mDisplayedText += ": " +KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtStart().time()) + "-" + KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtEnd().time()) ; + mDisplayedText += ": " +KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtStart().time()) + " - " + KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtEnd().time()) ; if ( mAllDay ) { if ( mIncidence->dtStart().date().addDays(3) < mIncidence->dtEnd().date() ) { mDisplayedText += ": " +KGlobal::locale()->formatDate((static_cast<Event*>(mIncidence))->dtStart().date(), true) + " - " + KGlobal::locale()->formatDate((static_cast<Event*>(mIncidence))->dtEnd().date(), true) ; } } } if ( !mIncidence->location().isEmpty() ) { if ( mAllDay ) mDisplayedText += " ("; else mDisplayedText += "\n("; mDisplayedText += mIncidence->location() +")"; } - +#ifdef DESKTOP_VERSION QString tipText = mIncidence->summary(); if ( !mIncidence->doesFloat() ) { if ( mIncidence->type() == "Event" ) { if ( (static_cast<Event*>(mIncidence))->isMultiDay() ) { tipText += "\n"+i18n("From: ")+mIncidence->dtStartStr(); tipText += "\n"+i18n("To: ")+(static_cast<Event*>(mIncidence))->dtEndStr(); } else { tipText += "\n"+i18n("Time: ")+mIncidence->dtStartTimeStr(); tipText += " - "+(static_cast<Event*>(mIncidence))->dtEndTimeStr(); } } @@ -574,25 +582,25 @@ void KOAgendaItem::computeText() } } else if ( mIncidence->type() == "Todo" ) { if (mIncidence->hasStartDate()) tipText += "\n"+i18n("Start: ")+ (static_cast<Todo*>(mIncidence))->dtStartDateStr(); if (((Todo*)mIncidence)->hasDueDate()) tipText += "\n"+i18n("Due: ")+ (static_cast<Todo*>(mIncidence))->dtDueDateStr(); } if (!mIncidence->location().isEmpty()) { tipText += "\n"+i18n("Location: ")+mIncidence->location(); } QToolTip::add(this,tipText,toolTipGroup(),""); - +#endif } void KOAgendaItem::updateItem() { computeText(); //qDebug("KOAgendaItem:: updateItem() %s %d %d ",incidence()->summary().latin1(), x(), y()); paintMe( mSelected ); repaint( false); } void KOAgendaItem::resizeEvent ( QResizeEvent *ev ) { diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 4dfb9df..65d6acf 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp @@ -632,24 +632,28 @@ void MonthViewCell::startUpdateCell() #if 0 if ( !mHolidayString.isEmpty() ) { MonthViewItem *item = new MonthViewItem( 0, mDate, mHolidayString ); item->setPalette( mHolidayPalette ); insertItem( item ); mToolTip.append ( mHolidayString ); } #endif } int MonthViewCell::insertEvent(Event *event) { + bool useToolTips = true; +#ifndef DEKSTOP_VERSION + useToolTips = false; +#endif QString mToolTipText; setFocusPolicy(WheelFocus); if ( !(event->doesRecur() == Recurrence::rNone) ) { if ( !KOPrefs::instance()->mMonthDailyRecur && event->doesRecur() == Recurrence::rDaily ) return mdayCount; else if ( !KOPrefs::instance()->mMonthWeeklyRecur && event->doesRecur() == Recurrence::rWeekly ) return mdayCount; } if ( event->isHoliday()) { setHoliday( true ); @@ -678,36 +682,42 @@ int MonthViewCell::insertEvent(Event *event) } else if (mDate == event->dtEnd().date()) { prefix ="<-" ;multiday = 3; } } if ( !event->doesFloat() ) { if ( mDate == event->dtStart().date () ) time = KGlobal::locale()->formatTime(event->dtStart().time())+" "; else if ( mDate == event->dtEnd().date () ) time = KGlobal::locale()->formatTime(event->dtEnd().time())+" "; } text = time + event->summary(); - mToolTipText += prefix + text; + if ( useToolTips ) + mToolTipText += prefix + text; } else { if (event->doesFloat()) { text = event->summary(); - mToolTipText += text; + if ( useToolTips ) + mToolTipText += text; } else { text = KGlobal::locale()->formatTime(event->dtStart().time()); text += " " + event->summary(); - mToolTipText += KGlobal::locale()->formatTime(event->dtStart().time()) +"-"+KGlobal::locale()->formatTime(event->dtEnd().time())+" " + event->summary(); + if ( useToolTips ) + mToolTipText += KGlobal::locale()->formatTime(event->dtStart().time()) +"-"+KGlobal::locale()->formatTime(event->dtEnd().time())+" " + event->summary(); } } + if ( useToolTips && ! event->location().isEmpty() ) { + mToolTipText += " (" + event->location() +")"; + } MonthViewItem *item ; if ( mAvailItemList.count() ) { item = mAvailItemList.first(); mAvailItemList.remove( item ); item->recycle( event, mDate, text ); } else { item = new MonthViewItem( event, mDate, text ); } QPalette pal; if (KOPrefs::instance()->mMonthViewUsesCategoryColor) { @@ -755,25 +765,26 @@ int MonthViewCell::insertEvent(Event *event) uint i; int pos = mdayCount; for ( i = mdayCount; i < count();++i ) { QListBoxItem* it = this->item ( i ); if ( text < it->text() ) { pos = i; break; } ++pos; } insertItem( item ,pos); } - mToolTip.append( mToolTipText ); + if ( useToolTips ) + mToolTip.append( mToolTipText ); return mdayCount; } void MonthViewCell::insertTodo(Todo *todo) { setFocusPolicy(WheelFocus); QString text; if (todo->hasDueDate()) { if (!todo->doesFloat()) { text += KGlobal::locale()->formatTime(todo->dtDue().time()); text += " "; } } @@ -807,25 +818,27 @@ void MonthViewCell::insertTodo(Todo *todo) pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); } } } else { pal = mStandardPalette ; } item->setPalette( pal ); item->setRecur( todo->recurrence()->doesRecur() ); item->setAlarm( todo->isAlarmEnabled() ); item->setMoreInfo( todo->description().length() > 0 ); insertItem( item , count()); +#ifdef DESKTOP_VERSION mToolTip.append( text ); +#endif } void MonthViewCell::repaintfinishUpdateCell() { MonthViewItem *mitem = (MonthViewItem*) firstItem (); while ( mitem ) { mitem->setBlockRepaint( false ); updateItem ( mitem ); mitem = (MonthViewItem *)mitem->next(); } } void MonthViewCell::finishUpdateCell() { |