summaryrefslogtreecommitdiffabout
path: root/microkde
Unidiff
Diffstat (limited to 'microkde') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kdatetbl.cpp2
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
@@ -413,97 +413,97 @@ KDateTable::setDate(const QDate& date_)
413} 413}
414 414
415const QDate& 415const QDate&
416KDateTable::getDate() const 416KDateTable::getDate() const
417{ 417{
418 return date; 418 return date;
419} 419}
420 420
421void KDateTable::focusInEvent( QFocusEvent *e ) 421void KDateTable::focusInEvent( QFocusEvent *e )
422{ 422{
423 repaintContents(false); 423 repaintContents(false);
424 QGridView::focusInEvent( e ); 424 QGridView::focusInEvent( e );
425} 425}
426 426
427void KDateTable::focusOutEvent( QFocusEvent *e ) 427void KDateTable::focusOutEvent( QFocusEvent *e )
428{ 428{
429 repaintContents(false); 429 repaintContents(false);
430 QGridView::focusOutEvent( e ); 430 QGridView::focusOutEvent( e );
431} 431}
432 432
433QSize 433QSize
434KDateTable::sizeHint() const 434KDateTable::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
445KDateInternalMonthPicker::KDateInternalMonthPicker 445KDateInternalMonthPicker::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
486QSize 486QSize
487KDateInternalMonthPicker::sizeHint() const 487KDateInternalMonthPicker::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
493int 493int
494KDateInternalMonthPicker::getResult() const 494KDateInternalMonthPicker::getResult() const
495{ 495{
496 return result; 496 return result;
497} 497}
498 498
499void 499void
500KDateInternalMonthPicker::setupPainter(QPainter *p) 500KDateInternalMonthPicker::setupPainter(QPainter *p)
501{ 501{
502 p->setPen(black); 502 p->setPen(black);
503} 503}
504 504
505void 505void
506KDateInternalMonthPicker::viewportResizeEvent(QResizeEvent*) 506KDateInternalMonthPicker::viewportResizeEvent(QResizeEvent*)
507{ 507{
508 setCellWidth(width()/3); 508 setCellWidth(width()/3);
509 setCellHeight(height()/4); 509 setCellHeight(height()/4);