summaryrefslogtreecommitdiffabout
path: root/microkde
authorzautrix <zautrix>2005-04-30 07:32:03 (UTC)
committer zautrix <zautrix>2005-04-30 07:32:03 (UTC)
commit7c31102a00920834ab8e3778f0f459b96b2fb309 (patch) (unidiff)
tree9f238caaaab4ba150e4f14708d85162af0ea5092 /microkde
parentbdaded2da25b0ccef80d6e638fa12f92a4f8744d (diff)
downloadkdepimpi-7c31102a00920834ab8e3778f0f459b96b2fb309.zip
kdepimpi-7c31102a00920834ab8e3778f0f459b96b2fb309.tar.gz
kdepimpi-7c31102a00920834ab8e3778f0f459b96b2fb309.tar.bz2
fixes
Diffstat (limited to 'microkde') (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
@@ -783,14 +783,19 @@ KDateInternalWeekPicker::KDateInternalWeekPicker
783 add += 6; 783 add += 6;
784 font.setPointSize(fontsize+add); 784 font.setPointSize(fontsize+add);
785 setFont(font); 785 setFont(font);
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
794 viewport()->setEraseColor(lightGray); // for consistency with the datepicker 799 viewport()->setEraseColor(lightGray); // for consistency with the datepicker
795#endif 800#endif
796 // ----- find the preferred size 801 // ----- find the preferred size
@@ -828,23 +833,23 @@ KDateInternalWeekPicker::setupPainter(QPainter *p)
828 p->setPen(black); 833 p->setPen(black);
829} 834}
830 835
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
839KDateInternalWeekPicker::paintCell(QPainter* painter, int row, int col) 844KDateInternalWeekPicker::paintCell(QPainter* painter, int row, int col)
840{ 845{
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 )
848 painter->drawRect( 0, 0, cellWidth(), cellHeight() ); 853 painter->drawRect( 0, 0, cellWidth(), cellHeight() );
849} 854}
850 855
@@ -930,10 +935,10 @@ KDateInternalWeekPicker::contentsMouseReleaseEvent(QMouseEvent *e)
930 row=rowAt(mouseCoord.y()); 935 row=rowAt(mouseCoord.y());
931 col=columnAt(mouseCoord.x()); 936 col=columnAt(mouseCoord.x());
932 if(row<0 || col<0) 937 if(row<0 || col<0)
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}