author | zautrix <zautrix> | 2005-03-18 10:44:44 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-18 10:44:44 (UTC) |
commit | 414cb038cbe353f2fdb90969bc2531b687acc85f (patch) (side-by-side diff) | |
tree | 178c9da0d3a711a90beef435d32dcce50c53bdae /korganizer | |
parent | e972244f2a0581496301c7aa12e0498b34b48479 (diff) | |
download | kdepimpi-414cb038cbe353f2fdb90969bc2531b687acc85f.zip kdepimpi-414cb038cbe353f2fdb90969bc2531b687acc85f.tar.gz kdepimpi-414cb038cbe353f2fdb90969bc2531b687acc85f.tar.bz2 |
print fix
-rw-r--r-- | korganizer/calprintbase.cpp | 20 | ||||
-rw-r--r-- | korganizer/koagenda.cpp | 2 |
2 files changed, 8 insertions, 14 deletions
diff --git a/korganizer/calprintbase.cpp b/korganizer/calprintbase.cpp index f66fddc..7b7d54c 100644 --- a/korganizer/calprintbase.cpp +++ b/korganizer/calprintbase.cpp @@ -654,15 +654,3 @@ void CalPrintBase::drawDayBox(QPainter &p, const QDate &qd, if (fullDate) { - /*int index; - dayNumStr= qd.toString(); - index = dayNumStr.find(' '); - dayNumStr.remove(0, index); - index = dayNumStr.findRev(' '); - dayNumStr.truncate(index);*/ - - const KCalendarSystem *calSys = KOGlobals::self()->calendarSystem(); - dayNumStr = i18n("weekday month date", "%1 %2 %3") - .arg( calSys->weekDayName( qd ) ) - .arg( calSys->monthName( qd ) ) - .arg( qd.day() ); -// dayNumStr = local->formatDate(qd); + dayNumStr = local->formatDate(qd); } else { @@ -688,2 +676,8 @@ void CalPrintBase::drawDayBox(QPainter &p, const QDate &qd, p.setFont(QFont("helvetica", 10, QFont::Bold)); + if ( fullDate) { + // use short date format, if long date is too long + QFontMetrics fm ( p.font() ); + if ( fm.width( dayNumStr ) > width -10 ) + dayNumStr = local->formatDate(qd, true); + } p.drawText(x+5, y, width-10, mSubHeaderHeight, AlignRight | AlignVCenter, diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp index e8b7c94..8c2996b 100644 --- a/korganizer/koagenda.cpp +++ b/korganizer/koagenda.cpp @@ -2006,3 +2006,3 @@ void KOAgenda::printSelection() QString date = i18n("Date range: ")+KGlobal::locale()->formatDate( mSelectedDates.first() )+" - "+KGlobal::locale()->formatDate( mSelectedDates.last() ); - date += " --- printing time: " + KGlobal::locale()->formatDateTime(QDateTime::currentDateTime(), true ); + //date += " --- printing time: " + KGlobal::locale()->formatDateTime(QDateTime::currentDateTime(), true ); int hei = p.boundingRect(0,0, 5, 5, Qt::AlignLeft, date ).height(); |