Changeset 04ea240


Ignore:
Timestamp:
07/13/11 21:09:28 (10 years ago)
Author:
Philipp Spitzer <philipp@…>
Branches:
master, qt5
Children:
6817002
Parents:
fdf4d9c
Message:

Changed the placement of the date label again.
Changed the date format to show the day-of-week.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/gui/daynavigatorwidget.cpp

    rfdf4d9c r04ea240  
    110110    Q_UNUSED(aEvent);
    111111
    112     QString selectedDateStr = mCurDate.toString("MMM dd yyyy");
    113 
     112    QString selectedDateStr = mCurDate.toString("dddd\nyyyy-MM-dd");
    114113    QPainter painter(this);
    115114    painter.save();
    116     QRect r = selectedDate->geometry();
    117     QRect s = mFontMetrics->boundingRect(selectedDateStr);
    118     QPoint p = QPoint(
    119             r.x() + r.width()/2 - s.height()/2 - mFontMetrics->descent(),
    120             - s.width()
    121             );
    122 
    123     painter.translate(r.width()/2, r.height()/2);
     115    QRect q(y()-height(), x(), height(), width());
    124116    painter.rotate(270);
    125     painter.drawText(p.y(), p.x(), selectedDateStr); // y,x,string
     117    painter.drawText(q, Qt::AlignCenter, selectedDateStr);
    126118    painter.restore();
    127119}
Note: See TracChangeset for help on using the changeset viewer.