author | zautrix <zautrix> | 2005-02-02 19:56:42 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-02-02 19:56:42 (UTC) |
commit | 20191b4c5acf30282436a7f7215719f7b2ec8b01 (patch) (unidiff) | |
tree | dd7ab3caab6d06a09200b3b45c37e98a977ccaff /korganizer | |
parent | f94c5075fdd356c7a73b23150287034216ef0bdf (diff) | |
download | kdepimpi-20191b4c5acf30282436a7f7215719f7b2ec8b01.zip kdepimpi-20191b4c5acf30282436a7f7215719f7b2ec8b01.tar.gz kdepimpi-20191b4c5acf30282436a7f7215719f7b2ec8b01.tar.bz2 |
ccc
-rw-r--r-- | korganizer/koagendaview.cpp | 47 | ||||
-rw-r--r-- | korganizer/koagendaview.h | 1 |
2 files changed, 45 insertions, 3 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index c018dc7..f8301f8 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp | |||
@@ -428,12 +428,12 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) : | |||
428 | QVBox *dummyAllDayRight = new QVBox(mAllDayFrame); | 428 | QVBox *dummyAllDayRight = new QVBox(mAllDayFrame); |
429 | 429 | ||
430 | QPushButton *dummyAllDayRightB = new QPushButton(dummyAllDayRight); | 430 | QPushButton *dummyAllDayRightB = new QPushButton(dummyAllDayRight); |
431 | QLabel * dummyAllDayRightL = new QLabel ( dummyAllDayRight ); | 431 | mDummyAllDayRightL = new QLabel ( dummyAllDayRight ); |
432 | 432 | ||
433 | dummyAllDayRightB->setFlat( true ); | 433 | dummyAllDayRightB->setFlat( true ); |
434 | dummyAllDayRightB->setFocusPolicy(NoFocus); | 434 | dummyAllDayRightB->setFocusPolicy(NoFocus); |
435 | // dummyAllDayRightB->setSizePolicy(QSizePolicy( QSizePolicy::Expanding ,QSizePolicy::Expanding )); | 435 | // dummyAllDayRightB->setSizePolicy(QSizePolicy( QSizePolicy::Expanding ,QSizePolicy::Expanding )); |
436 | //dummyAllDayRightB->setFixedHeight( dummyAllDayRightB->sizeHint().height()/2 ); | 436 | dummyAllDayRightB->setFixedHeight( (dummyAllDayRightB->sizeHint().height()/4)*3 ); |
437 | QPopupMenu * wpo = new QPopupMenu (this); | 437 | QPopupMenu * wpo = new QPopupMenu (this); |
438 | wpo->insertItem( i18n("W#"), 0 ); | 438 | wpo->insertItem( i18n("W#"), 0 ); |
439 | int i; | 439 | int i; |
@@ -578,6 +578,19 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) : | |||
578 | // connect( mAgenda, SIGNAL( cloneIncidenceSignal(Incidence *) ), SIGNAL( cloneIncidenceSignal(Incidence *) ) ); | 578 | // connect( mAgenda, SIGNAL( cloneIncidenceSignal(Incidence *) ), SIGNAL( cloneIncidenceSignal(Incidence *) ) ); |
579 | //connect( mAllDayAgenda, SIGNAL( cloneIncidenceSignal(Incidence *) ), SIGNAL( cloneIncidenceSignal(Incidence *) ) ); | 579 | //connect( mAllDayAgenda, SIGNAL( cloneIncidenceSignal(Incidence *) ), SIGNAL( cloneIncidenceSignal(Incidence *) ) ); |
580 | 580 | ||
581 | QFont dlf = KOPrefs::instance()->mTimeLabelsFont; | ||
582 | QFontMetrics fm ( dlf ); | ||
583 | QString dayTest = "30"; | ||
584 | int wid = fm.width( dayTest ); | ||
585 | int maxWid = dummyAllDayRight->width(); | ||
586 | int fontPoint = dlf.pointSize(); | ||
587 | while ( wid > maxWid ) { | ||
588 | --fontPoint; | ||
589 | dlf.setPointSize( fontPoint ); | ||
590 | QFontMetrics f( dlf ); | ||
591 | wid = f.width( dayTest ); | ||
592 | } | ||
593 | mDummyAllDayRightL->setFont( dlf ); | ||
581 | 594 | ||
582 | } | 595 | } |
583 | 596 | ||
@@ -918,7 +931,8 @@ void KOAgendaView::updateConfig() | |||
918 | { | 931 | { |
919 | if ( mBlockUpdating ) | 932 | if ( mBlockUpdating ) |
920 | return; | 933 | return; |
921 | // kdDebug() << "KOAgendaView::updateConfig()" << endl; | 934 | |
935 | |||
922 | 936 | ||
923 | // update config for children | 937 | // update config for children |
924 | mTimeLabels->updateConfig(); | 938 | mTimeLabels->updateConfig(); |
@@ -1084,6 +1098,33 @@ void KOAgendaView::fillAgenda() | |||
1084 | // clearView(); | 1098 | // clearView(); |
1085 | //qDebug("fillAgenda()++++ "); | 1099 | //qDebug("fillAgenda()++++ "); |
1086 | globalFlagBlockAgendaItemPaint = 1; | 1100 | globalFlagBlockAgendaItemPaint = 1; |
1101 | |||
1102 | int weekNum = 0; | ||
1103 | QDate seda = mSelectedDates.first(); | ||
1104 | QDate d = QDate ( seda.year(), 1,1); | ||
1105 | seda = seda.addDays( 1-seda.dayOfWeek() );//we are on monday | ||
1106 | if ( seda.addDays(6).year() != seda.year() ) { | ||
1107 | if ( seda.year() != d.year() ) { | ||
1108 | if ( d.dayOfWeek() > 4 ) | ||
1109 | d = QDate ( seda.year(), 1,1); | ||
1110 | else | ||
1111 | weekNum = 1; | ||
1112 | } else { | ||
1113 | QDate dd( seda.year()+1, 1,1); | ||
1114 | if ( dd.dayOfWeek() <= 4 ) | ||
1115 | weekNum = 1; | ||
1116 | } | ||
1117 | } | ||
1118 | if ( weekNum == 0 ){ | ||
1119 | int dow = d.dayOfWeek(); | ||
1120 | if ( dow <= 4 ) | ||
1121 | d = d.addDays( 1-dow ); | ||
1122 | else // 5,6,7 | ||
1123 | d = d.addDays( 8-dow ); | ||
1124 | // we have the first week of the year.we are on monday | ||
1125 | weekNum = d.daysTo( seda ) / 7 +1; | ||
1126 | } | ||
1127 | mDummyAllDayRightL->setText( QString::number( weekNum) ); | ||
1087 | mAllDayAgenda->changeColumns(mSelectedDates.count()); | 1128 | mAllDayAgenda->changeColumns(mSelectedDates.count()); |
1088 | mAgenda->changeColumns(mSelectedDates.count()); | 1129 | mAgenda->changeColumns(mSelectedDates.count()); |
1089 | qApp->processEvents(); | 1130 | qApp->processEvents(); |
diff --git a/korganizer/koagendaview.h b/korganizer/koagendaview.h index 4a058ce..ba9bc93 100644 --- a/korganizer/koagendaview.h +++ b/korganizer/koagendaview.h | |||
@@ -216,6 +216,7 @@ class KOAgendaView : public KOEventView { | |||
216 | // void cloneIncidenceSignal(Incidence *); | 216 | // void cloneIncidenceSignal(Incidence *); |
217 | 217 | ||
218 | protected: | 218 | protected: |
219 | QLabel * mDummyAllDayRightL; | ||
219 | KOAgendaButton* getNewDaylabel(); | 220 | KOAgendaButton* getNewDaylabel(); |
220 | bool mBlockUpdating; | 221 | bool mBlockUpdating; |
221 | int mUpcomingWidth; | 222 | int mUpcomingWidth; |