summaryrefslogtreecommitdiffabout
path: root/korganizer
Side-by-side diff
Diffstat (limited to 'korganizer') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/koagendaview.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index 8c27c43..d3db89a 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -641,72 +641,73 @@ QPushButton* KOAgendaView::getNewDaylabel()
}
void KOAgendaView::createDayLabels()
{
if ( mBlockUpdating || globalFlagBlockLabel == 1) {
// qDebug(" KOAgendaView::createDayLabels() blocked ");
return;
}
int newHight;
// ### Before deleting and recreating we could check if mSelectedDates changed...
// It would remove some flickering and gain speed (since this is called by
// each updateView() call)
int maxWid = mUpcomingWidth - mTimeLabels->width()- mAgenda->verticalScrollBar()->width() - 2;
mDayLabelsFrame->setMaximumWidth( mUpcomingWidth );
if ( maxWid < 0 )
maxWid = 20;
QFont dlf = KOPrefs::instance()->mTimeLabelsFont;
QFontMetrics fm ( dlf );
int selCount = mSelectedDates.count();
- QString dayTest = "Mon 20";
+ QString dayTest = "Won 20";
+ //QString dayTest = "Mon 20";
int wid = fm.width( dayTest );
//maxWid -= ( selCount * 3 ); //working for QLabels
maxWid -= ( selCount * 5 ); //working for QPushButton
if ( maxWid < 0 )
maxWid = 20;
int needWid = wid * selCount;
//qDebug("++++++++Needed : %d MaxWidth: %d", needWid, maxWid );
//if ( needWid > maxWid )
// qDebug("DAYLABELS TOOOOOOO BIG ");
while ( needWid > maxWid ) {
dayTest = dayTest.left( dayTest.length() - 1 );
- wid = fm.width( dayTest );
+ wid = fm.width( dayTest )+1;
needWid = wid * selCount;
}
int maxLen = dayTest.length();
int fontPoint = dlf.pointSize();
if ( maxLen < 2 ) {
int fontPoint = dlf.pointSize();
while ( fontPoint > 4 ) {
--fontPoint;
dlf.setPointSize( fontPoint );
QFontMetrics f( dlf );
- wid = f.width( "20" )+2;
+ wid = f.width( "30" )+3;
needWid = wid * selCount;
if ( needWid < maxWid )
break;
}
maxLen = 2;
}
//qDebug("Max len %d ", dayTest.length() );
QFontMetrics tempF( dlf );
newHight = tempF.height();
mDayLabels->setFont( dlf );
// mLayoutDayLabels = new QHBoxLayout(mDayLabels);;
// mLayoutDayLabels->addSpacing(mTimeLabels->width());
//mLayoutDayLabels->addSpacing( 2 );
// QFont lFont = dlf;
bool appendLabels = false;
QPushButton *dayLabel;
dayLabel = mDayLabelsList.first();
if ( !dayLabel ) {
appendLabels = true;
dayLabel = getNewDaylabel();
}
dayLabel->setFixedWidth( mTimeLabels->width()+2 );
dayLabel->setFont( dlf );
@@ -976,50 +977,48 @@ void KOAgendaView::updateEventDates(KOAgendaItem *item, int type)
endDt.setDate(startDate.
addDays(item->lastMultiItem()->cellX() - item->cellX()));
} else {
endDt.setTime(mAgenda->gyToTime(item->cellYBottom()+1));
endDt.setDate(startDate);
}
}
} else {
// todo
qDebug("tooooodoooooo ");
if (item->lastMultiItem()) {
endDt.setTime(mAgenda->gyToTime(item->lastMultiItem()->cellYBottom()+1));
endDt.setDate(startDate.
addDays(item->lastMultiItem()->cellX() - item->cellX()));
} else {
//qDebug("tem->cellYBottom() %d",item->cellYBottom() );
if ( item->cellYBottom() > 0 )
endDt.setTime(mAgenda->gyToTime(item->cellYBottom()+1));
else
endDt.setTime((static_cast<Todo*>(item->incidence()))->dtDue().time());
endDt.setDate(startDate);
}
}
}
-
- qDebug("to888");
if ( item->incidence()->type() == "Event" ) {
item->incidence()->setDtStart(startDt);
(static_cast<Event*>(item->incidence()))->setDtEnd(endDt);
} else if ( item->incidence()->type() == "Todo" ) {
(static_cast<Todo*>(item->incidence()))->setDtDue(endDt);
}
//qDebug("KOAgendaView::updateEventDates stsart %s end %s ", startDt.toString().latin1(), endDt.toString().latin1() );
item->incidence()->setRevision(item->incidence()->revision()+1);
item->setItemDate(startDt.date());
//item->updateItem();
if ( item->incidence()->type() == "Todo" ) {
emit todoMoved((Todo*)item->incidence(), KOGlobals::EVENTEDITED );
}
else
emit incidenceChanged(item->incidence(), KOGlobals::EVENTEDITED);
item->updateItem();
}
void KOAgendaView::showDates( const QDate &start, const QDate &end )
{
// kdDebug() << "KOAgendaView::selectDates" << endl;
mSelectedDates.clear();