-rw-r--r-- | microkde/kdatetbl.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/microkde/kdatetbl.cpp b/microkde/kdatetbl.cpp index 1024796..d182279 100644 --- a/microkde/kdatetbl.cpp +++ b/microkde/kdatetbl.cpp | |||
@@ -429,65 +429,65 @@ void KDateTable::focusOutEvent( QFocusEvent *e ) | |||
429 | repaintContents(false); | 429 | repaintContents(false); |
430 | QGridView::focusOutEvent( e ); | 430 | QGridView::focusOutEvent( e ); |
431 | } | 431 | } |
432 | 432 | ||
433 | QSize | 433 | QSize |
434 | KDateTable::sizeHint() const | 434 | KDateTable::sizeHint() const |
435 | { | 435 | { |
436 | if(maxCell.height()>0 && maxCell.width()>0) | 436 | if(maxCell.height()>0 && maxCell.width()>0) |
437 | { | 437 | { |
438 | return QSize((maxCell.width()+2)*numCols()+2*frameWidth(), | 438 | return QSize((maxCell.width()+2)*numCols()+2*frameWidth(), |
439 | (maxCell.height()+4)*numRows()+2*frameWidth()); | 439 | (maxCell.height()+4)*numRows()+2*frameWidth()); |
440 | } else { | 440 | } else { |
441 | return QSize(-1, -1); | 441 | return QSize(-1, -1); |
442 | } | 442 | } |
443 | } | 443 | } |
444 | 444 | ||
445 | KDateInternalMonthPicker::KDateInternalMonthPicker | 445 | KDateInternalMonthPicker::KDateInternalMonthPicker |
446 | (QWidget* parent, const char* name) | 446 | (QWidget* parent, const char* name) |
447 | : QGridView(parent, name), | 447 | : QGridView(parent, name), |
448 | result(0) // invalid | 448 | result(0) // invalid |
449 | { | 449 | { |
450 | QRect rect; | 450 | QRect rect; |
451 | QFont font; | 451 | QFont font; |
452 | // ----- | 452 | // ----- |
453 | activeCol = -1; | 453 | activeCol = -1; |
454 | activeRow = -1; | 454 | activeRow = -1; |
455 | font=KGlobalSettings::generalFont(); | 455 | font=KGlobalSettings::generalFont(); |
456 | int fontsize = 10; | 456 | int fontsize = 10; |
457 | int add = 2; | 457 | int add = 2; |
458 | if ( QApplication::desktop()->width() >= 480 && QApplication::desktop()->width() <= 640 ) | 458 | if ( QApplication::desktop()->width() >= 480 && QApplication::desktop()->width() <= 640 ) |
459 | add += 8; | 459 | add += 8; |
460 | if ( QApplication::desktop()->width() > 640 ) | 460 | if ( QApplication::desktop()->width() > 640 ) |
461 | add += 4; | 461 | add += 6; |
462 | font.setPointSize(fontsize+add); | 462 | font.setPointSize(fontsize+add); |
463 | setFont(font); | 463 | setFont(font); |
464 | setHScrollBarMode(AlwaysOff); | 464 | setHScrollBarMode(AlwaysOff); |
465 | setVScrollBarMode(AlwaysOff); | 465 | setVScrollBarMode(AlwaysOff); |
466 | setFrameStyle(QFrame::NoFrame); | 466 | setFrameStyle(QFrame::NoFrame); |
467 | setNumRows(4); | 467 | setNumRows(4); |
468 | setNumCols(3); | 468 | setNumCols(3); |
469 | // enable to find drawing failures: | 469 | // enable to find drawing failures: |
470 | // setTableFlags(Tbl_clipCellPainting); | 470 | // setTableFlags(Tbl_clipCellPainting); |
471 | #if 0 | 471 | #if 0 |
472 | viewport()->setEraseColor(lightGray); // for consistency with the datepicker | 472 | viewport()->setEraseColor(lightGray); // for consistency with the datepicker |
473 | #endif | 473 | #endif |
474 | // ----- find the preferred size | 474 | // ----- find the preferred size |
475 | // (this is slow, possibly, but unfortunatly it is needed here): | 475 | // (this is slow, possibly, but unfortunatly it is needed here): |
476 | QFontMetrics metrics(font); | 476 | QFontMetrics metrics(font); |
477 | for(int i=1; i <= 12; ++i) | 477 | for(int i=1; i <= 12; ++i) |
478 | { | 478 | { |
479 | rect=metrics.boundingRect(KGlobal::locale()->monthName(i, false)); | 479 | rect=metrics.boundingRect(KGlobal::locale()->monthName(i, false)); |
480 | if(max.width()<rect.width()) max.setWidth(rect.width()); | 480 | if(max.width()<rect.width()) max.setWidth(rect.width()); |
481 | if(max.height()<rect.height()) max.setHeight(rect.height()); | 481 | if(max.height()<rect.height()) max.setHeight(rect.height()); |
482 | } | 482 | } |
483 | 483 | ||
484 | } | 484 | } |
485 | 485 | ||
486 | QSize | 486 | QSize |
487 | KDateInternalMonthPicker::sizeHint() const | 487 | KDateInternalMonthPicker::sizeHint() const |
488 | { | 488 | { |
489 | return QSize((max.width()+6)*numCols()+2*frameWidth(), | 489 | return QSize((max.width()+6)*numCols()+2*frameWidth(), |
490 | (max.height()+6)*numRows()+2*frameWidth()); | 490 | (max.height()+6)*numRows()+2*frameWidth()); |
491 | } | 491 | } |
492 | 492 | ||
493 | int | 493 | int |