author | zautrix <zautrix> | 2005-03-20 19:18:26 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-20 19:18:26 (UTC) |
commit | d998afaaf0fe1af0b9b5e3d6f4cb504e35e35025 (patch) (unidiff) | |
tree | 075ab57af7f72bba7c25458026c6781db8fa7b53 | |
parent | a9e08041c8978d52cfcabc84f579784af45eb8d9 (diff) | |
download | kdepimpi-d998afaaf0fe1af0b9b5e3d6f4cb504e35e35025.zip kdepimpi-d998afaaf0fe1af0b9b5e3d6f4cb504e35e35025.tar.gz kdepimpi-d998afaaf0fe1af0b9b5e3d6f4cb504e35e35025.tar.bz2 |
layout fix
-rw-r--r-- | korganizer/kodaymatrix.cpp | 42 |
1 files changed, 32 insertions, 10 deletions
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp index 15a1cb4..507f18e 100644 --- a/korganizer/kodaymatrix.cpp +++ b/korganizer/kodaymatrix.cpp | |||
@@ -640,7 +640,7 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent) | |||
640 | int xyOff = frameWidth(); | 640 | int xyOff = frameWidth(); |
641 | int colModulo = sz.width() % 7; | 641 | int colModulo = sz.width() % 7; |
642 | int rowModulo = sz.height() % 6; | 642 | int rowModulo = sz.height() % 6; |
643 | qDebug("off %d col %d row %d ",xyOff,colModulo,rowModulo ); | 643 | //qDebug("off %d col %d row %d ",xyOff,colModulo,rowModulo ); |
644 | 644 | ||
645 | bool isRTL = KOGlobals::self()->reverseLayout(); | 645 | bool isRTL = KOGlobals::self()->reverseLayout(); |
646 | 646 | ||
@@ -681,6 +681,8 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent) | |||
681 | 681 | ||
682 | int addCol = 0; | 682 | int addCol = 0; |
683 | int addRow = 0; | 683 | int addRow = 0; |
684 | int addRow2 = 0; | ||
685 | int addCol2 = 0; | ||
684 | #if 0 | 686 | #if 0 |
685 | if ( colModulo ) { | 687 | if ( colModulo ) { |
686 | if ( col >= 7 - colModulo ) | 688 | if ( col >= 7 - colModulo ) |
@@ -702,24 +704,44 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent) | |||
702 | addRow = row - 5 + rowModulo; | 704 | addRow = row - 5 + rowModulo; |
703 | } | 705 | } |
704 | if ( colModulo ) { | 706 | if ( colModulo ) { |
705 | if ( mSelEndT-mSelStartT+1 >= 7 - colModulo ) | 707 | int colt1 = mSelEndT%7; |
706 | addCol = mSelEndT-mSelStartT+1 - 7 + colModulo; | 708 | //qDebug("colt1 %d ", colt1 ); |
709 | if ( colt1 >= 7 - colModulo ) | ||
710 | addCol = colt1 - 7 + colModulo+1; | ||
711 | int colt = mSelStartT%7; | ||
712 | if ( colt >= 7 - colModulo ) | ||
713 | addCol2 = colt - 7 + colModulo; | ||
714 | addCol -= addCol2; | ||
715 | //qDebug("COL %d %d %d %d ",col , colt1 ,addCol ,addCol2 ); | ||
707 | } | 716 | } |
708 | // Single row selection | 717 | // Single row selection |
709 | if ( row == 0) | 718 | if ( row == 0) |
710 | addRow = 1; | 719 | addRow = 1; |
711 | p.fillRect(isRTL ? (7 - (mSelEndT-mSelStartT+1) - col)*dwidth : col*dwidth+1, | 720 | p.fillRect(isRTL ? (7 - (mSelEndT-mSelStartT+1) - col)*dwidth : col*dwidth+1+addCol2, |
712 | row*dheight+addRow, (mSelEndT-mSelStartT+1)*dwidth+addCol, dheight+1, selcol); | 721 | row*dheight+addRow, (mSelEndT-mSelStartT+1)*dwidth+addCol, dheight+1, selcol); |
713 | } else { | 722 | } else { |
714 | // draw first row to the right | 723 | // draw first row to the right |
724 | if ( colModulo ) { | ||
725 | if ( col >= 7 - colModulo ) | ||
726 | addCol2 = col - 7 + colModulo; | ||
727 | } | ||
728 | if ( rowModulo ) { | ||
729 | if ( row >= 6 - rowModulo ) | ||
730 | addRow = row - 5 + rowModulo; | ||
731 | } | ||
715 | if ( row == 0) | 732 | if ( row == 0) |
716 | addRow = 1; | 733 | addRow = 1; |
717 | p.fillRect(isRTL ? 0 : col*dwidth+1, row*dheight+addRow, (7-col)*dwidth+colModulo, | 734 | p.fillRect(isRTL ? 0 : col*dwidth+1+addCol2, row*dheight+addRow, (7-col)*dwidth+colModulo, |
718 | dheight, selcol); | 735 | dheight+1, selcol); |
719 | // draw full block till last line | 736 | // draw full block till last line |
720 | selh = mSelEndT/7-row; | 737 | selh = mSelEndT/7-row; |
738 | addRow = 0; | ||
739 | if ( rowModulo ) { | ||
740 | if ( mSelEndT/7 >= 6 - rowModulo ) | ||
741 | addRow = mSelEndT/7 - 5 + rowModulo; | ||
742 | } | ||
721 | if (selh > 1) { | 743 | if (selh > 1) { |
722 | p.fillRect(1, (row+1)*dheight, 7*dwidth+colModulo, (selh-1)*dheight,selcol); | 744 | p.fillRect(1, (row+1)*dheight, 7*dwidth+colModulo, (selh-1)*dheight+addRow,selcol); |
723 | } | 745 | } |
724 | // draw last block from left to mSelEndT | 746 | // draw last block from left to mSelEndT |
725 | selw = mSelEndT-7*(mSelEndT/7)+1; | 747 | selw = mSelEndT-7*(mSelEndT/7)+1; |
@@ -733,8 +755,8 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent) | |||
733 | add = 0; | 755 | add = 0; |
734 | } | 756 | } |
735 | //qDebug("add %d ", add); | 757 | //qDebug("add %d ", add); |
736 | p.fillRect(isRTL ? (7-selw)*dwidth : 1, (row+selh)*dheight, | 758 | p.fillRect(isRTL ? (7-selw)*dwidth : 1, (row+selh)*dheight+addRow, |
737 | selw*dwidth+add, dheight, selcol); | 759 | selw*dwidth+add, dheight+1, selcol); |
738 | } | 760 | } |
739 | } | 761 | } |
740 | } | 762 | } |
@@ -827,7 +849,7 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent) | |||
827 | addRow = row - 5 + rowModulo; | 849 | addRow = row - 5 + rowModulo; |
828 | } | 850 | } |
829 | //qDebug("add %d %d -- %d %d ", col, addCol, row, addRow); | 851 | //qDebug("add %d %d -- %d %d ", col, addCol, row, addRow); |
830 | ++addCol;++addCol; | 852 | ++addCol;//++addCol; |
831 | p.drawText(col*dwidth+addCol, row*dheight+addRow, dwidth, dheight, | 853 | p.drawText(col*dwidth+addCol, row*dheight+addRow, dwidth, dheight, |
832 | Qt::AlignHCenter | Qt::AlignVCenter, daylbls[i]); | 854 | Qt::AlignHCenter | Qt::AlignVCenter, daylbls[i]); |
833 | 855 | ||