-rw-r--r-- | libkdepim/kdatepicker.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libkdepim/kdatepicker.cpp b/libkdepim/kdatepicker.cpp index 7f352d6..25b4e81 100644 --- a/libkdepim/kdatepicker.cpp +++ b/libkdepim/kdatepicker.cpp @@ -416,74 +416,75 @@ KDatePicker::sizeHint() const cx = QApplication::desktop()->width() -5; // ----- calculate height hint: cy+=tableSize.height()+lineDate->sizeHint().height(); return QSize(cx, cy); } void KDatePicker::setFontSize(int s) { QWidget *buttons[]= { // yearBackward, // monthBackward, selectMonth, selectYear, // monthForward, // yearForward }; const int NoOfButtons=sizeof(buttons)/sizeof(buttons[0]); int count; QFont font; QRect r; // ----- fontsize=s; for(count=0; count<NoOfButtons; ++count) { font=buttons[count]->font(); font.setPointSize(s); buttons[count]->setFont(font); } QFontMetrics metrics(selectMonth->fontMetrics()); for(int i=1; i <= 12; ++i) { // maxMonthRect is used by sizeHint() r=metrics.boundingRect(KGlobal::locale()->monthName(i, false)); maxMonthRect.setWidth(QMAX(r.width(), maxMonthRect.width())); maxMonthRect.setHeight(QMAX(r.height(), maxMonthRect.height())); } table->setFontSize(s); } void KDatePicker::virtual_hook( int id, void* data ) { /*BASE::virtual_hook( id, data );*/ } void KDatePicker::keyPressEvent ( QKeyEvent * e ) { switch ( e->key() ) { case Qt::Key_Right: monthForwardClicked(); break; case Qt::Key_Left: monthBackwardClicked(); break; case Qt::Key_Down: yearForwardClicked(); break; case Qt::Key_Up: yearBackwardClicked(); break; case Qt::Key_Return: case Qt::Key_Enter: + case Qt::Key_Space: tableClickedSlot(); break; case Qt::Key_Escape: e->ignore(); break; default: break; } } |