summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-04-08 10:54:05 (UTC)
committer zautrix <zautrix>2005-04-08 10:54:05 (UTC)
commit59fb8a0ac35bf3b81f1c4e2e4fc6b61356d064ef (patch) (unidiff)
treeab604082029c081fa8725c5535a51a23bb963ef2 /korganizer
parentc82f9b40f6023dc7b39ac555cba8c4c313f15ca8 (diff)
downloadkdepimpi-59fb8a0ac35bf3b81f1c4e2e4fc6b61356d064ef.zip
kdepimpi-59fb8a0ac35bf3b81f1c4e2e4fc6b61356d064ef.tar.gz
kdepimpi-59fb8a0ac35bf3b81f1c4e2e4fc6b61356d064ef.tar.bz2
fixes
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagendaitem.cpp28
-rw-r--r--korganizer/komonthview.cpp21
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
@@ -443,22 +443,31 @@ void KOAgendaItem::resizePixmap( int w , int h )
443QPixmap * KOAgendaItem::paintPix() 443QPixmap * KOAgendaItem::paintPix()
444{ 444{
445 static QPixmap* mPaintPix = 0; 445 static QPixmap* mPaintPix = 0;
446 if ( ! mPaintPix ) 446 if ( ! mPaintPix ) {
447 mPaintPix = new QPixmap(1,1); 447 int w = QApplication::desktop()->width();
448 int h = QApplication::desktop()->height();
449 mPaintPix = new QPixmap(w,h);
450 }
448 return mPaintPix ; 451 return mPaintPix ;
449} 452}
450QPixmap * KOAgendaItem::paintPixAllday() 453QPixmap * KOAgendaItem::paintPixAllday()
451{ 454{
452 static QPixmap* mPaintPixA = 0; 455 static QPixmap* mPaintPixA = 0;
453 if ( ! mPaintPixA ) 456 if ( ! mPaintPixA ) {
454 mPaintPixA = new QPixmap(1,1); 457 int w = QApplication::desktop()->width();
458 int h = QApplication::desktop()->height()/3;
459 mPaintPixA = new QPixmap(w,h);
460 }
455 return mPaintPixA ; 461 return mPaintPixA ;
456} 462}
457QPixmap * KOAgendaItem::paintPixSel() 463QPixmap * KOAgendaItem::paintPixSel()
458{ 464{
459 static QPixmap* mPaintPixSel = 0; 465 static QPixmap* mPaintPixSel = 0;
460 if ( ! mPaintPixSel ) 466 if ( ! mPaintPixSel ) {
461 mPaintPixSel = new QPixmap(1,1); 467 int w = QApplication::desktop()->width();
468 int h = QApplication::desktop()->height();
469 mPaintPixSel = new QPixmap(w,h);
470 }
462 return mPaintPixSel ; 471 return mPaintPixSel ;
463} 472}
464void KOAgendaItem::paintEvent ( QPaintEvent *e ) 473void KOAgendaItem::paintEvent ( QPaintEvent *e )
@@ -525,7 +534,6 @@ void KOAgendaItem::paintEvent ( QPaintEvent *e )
525} 534}
526void KOAgendaItem::computeText() 535void KOAgendaItem::computeText()
527{ 536{
528
529 mDisplayedText = mIncidence->summary(); 537 mDisplayedText = mIncidence->summary();
530 if ( (mIncidence->type() == "Todo") ) { 538 if ( (mIncidence->type() == "Todo") ) {
531 if ( static_cast<Todo*>(mIncidence)->hasDueDate() ) { 539 if ( static_cast<Todo*>(mIncidence)->hasDueDate() ) {
@@ -536,7 +544,7 @@ void KOAgendaItem::computeText()
536 } 544 }
537 } else { 545 } else {
538 if ( !(mIncidence->doesFloat()) && KOPrefs::instance()->mShowTimeInAgenda) 546 if ( !(mIncidence->doesFloat()) && KOPrefs::instance()->mShowTimeInAgenda)
539 mDisplayedText += ": " +KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtStart().time()) + "-" + KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtEnd().time()) ; 547 mDisplayedText += ": " +KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtStart().time()) + " - " + KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtEnd().time()) ;
540 548
541 if ( mAllDay ) { 549 if ( mAllDay ) {
542 if ( mIncidence->dtStart().date().addDays(3) < mIncidence->dtEnd().date() ) { 550 if ( mIncidence->dtStart().date().addDays(3) < mIncidence->dtEnd().date() ) {
@@ -553,7 +561,7 @@ void KOAgendaItem::computeText()
553 mDisplayedText += "\n("; 561 mDisplayedText += "\n(";
554 mDisplayedText += mIncidence->location() +")"; 562 mDisplayedText += mIncidence->location() +")";
555 } 563 }
556 564#ifdef DESKTOP_VERSION
557 QString tipText = mIncidence->summary(); 565 QString tipText = mIncidence->summary();
558 if ( !mIncidence->doesFloat() ) { 566 if ( !mIncidence->doesFloat() ) {
559 if ( mIncidence->type() == "Event" ) { 567 if ( mIncidence->type() == "Event" ) {
@@ -583,7 +591,7 @@ void KOAgendaItem::computeText()
583 tipText += "\n"+i18n("Location: ")+mIncidence->location(); 591 tipText += "\n"+i18n("Location: ")+mIncidence->location();
584 } 592 }
585 QToolTip::add(this,tipText,toolTipGroup(),""); 593 QToolTip::add(this,tipText,toolTipGroup(),"");
586 594#endif
587} 595}
588void KOAgendaItem::updateItem() 596void KOAgendaItem::updateItem()
589{ 597{
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index 4dfb9df..65d6acf 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -641,6 +641,10 @@ void MonthViewCell::startUpdateCell()
641 641
642int MonthViewCell::insertEvent(Event *event) 642int MonthViewCell::insertEvent(Event *event)
643{ 643{
644 bool useToolTips = true;
645#ifndef DEKSTOP_VERSION
646 useToolTips = false;
647#endif
644 QString mToolTipText; 648 QString mToolTipText;
645 setFocusPolicy(WheelFocus); 649 setFocusPolicy(WheelFocus);
646 if ( !(event->doesRecur() == Recurrence::rNone) ) { 650 if ( !(event->doesRecur() == Recurrence::rNone) ) {
@@ -687,18 +691,24 @@ int MonthViewCell::insertEvent(Event *event)
687 691
688 } 692 }
689 text = time + event->summary(); 693 text = time + event->summary();
690 mToolTipText += prefix + text; 694 if ( useToolTips )
695 mToolTipText += prefix + text;
691 } else { 696 } else {
692 if (event->doesFloat()) { 697 if (event->doesFloat()) {
693 text = event->summary(); 698 text = event->summary();
694 mToolTipText += text; 699 if ( useToolTips )
700 mToolTipText += text;
695 } 701 }
696 else { 702 else {
697 text = KGlobal::locale()->formatTime(event->dtStart().time()); 703 text = KGlobal::locale()->formatTime(event->dtStart().time());
698 text += " " + event->summary(); 704 text += " " + event->summary();
699 mToolTipText += KGlobal::locale()->formatTime(event->dtStart().time()) +"-"+KGlobal::locale()->formatTime(event->dtEnd().time())+" " + event->summary(); 705 if ( useToolTips )
706 mToolTipText += KGlobal::locale()->formatTime(event->dtStart().time()) +"-"+KGlobal::locale()->formatTime(event->dtEnd().time())+" " + event->summary();
700 } 707 }
701 } 708 }
709 if ( useToolTips && ! event->location().isEmpty() ) {
710 mToolTipText += " (" + event->location() +")";
711 }
702 MonthViewItem *item ; 712 MonthViewItem *item ;
703 713
704 if ( mAvailItemList.count() ) { 714 if ( mAvailItemList.count() ) {
@@ -764,7 +774,8 @@ int MonthViewCell::insertEvent(Event *event)
764 } 774 }
765 insertItem( item ,pos); 775 insertItem( item ,pos);
766 } 776 }
767 mToolTip.append( mToolTipText ); 777 if ( useToolTips )
778 mToolTip.append( mToolTipText );
768 return mdayCount; 779 return mdayCount;
769} 780}
770void MonthViewCell::insertTodo(Todo *todo) 781void MonthViewCell::insertTodo(Todo *todo)
@@ -816,7 +827,9 @@ void MonthViewCell::insertTodo(Todo *todo)
816 item->setAlarm( todo->isAlarmEnabled() ); 827 item->setAlarm( todo->isAlarmEnabled() );
817 item->setMoreInfo( todo->description().length() > 0 ); 828 item->setMoreInfo( todo->description().length() > 0 );
818 insertItem( item , count()); 829 insertItem( item , count());
830#ifdef DESKTOP_VERSION
819 mToolTip.append( text ); 831 mToolTip.append( text );
832#endif
820} 833}
821void MonthViewCell::repaintfinishUpdateCell() 834void MonthViewCell::repaintfinishUpdateCell()
822{ 835{