summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagendaview.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index db66413..8448a4c 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -683,97 +683,97 @@ void KOAgendaView::createDayLabels()
683 --fontPoint; 683 --fontPoint;
684 dlf.setPointSize( fontPoint ); 684 dlf.setPointSize( fontPoint );
685 QFontMetrics f( dlf ); 685 QFontMetrics f( dlf );
686 wid = f.width( "30" ); 686 wid = f.width( "30" );
687 needWid = wid * selCount; 687 needWid = wid * selCount;
688 if ( needWid < maxWid ) 688 if ( needWid < maxWid )
689 break; 689 break;
690 } 690 }
691 maxLen = 2; 691 maxLen = 2;
692 } 692 }
693 //qDebug("Max len %d ", dayTest.length() ); 693 //qDebug("Max len %d ", dayTest.length() );
694 694
695 QFontMetrics tempF( dlf ); 695 QFontMetrics tempF( dlf );
696 newHight = tempF.height(); 696 newHight = tempF.height();
697 mDayLabels->setFont( dlf ); 697 mDayLabels->setFont( dlf );
698 // mLayoutDayLabels = new QHBoxLayout(mDayLabels);; 698 // mLayoutDayLabels = new QHBoxLayout(mDayLabels);;
699 // mLayoutDayLabels->addSpacing(mTimeLabels->width()); 699 // mLayoutDayLabels->addSpacing(mTimeLabels->width());
700 //mLayoutDayLabels->addSpacing( 2 ); 700 //mLayoutDayLabels->addSpacing( 2 );
701 // QFont lFont = dlf; 701 // QFont lFont = dlf;
702 bool appendLabels = false; 702 bool appendLabels = false;
703 KOAgendaButton *dayLabel; 703 KOAgendaButton *dayLabel;
704 dayLabel = mDayLabelsList.first(); 704 dayLabel = mDayLabelsList.first();
705 if ( !dayLabel ) { 705 if ( !dayLabel ) {
706 appendLabels = true; 706 appendLabels = true;
707 dayLabel = getNewDaylabel(); 707 dayLabel = getNewDaylabel();
708 } 708 }
709 dayLabel->setFixedWidth( mTimeLabels->width()+2 ); 709 dayLabel->setFixedWidth( mTimeLabels->width()+2 );
710 dayLabel->setFont( dlf ); 710 dayLabel->setFont( dlf );
711 dayLabel->setNum( -1 ); 711 dayLabel->setNum( -1 );
712 //dayLabel->setAlignment(QLabel::AlignHCenter); 712 //dayLabel->setAlignment(QLabel::AlignHCenter);
713 dayLabel->setText( KOGlobals::self()->calendarSystem()->monthName( mSelectedDates.first(), true ) ); 713 dayLabel->setText( KOGlobals::self()->calendarSystem()->monthName( mSelectedDates.first(), true ) );
714 dayLabel->show(); 714 dayLabel->show();
715 DateList::ConstIterator dit; 715 DateList::ConstIterator dit;
716 bool oneday = (mSelectedDates.first() == mSelectedDates.last() ); 716 bool oneday = (mSelectedDates.first() == mSelectedDates.last() );
717 int counter = -1; 717 int counter = -1;
718 for( dit = mSelectedDates.begin(); dit != mSelectedDates.end(); ++dit ) { 718 for( dit = mSelectedDates.begin(); dit != mSelectedDates.end(); ++dit ) {
719 ++counter; 719 ++counter;
720 QDate date = *dit; 720 QDate date = *dit;
721 // QBoxLayout *dayLayout = new QVBoxLayout(mLayoutDayLabels); 721 // QBoxLayout *dayLayout = new QVBoxLayout(mLayoutDayLabels);
722 if ( ! appendLabels ) { 722 if ( ! appendLabels ) {
723 dayLabel = mDayLabelsList.next(); 723 dayLabel = mDayLabelsList.next();
724 if ( !dayLabel ) 724 if ( !dayLabel )
725 appendLabels = true; 725 appendLabels = true;
726 } 726 }
727 if ( appendLabels ) { 727 if ( appendLabels ) {
728 dayLabel = getNewDaylabel(); 728 dayLabel = getNewDaylabel();
729 } 729 }
730 dayLabel->setMinimumWidth( 1 ); 730 dayLabel->setMinimumWidth( 1 );
731 dayLabel->setMaximumWidth( 1024 ); 731 dayLabel->setMaximumWidth( 10240 );
732 dayLabel->setFont( dlf ); 732 dayLabel->setFont( dlf );
733 dayLabel->show(); 733 dayLabel->show();
734 dayLabel->setNum( counter ); 734 dayLabel->setNum( counter );
735 QString str; 735 QString str;
736 int dW = KOGlobals::self()->calendarSystem()->dayOfWeek(date); 736 int dW = KOGlobals::self()->calendarSystem()->dayOfWeek(date);
737 QString dayName = KOGlobals::self()->calendarSystem()->weekDayName( dW, true ); 737 QString dayName = KOGlobals::self()->calendarSystem()->weekDayName( dW, true );
738 switch ( maxLen ) { 738 switch ( maxLen ) {
739 case 2: 739 case 2:
740 str = QString::number( date.day() ); 740 str = QString::number( date.day() );
741 break; 741 break;
742 742
743 case 3: 743 case 3:
744 str = dayName.left( 1 ) +QString::number( date.day()); 744 str = dayName.left( 1 ) +QString::number( date.day());
745 745
746 break; 746 break;
747 case 4: 747 case 4:
748 str = dayName.left( 1 ) + " " +QString::number( date.day()); 748 str = dayName.left( 1 ) + " " +QString::number( date.day());
749 749
750 break; 750 break;
751 case 5: 751 case 5:
752 str = dayName.left( 2 ) + " " +QString::number( date.day()); 752 str = dayName.left( 2 ) + " " +QString::number( date.day());
753 753
754 break; 754 break;
755 case 6: 755 case 6:
756 str = dayName.left( 3 ) + " " +QString::number( date.day()); 756 str = dayName.left( 3 ) + " " +QString::number( date.day());
757 break; 757 break;
758 758
759 default: 759 default:
760 break; 760 break;
761 } 761 }
762 if ( oneday ) { 762 if ( oneday ) {
763 QString addString; 763 QString addString;
764 if ( mSelectedDates.first() == QDateTime::currentDateTime().date() ) 764 if ( mSelectedDates.first() == QDateTime::currentDateTime().date() )
765 addString = i18n("Today"); 765 addString = i18n("Today");
766 else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(1) ) 766 else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(1) )
767 addString = i18n("Tomorrow"); 767 addString = i18n("Tomorrow");
768 else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(-1) ) 768 else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(-1) )
769 addString = i18n("Yesterday"); 769 addString = i18n("Yesterday");
770 else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(-2) ) 770 else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(-2) )
771 addString = i18n("Day before yesterday"); 771 addString = i18n("Day before yesterday");
772 else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(2) ) 772 else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(2) )
773 addString = i18n("Day after tomorrow"); 773 addString = i18n("Day after tomorrow");
774 if ( !addString.isEmpty() ) { 774 if ( !addString.isEmpty() ) {
775 str = addString+", " + str; 775 str = addString+", " + str;
776 } 776 }
777 } 777 }
778 dayLabel->setText(str); 778 dayLabel->setText(str);
779 //dayLabel->setAlignment(QLabel::AlignHCenter); 779 //dayLabel->setAlignment(QLabel::AlignHCenter);