summaryrefslogtreecommitdiffabout
path: root/microkde/kdatetbl.cpp
authorzautrix <zautrix>2005-02-08 18:29:59 (UTC)
committer zautrix <zautrix>2005-02-08 18:29:59 (UTC)
commit2124ce7f8c6edbd0e3ec32b1d1e6a625ef9450d6 (patch) (unidiff)
tree733f50ad5513065fe407fa341948172aae893b52 /microkde/kdatetbl.cpp
parent126b79abd88bb13ab41c4d987ee759eb9ba7d483 (diff)
downloadkdepimpi-2124ce7f8c6edbd0e3ec32b1d1e6a625ef9450d6.zip
kdepimpi-2124ce7f8c6edbd0e3ec32b1d1e6a625ef9450d6.tar.gz
kdepimpi-2124ce7f8c6edbd0e3ec32b1d1e6a625ef9450d6.tar.bz2
font fix
Diffstat (limited to 'microkde/kdatetbl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kdatetbl.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/microkde/kdatetbl.cpp b/microkde/kdatetbl.cpp
index a9924ba..1024796 100644
--- a/microkde/kdatetbl.cpp
+++ b/microkde/kdatetbl.cpp
@@ -436,48 +436,50 @@ KDateTable::sizeHint() const
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 )
461 add += 4;
460 font.setPointSize(fontsize+add); 462 font.setPointSize(fontsize+add);
461 setFont(font); 463 setFont(font);
462 setHScrollBarMode(AlwaysOff); 464 setHScrollBarMode(AlwaysOff);
463 setVScrollBarMode(AlwaysOff); 465 setVScrollBarMode(AlwaysOff);
464 setFrameStyle(QFrame::NoFrame); 466 setFrameStyle(QFrame::NoFrame);
465 setNumRows(4); 467 setNumRows(4);
466 setNumCols(3); 468 setNumCols(3);
467 // enable to find drawing failures: 469 // enable to find drawing failures:
468 // setTableFlags(Tbl_clipCellPainting); 470 // setTableFlags(Tbl_clipCellPainting);
469#if 0 471#if 0
470 viewport()->setEraseColor(lightGray); // for consistency with the datepicker 472 viewport()->setEraseColor(lightGray); // for consistency with the datepicker
471#endif 473#endif
472 // ----- find the preferred size 474 // ----- find the preferred size
473 // (this is slow, possibly, but unfortunatly it is needed here): 475 // (this is slow, possibly, but unfortunatly it is needed here):
474 QFontMetrics metrics(font); 476 QFontMetrics metrics(font);
475 for(int i=1; i <= 12; ++i) 477 for(int i=1; i <= 12; ++i)
476 { 478 {
477 rect=metrics.boundingRect(KGlobal::locale()->monthName(i, false)); 479 rect=metrics.boundingRect(KGlobal::locale()->monthName(i, false));
478 if(max.width()<rect.width()) max.setWidth(rect.width()); 480 if(max.width()<rect.width()) max.setWidth(rect.width());
479 if(max.height()<rect.height()) max.setHeight(rect.height()); 481 if(max.height()<rect.height()) max.setHeight(rect.height());
480 } 482 }
481 483
482} 484}
483 485