-rw-r--r-- | korganizer/koagendaview.cpp | 1 | ||||
-rw-r--r-- | korganizer/kodaymatrix.cpp | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index d43712f..aa36553 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp | |||
@@ -791,64 +791,65 @@ void KOAgendaView::createDayLabels() | |||
791 | dayLayout->addWidget(label); | 791 | dayLayout->addWidget(label); |
792 | } | 792 | } |
793 | } | 793 | } |
794 | 794 | ||
795 | for(it = cds.first(); it; it = cds.next()) { | 795 | for(it = cds.first(); it; it = cds.next()) { |
796 | QWidget *wid = it->smallWidget(mDayLabels,date); | 796 | QWidget *wid = it->smallWidget(mDayLabels,date); |
797 | if ( wid ) { | 797 | if ( wid ) { |
798 | // wid->setHeight(20); | 798 | // wid->setHeight(20); |
799 | dayLayout->addWidget(wid); | 799 | dayLayout->addWidget(wid); |
800 | } | 800 | } |
801 | } | 801 | } |
802 | #endif | 802 | #endif |
803 | } | 803 | } |
804 | if ( ! appendLabels ) { | 804 | if ( ! appendLabels ) { |
805 | dayLabel = mDayLabelsList.next(); | 805 | dayLabel = mDayLabelsList.next(); |
806 | if ( !dayLabel ) | 806 | if ( !dayLabel ) |
807 | appendLabels = true; | 807 | appendLabels = true; |
808 | } | 808 | } |
809 | if ( appendLabels ) { | 809 | if ( appendLabels ) { |
810 | dayLabel = new QPushButton(mDayLabels); | 810 | dayLabel = new QPushButton(mDayLabels); |
811 | dayLabel->setFlat( true ); | 811 | dayLabel->setFlat( true ); |
812 | connect( dayLabel, SIGNAL( clicked() ), this, SLOT ( slotDaylabelClicked() ) ); | 812 | connect( dayLabel, SIGNAL( clicked() ), this, SLOT ( slotDaylabelClicked() ) ); |
813 | dayLabel->setFocusPolicy(NoFocus); | 813 | dayLabel->setFocusPolicy(NoFocus); |
814 | mDayLabelsList.append( dayLabel ); | 814 | mDayLabelsList.append( dayLabel ); |
815 | mLayoutDayLabels->addWidget(dayLabel); | 815 | mLayoutDayLabels->addWidget(dayLabel); |
816 | } | 816 | } |
817 | //dayLabel->hide();//test only | 817 | //dayLabel->hide();//test only |
818 | 818 | ||
819 | int offset = (mAgenda->width() - mAgenda->verticalScrollBar()->width()-3 ) % mSelectedDates.count() ; | 819 | int offset = (mAgenda->width() - mAgenda->verticalScrollBar()->width()-3 ) % mSelectedDates.count() ; |
820 | if ( offset < 0 ) offset = 0; | 820 | if ( offset < 0 ) offset = 0; |
821 | //qDebug("mLayoutDayLabels->addSpacing %d ", mAgenda->verticalScrollBar()->width()+offset+2 ); | 821 | //qDebug("mLayoutDayLabels->addSpacing %d ", mAgenda->verticalScrollBar()->width()+offset+2 ); |
822 | dayLabel->setText(">");//QString::number ( mSelectedDates.first().month() ) ); | 822 | dayLabel->setText(">");//QString::number ( mSelectedDates.first().month() ) ); |
823 | dayLabel->setFont( dlf ); | ||
823 | dayLabel->show(); | 824 | dayLabel->show(); |
824 | dayLabel->setCaption("last"); | 825 | dayLabel->setCaption("last"); |
825 | dayLabel->setFixedWidth( mAgenda->verticalScrollBar()->width()+ offset ); | 826 | dayLabel->setFixedWidth( mAgenda->verticalScrollBar()->width()+ offset ); |
826 | //qDebug("setToFixed %d ", mAgenda->verticalScrollBar()->width()+ offset+2); | 827 | //qDebug("setToFixed %d ", mAgenda->verticalScrollBar()->width()+ offset+2); |
827 | //mLayoutDayLabels->addSpacing(mAgenda->verticalScrollBar()->width()+ offset+2); | 828 | //mLayoutDayLabels->addSpacing(mAgenda->verticalScrollBar()->width()+ offset+2); |
828 | if ( !appendLabels ) { | 829 | if ( !appendLabels ) { |
829 | dayLabel = mDayLabelsList.next(); | 830 | dayLabel = mDayLabelsList.next(); |
830 | while ( dayLabel ) { | 831 | while ( dayLabel ) { |
831 | //qDebug("!dayLabel %d",dayLabel ); | 832 | //qDebug("!dayLabel %d",dayLabel ); |
832 | dayLabel->hide(); | 833 | dayLabel->hide(); |
833 | dayLabel = mDayLabelsList.next(); | 834 | dayLabel = mDayLabelsList.next(); |
834 | } | 835 | } |
835 | } | 836 | } |
836 | //mDayLabelsFrame->show(); | 837 | //mDayLabelsFrame->show(); |
837 | //mDayLabels->show(); | 838 | //mDayLabels->show(); |
838 | //qDebug("heigt %d %d %d ",mDayLabelsFrame->height(), mDayLabelsFrame->sizeHint().height(), newHight); | 839 | //qDebug("heigt %d %d %d ",mDayLabelsFrame->height(), mDayLabelsFrame->sizeHint().height(), newHight); |
839 | //mDayLabelsFrame->resize( mAgenda->visibleWidth(), newHight ); | 840 | //mDayLabelsFrame->resize( mAgenda->visibleWidth(), newHight ); |
840 | mDayLabelsFrame->setFixedHeight( newHight ); | 841 | mDayLabelsFrame->setFixedHeight( newHight ); |
841 | } | 842 | } |
842 | 843 | ||
843 | int KOAgendaView::maxDatesHint() | 844 | int KOAgendaView::maxDatesHint() |
844 | { | 845 | { |
845 | // Not sure about the max number of events, so return 0 for now. | 846 | // Not sure about the max number of events, so return 0 for now. |
846 | return 0; | 847 | return 0; |
847 | } | 848 | } |
848 | 849 | ||
849 | int KOAgendaView::currentDateCount() | 850 | int KOAgendaView::currentDateCount() |
850 | { | 851 | { |
851 | return mSelectedDates.count(); | 852 | return mSelectedDates.count(); |
852 | } | 853 | } |
853 | 854 | ||
854 | QPtrList<Incidence> KOAgendaView::selectedIncidences() | 855 | QPtrList<Incidence> KOAgendaView::selectedIncidences() |
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp index 549ef2a..dd83d48 100644 --- a/korganizer/kodaymatrix.cpp +++ b/korganizer/kodaymatrix.cpp | |||
@@ -461,64 +461,65 @@ void KODayMatrix::dropEvent(QDropEvent *e) | |||
461 | 461 | ||
462 | start.setDate(days[idx]); | 462 | start.setDate(days[idx]); |
463 | end.setDate(days[idx].addDays(duration)); | 463 | end.setDate(days[idx].addDays(duration)); |
464 | 464 | ||
465 | event->setDtStart(start); | 465 | event->setDtStart(start); |
466 | event->setDtEnd(end); | 466 | event->setDtEnd(end); |
467 | mCalendar->addEvent(event); | 467 | mCalendar->addEvent(event); |
468 | 468 | ||
469 | emit eventDropped(event); | 469 | emit eventDropped(event); |
470 | } else { | 470 | } else { |
471 | // kdDebug() << "KODayMatrix::dropEvent(): Event from drop not decodable" << endl; | 471 | // kdDebug() << "KODayMatrix::dropEvent(): Event from drop not decodable" << endl; |
472 | e->ignore(); | 472 | e->ignore(); |
473 | } | 473 | } |
474 | #endif | 474 | #endif |
475 | } | 475 | } |
476 | 476 | ||
477 | // ---------------------------------------------------------------------------- | 477 | // ---------------------------------------------------------------------------- |
478 | // P A I N T E V E N T H A N D L I N G | 478 | // P A I N T E V E N T H A N D L I N G |
479 | // ---------------------------------------------------------------------------- | 479 | // ---------------------------------------------------------------------------- |
480 | 480 | ||
481 | void KODayMatrix::paintEvent(QPaintEvent * pevent) | 481 | void KODayMatrix::paintEvent(QPaintEvent * pevent) |
482 | { | 482 | { |
483 | if ( width() <= 0 || height() <= 0 ) | 483 | if ( width() <= 0 || height() <= 0 ) |
484 | return; | 484 | return; |
485 | if ( mPendingUpdateBeforeRepaint ) { | 485 | if ( mPendingUpdateBeforeRepaint ) { |
486 | updateViewTimed(); | 486 | updateViewTimed(); |
487 | mPendingUpdateBeforeRepaint = false; | 487 | mPendingUpdateBeforeRepaint = false; |
488 | } | 488 | } |
489 | if ( myPix.width() != width() || myPix.height()!=height() ) { | 489 | if ( myPix.width() != width() || myPix.height()!=height() ) { |
490 | myPix.resize(size() ); | 490 | myPix.resize(size() ); |
491 | } | 491 | } |
492 | QPainter p(&myPix); | 492 | QPainter p(&myPix); |
493 | p.setFont(font()); | ||
493 | 494 | ||
494 | QRect sz = frameRect(); | 495 | QRect sz = frameRect(); |
495 | int dheight = daysize.height(); | 496 | int dheight = daysize.height(); |
496 | int dwidth = daysize.width(); | 497 | int dwidth = daysize.width(); |
497 | int row,col; | 498 | int row,col; |
498 | int selw, selh; | 499 | int selw, selh; |
499 | bool isRTL = KOGlobals::self()->reverseLayout(); | 500 | bool isRTL = KOGlobals::self()->reverseLayout(); |
500 | 501 | ||
501 | // draw background and topleft frame | 502 | // draw background and topleft frame |
502 | p.fillRect(pevent->rect(), mDefaultBackColor); | 503 | p.fillRect(pevent->rect(), mDefaultBackColor); |
503 | p.setPen(mDefaultTextColor); | 504 | p.setPen(mDefaultTextColor); |
504 | p.drawRect(0, 0, sz.width()+1, sz.height()+1); | 505 | p.drawRect(0, 0, sz.width()+1, sz.height()+1); |
505 | 506 | ||
506 | // draw selected days with highlighted background color | 507 | // draw selected days with highlighted background color |
507 | if (mSelStart != NOSELECTION) { | 508 | if (mSelStart != NOSELECTION) { |
508 | 509 | ||
509 | row = mSelStart/7; | 510 | row = mSelStart/7; |
510 | col = mSelStart -row*7; | 511 | col = mSelStart -row*7; |
511 | QColor selcol = KOPrefs::instance()->mHighlightColor; | 512 | QColor selcol = KOPrefs::instance()->mHighlightColor; |
512 | 513 | ||
513 | if (row == mSelEnd/7) { | 514 | if (row == mSelEnd/7) { |
514 | // Single row selection | 515 | // Single row selection |
515 | p.fillRect(isRTL ? (7 - (mSelEnd-mSelStart+1) - col)*dwidth : col*dwidth, | 516 | p.fillRect(isRTL ? (7 - (mSelEnd-mSelStart+1) - col)*dwidth : col*dwidth, |
516 | row*dheight, (mSelEnd-mSelStart+1)*dwidth, dheight, selcol); | 517 | row*dheight, (mSelEnd-mSelStart+1)*dwidth, dheight, selcol); |
517 | } else { | 518 | } else { |
518 | // draw first row to the right | 519 | // draw first row to the right |
519 | p.fillRect(isRTL ? 0 : col*dwidth, row*dheight, (7-col)*dwidth, | 520 | p.fillRect(isRTL ? 0 : col*dwidth, row*dheight, (7-col)*dwidth, |
520 | dheight, selcol); | 521 | dheight, selcol); |
521 | // draw full block till last line | 522 | // draw full block till last line |
522 | selh = mSelEnd/7-row; | 523 | selh = mSelEnd/7-row; |
523 | if (selh > 1) { | 524 | if (selh > 1) { |
524 | p.fillRect(0, (row+1)*dheight, 7*dwidth, (selh-1)*dheight,selcol); | 525 | p.fillRect(0, (row+1)*dheight, 7*dwidth, (selh-1)*dheight,selcol); |