author | zautrix <zautrix> | 2005-02-02 19:56:42 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-02-02 19:56:42 (UTC) |
commit | 20191b4c5acf30282436a7f7215719f7b2ec8b01 (patch) (side-by-side diff) | |
tree | dd7ab3caab6d06a09200b3b45c37e98a977ccaff /korganizer/koagendaview.cpp | |
parent | f94c5075fdd356c7a73b23150287034216ef0bdf (diff) | |
download | kdepimpi-20191b4c5acf30282436a7f7215719f7b2ec8b01.zip kdepimpi-20191b4c5acf30282436a7f7215719f7b2ec8b01.tar.gz kdepimpi-20191b4c5acf30282436a7f7215719f7b2ec8b01.tar.bz2 |
ccc
-rw-r--r-- | korganizer/koagendaview.cpp | 47 |
1 files changed, 44 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 @@ -429,10 +429,10 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) : QPushButton *dummyAllDayRightB = new QPushButton(dummyAllDayRight); - QLabel * dummyAllDayRightL = new QLabel ( dummyAllDayRight ); + mDummyAllDayRightL = new QLabel ( dummyAllDayRight ); dummyAllDayRightB->setFlat( true ); dummyAllDayRightB->setFocusPolicy(NoFocus); // dummyAllDayRightB->setSizePolicy(QSizePolicy( QSizePolicy::Expanding ,QSizePolicy::Expanding )); - //dummyAllDayRightB->setFixedHeight( dummyAllDayRightB->sizeHint().height()/2 ); + dummyAllDayRightB->setFixedHeight( (dummyAllDayRightB->sizeHint().height()/4)*3 ); QPopupMenu * wpo = new QPopupMenu (this); wpo->insertItem( i18n("W#"), 0 ); @@ -579,4 +579,17 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) : //connect( mAllDayAgenda, SIGNAL( cloneIncidenceSignal(Incidence *) ), SIGNAL( cloneIncidenceSignal(Incidence *) ) ); + QFont dlf = KOPrefs::instance()->mTimeLabelsFont; + QFontMetrics fm ( dlf ); + QString dayTest = "30"; + int wid = fm.width( dayTest ); + int maxWid = dummyAllDayRight->width(); + int fontPoint = dlf.pointSize(); + while ( wid > maxWid ) { + --fontPoint; + dlf.setPointSize( fontPoint ); + QFontMetrics f( dlf ); + wid = f.width( dayTest ); + } + mDummyAllDayRightL->setFont( dlf ); } @@ -919,5 +932,6 @@ void KOAgendaView::updateConfig() if ( mBlockUpdating ) return; - // kdDebug() << "KOAgendaView::updateConfig()" << endl; + + // update config for children @@ -1085,4 +1099,31 @@ void KOAgendaView::fillAgenda() //qDebug("fillAgenda()++++ "); globalFlagBlockAgendaItemPaint = 1; + + int weekNum = 0; + QDate seda = mSelectedDates.first(); + QDate d = QDate ( seda.year(), 1,1); + seda = seda.addDays( 1-seda.dayOfWeek() );//we are on monday + if ( seda.addDays(6).year() != seda.year() ) { + if ( seda.year() != d.year() ) { + if ( d.dayOfWeek() > 4 ) + d = QDate ( seda.year(), 1,1); + else + weekNum = 1; + } else { + QDate dd( seda.year()+1, 1,1); + if ( dd.dayOfWeek() <= 4 ) + weekNum = 1; + } + } + if ( weekNum == 0 ){ + int dow = d.dayOfWeek(); + if ( dow <= 4 ) + d = d.addDays( 1-dow ); + else // 5,6,7 + d = d.addDays( 8-dow ); + // we have the first week of the year.we are on monday + weekNum = d.daysTo( seda ) / 7 +1; + } + mDummyAllDayRightL->setText( QString::number( weekNum) ); mAllDayAgenda->changeColumns(mSelectedDates.count()); mAgenda->changeColumns(mSelectedDates.count()); |