summaryrefslogtreecommitdiffabout
path: root/microkde/kdatetbl.cpp
Unidiff
Diffstat (limited to 'microkde/kdatetbl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kdatetbl.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/microkde/kdatetbl.cpp b/microkde/kdatetbl.cpp
index 990cfb9..a9924ba 100644
--- a/microkde/kdatetbl.cpp
+++ b/microkde/kdatetbl.cpp
@@ -435,49 +435,49 @@ 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
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 += 6; 459 add += 8;
460 font.setPointSize(fontsize+add); 460 font.setPointSize(fontsize+add);
461 setFont(font); 461 setFont(font);
462 setHScrollBarMode(AlwaysOff); 462 setHScrollBarMode(AlwaysOff);
463 setVScrollBarMode(AlwaysOff); 463 setVScrollBarMode(AlwaysOff);
464 setFrameStyle(QFrame::NoFrame); 464 setFrameStyle(QFrame::NoFrame);
465 setNumRows(4); 465 setNumRows(4);
466 setNumCols(3); 466 setNumCols(3);
467 // enable to find drawing failures: 467 // enable to find drawing failures:
468 // setTableFlags(Tbl_clipCellPainting); 468 // setTableFlags(Tbl_clipCellPainting);
469#if 0 469#if 0
470 viewport()->setEraseColor(lightGray); // for consistency with the datepicker 470 viewport()->setEraseColor(lightGray); // for consistency with the datepicker
471#endif 471#endif
472 // ----- find the preferred size 472 // ----- find the preferred size
473 // (this is slow, possibly, but unfortunatly it is needed here): 473 // (this is slow, possibly, but unfortunatly it is needed here):
474 QFontMetrics metrics(font); 474 QFontMetrics metrics(font);
475 for(int i=1; i <= 12; ++i) 475 for(int i=1; i <= 12; ++i)
476 { 476 {
477 rect=metrics.boundingRect(KGlobal::locale()->monthName(i, false)); 477 rect=metrics.boundingRect(KGlobal::locale()->monthName(i, false));
478 if(max.width()<rect.width()) max.setWidth(rect.width()); 478 if(max.width()<rect.width()) max.setWidth(rect.width());
479 if(max.height()<rect.height()) max.setHeight(rect.height()); 479 if(max.height()<rect.height()) max.setHeight(rect.height());
480 } 480 }
481 481
482} 482}
483 483
@@ -757,49 +757,49 @@ KPopupFrame::exec(int x, int y)
757 757
758void KPopupFrame::virtual_hook( int, void* ) 758void KPopupFrame::virtual_hook( int, void* )
759{ /*BASE::virtual_hook( id, data );*/ } 759{ /*BASE::virtual_hook( id, data );*/ }
760 760
761void KDateTable::virtual_hook( int, void* ) 761void KDateTable::virtual_hook( int, void* )
762{ /*BASE::virtual_hook( id, data );*/ } 762{ /*BASE::virtual_hook( id, data );*/ }
763 763
764//#include "kdatetbl.moc" 764//#include "kdatetbl.moc"
765 765
766 766
767KDateInternalWeekPicker::KDateInternalWeekPicker 767KDateInternalWeekPicker::KDateInternalWeekPicker
768(QWidget* parent, const char* name) 768(QWidget* parent, const char* name)
769 : QGridView(parent, name), 769 : QGridView(parent, name),
770 result(0) // invalid 770 result(0) // invalid
771{ 771{
772 QRect rect; 772 QRect rect;
773 QFont font; 773 QFont font;
774 // ----- 774 // -----
775 activeCol = -1; 775 activeCol = -1;
776 activeRow = -1; 776 activeRow = -1;
777 font=KGlobalSettings::generalFont(); 777 font=KGlobalSettings::generalFont();
778 int fontsize = 10; 778 int fontsize = 10;
779 int add = 2; 779 int add = 2;
780 if ( QApplication::desktop()->width() >= 480 && QApplication::desktop()->width() <= 640 ) 780 if ( QApplication::desktop()->width() >= 480 && QApplication::desktop()->width() <= 640 )
781 add += 4; 781 add += 6;
782 font.setPointSize(fontsize+add); 782 font.setPointSize(fontsize+add);
783 setFont(font); 783 setFont(font);
784 setHScrollBarMode(AlwaysOff); 784 setHScrollBarMode(AlwaysOff);
785 setVScrollBarMode(AlwaysOff); 785 setVScrollBarMode(AlwaysOff);
786 setFrameStyle(QFrame::NoFrame); 786 setFrameStyle(QFrame::NoFrame);
787 setNumRows(13); 787 setNumRows(13);
788 setNumCols(4); 788 setNumCols(4);
789 // enable to find drawing failures: 789 // enable to find drawing failures:
790 // setTableFlags(Tbl_clipCellPainting); 790 // setTableFlags(Tbl_clipCellPainting);
791#if 0 791#if 0
792 viewport()->setEraseColor(lightGray); // for consistency with the datepicker 792 viewport()->setEraseColor(lightGray); // for consistency with the datepicker
793#endif 793#endif
794 // ----- find the preferred size 794 // ----- find the preferred size
795 // (this is slow, possibly, but unfortunatly it is needed here): 795 // (this is slow, possibly, but unfortunatly it is needed here):
796 QFontMetrics metrics(font); 796 QFontMetrics metrics(font);
797 for(int i=1; i <= 52; ++i) 797 for(int i=1; i <= 52; ++i)
798 { 798 {
799 rect=metrics.boundingRect(QString::number( i )); 799 rect=metrics.boundingRect(QString::number( i ));
800 if(max.width()<rect.width()) max.setWidth(rect.width()); 800 if(max.width()<rect.width()) max.setWidth(rect.width());
801 if(max.height()<rect.height()) max.setHeight(rect.height()); 801 if(max.height()<rect.height()) max.setHeight(rect.height());
802 } 802 }
803 if ( QApplication::desktop()->width() > 640 ) { 803 if ( QApplication::desktop()->width() > 640 ) {
804 804
805 max.setWidth(max.width()+6); 805 max.setWidth(max.width()+6);