summaryrefslogtreecommitdiffabout
path: root/microkde/kdatetbl.cpp
authorzautrix <zautrix>2005-04-30 07:32:03 (UTC)
committer zautrix <zautrix>2005-04-30 07:32:03 (UTC)
commit7c31102a00920834ab8e3778f0f459b96b2fb309 (patch) (unidiff)
tree9f238caaaab4ba150e4f14708d85162af0ea5092 /microkde/kdatetbl.cpp
parentbdaded2da25b0ccef80d6e638fa12f92a4f8744d (diff)
downloadkdepimpi-7c31102a00920834ab8e3778f0f459b96b2fb309.zip
kdepimpi-7c31102a00920834ab8e3778f0f459b96b2fb309.tar.gz
kdepimpi-7c31102a00920834ab8e3778f0f459b96b2fb309.tar.bz2
fixes
Diffstat (limited to 'microkde/kdatetbl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kdatetbl.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/microkde/kdatetbl.cpp b/microkde/kdatetbl.cpp
index 2d97c8c..4271b55 100644
--- a/microkde/kdatetbl.cpp
+++ b/microkde/kdatetbl.cpp
@@ -786,8 +786,13 @@ KDateInternalWeekPicker::KDateInternalWeekPicker
786 setHScrollBarMode(AlwaysOff); 786 setHScrollBarMode(AlwaysOff);
787 setVScrollBarMode(AlwaysOff); 787 setVScrollBarMode(AlwaysOff);
788 setFrameStyle(QFrame::NoFrame); 788 setFrameStyle(QFrame::NoFrame);
789 setNumRows(13); 789 if ( QApplication::desktop()->height() > 240 ) {
790 setNumCols(4); 790 setNumRows(13);
791 setNumCols(4);
792 } else {
793 setNumRows(4);
794 setNumCols(13);
795 }
791 // enable to find drawing failures: 796 // enable to find drawing failures:
792 // setTableFlags(Tbl_clipCellPainting); 797 // setTableFlags(Tbl_clipCellPainting);
793#if 0 798#if 0
@@ -831,8 +836,8 @@ KDateInternalWeekPicker::setupPainter(QPainter *p)
831void 836void
832KDateInternalWeekPicker::viewportResizeEvent(QResizeEvent*) 837KDateInternalWeekPicker::viewportResizeEvent(QResizeEvent*)
833{ 838{
834 setCellWidth(width()/4); 839 setCellWidth(width()/ numCols());
835 setCellHeight(height()/13); 840 setCellHeight(height()/ numRows());
836} 841}
837 842
838void 843void
@@ -841,7 +846,7 @@ KDateInternalWeekPicker::paintCell(QPainter* painter, int row, int col)
841 int index; 846 int index;
842 QString text; 847 QString text;
843 // ----- find the number of the cell: 848 // ----- find the number of the cell:
844 index=4*row+col+1; 849 index=numCols()*row+col+1;
845 text=QString::number( index ); 850 text=QString::number( index );
846 painter->drawText(0, 0, cellWidth(), cellHeight(), AlignCenter, text); 851 painter->drawText(0, 0, cellWidth(), cellHeight(), AlignCenter, text);
847 if ( activeCol == col && activeRow == row ) 852 if ( activeCol == col && activeRow == row )
@@ -933,7 +938,7 @@ KDateInternalWeekPicker::contentsMouseReleaseEvent(QMouseEvent *e)
933 { // the user clicked on the frame of the table 938 { // the user clicked on the frame of the table
934 emit(closeMe(0)); 939 emit(closeMe(0));
935 } 940 }
936 pos=4*row+col+1; 941 pos=numCols()*row+col+1;
937 result=pos; 942 result=pos;
938 emit(closeMe(1)); 943 emit(closeMe(1));
939} 944}