-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 5d83511..7f352d6 100644 --- a/libkdepim/kdatepicker.cpp +++ b/libkdepim/kdatepicker.cpp | |||
@@ -431,58 +431,59 @@ KDatePicker::setFontSize(int s) | |||
431 | // monthForward, | 431 | // monthForward, |
432 | // yearForward | 432 | // yearForward |
433 | }; | 433 | }; |
434 | const int NoOfButtons=sizeof(buttons)/sizeof(buttons[0]); | 434 | const int NoOfButtons=sizeof(buttons)/sizeof(buttons[0]); |
435 | int count; | 435 | int count; |
436 | QFont font; | 436 | QFont font; |
437 | QRect r; | 437 | QRect r; |
438 | // ----- | 438 | // ----- |
439 | fontsize=s; | 439 | fontsize=s; |
440 | for(count=0; count<NoOfButtons; ++count) | 440 | for(count=0; count<NoOfButtons; ++count) |
441 | { | 441 | { |
442 | font=buttons[count]->font(); | 442 | font=buttons[count]->font(); |
443 | font.setPointSize(s); | 443 | font.setPointSize(s); |
444 | buttons[count]->setFont(font); | 444 | buttons[count]->setFont(font); |
445 | } | 445 | } |
446 | QFontMetrics metrics(selectMonth->fontMetrics()); | 446 | QFontMetrics metrics(selectMonth->fontMetrics()); |
447 | for(int i=1; i <= 12; ++i) | 447 | for(int i=1; i <= 12; ++i) |
448 | { // maxMonthRect is used by sizeHint() | 448 | { // maxMonthRect is used by sizeHint() |
449 | r=metrics.boundingRect(KGlobal::locale()->monthName(i, false)); | 449 | r=metrics.boundingRect(KGlobal::locale()->monthName(i, false)); |
450 | maxMonthRect.setWidth(QMAX(r.width(), maxMonthRect.width())); | 450 | maxMonthRect.setWidth(QMAX(r.width(), maxMonthRect.width())); |
451 | maxMonthRect.setHeight(QMAX(r.height(), maxMonthRect.height())); | 451 | maxMonthRect.setHeight(QMAX(r.height(), maxMonthRect.height())); |
452 | } | 452 | } |
453 | table->setFontSize(s); | 453 | table->setFontSize(s); |
454 | } | 454 | } |
455 | 455 | ||
456 | void KDatePicker::virtual_hook( int id, void* data ) | 456 | void KDatePicker::virtual_hook( int id, void* data ) |
457 | { /*BASE::virtual_hook( id, data );*/ } | 457 | { /*BASE::virtual_hook( id, data );*/ } |
458 | 458 | ||
459 | void KDatePicker::keyPressEvent ( QKeyEvent * e ) | 459 | void KDatePicker::keyPressEvent ( QKeyEvent * e ) |
460 | { | 460 | { |
461 | switch ( e->key() ) { | 461 | switch ( e->key() ) { |
462 | case Qt::Key_Right: | 462 | case Qt::Key_Right: |
463 | monthForwardClicked(); | 463 | monthForwardClicked(); |
464 | break; | 464 | break; |
465 | case Qt::Key_Left: | 465 | case Qt::Key_Left: |
466 | monthBackwardClicked(); | 466 | monthBackwardClicked(); |
467 | break; | 467 | break; |
468 | 468 | ||
469 | case Qt::Key_Down: | 469 | case Qt::Key_Down: |
470 | yearForwardClicked(); | 470 | yearForwardClicked(); |
471 | 471 | ||
472 | break; | 472 | break; |
473 | 473 | ||
474 | case Qt::Key_Up: | 474 | case Qt::Key_Up: |
475 | yearBackwardClicked(); | 475 | yearBackwardClicked(); |
476 | break; | 476 | break; |
477 | 477 | ||
478 | case Qt::Key_Return: | 478 | case Qt::Key_Return: |
479 | case Qt::Key_Enter: | ||
479 | tableClickedSlot(); | 480 | tableClickedSlot(); |
480 | break; | 481 | break; |
481 | case Qt::Key_Escape: | 482 | case Qt::Key_Escape: |
482 | e->ignore(); | 483 | e->ignore(); |
483 | break; | 484 | break; |
484 | default: | 485 | default: |
485 | break; | 486 | break; |
486 | } | 487 | } |
487 | 488 | ||
488 | } | 489 | } |