summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-11-30 07:17:43 (UTC)
committer zautrix <zautrix>2005-11-30 07:17:43 (UTC)
commit14bd7cc7412ffdbca09e1cd63a230222a3fbfd53 (patch) (unidiff)
tree9255ef94ff9bdf2429f19e68c6ab5273878afdf5 /korganizer
parent29c3ed5181b8a33aac73eec90956819b71641048 (diff)
downloadkdepimpi-14bd7cc7412ffdbca09e1cd63a230222a3fbfd53.zip
kdepimpi-14bd7cc7412ffdbca09e1cd63a230222a3fbfd53.tar.gz
kdepimpi-14bd7cc7412ffdbca09e1cd63a230222a3fbfd53.tar.bz2
agenda fix
Diffstat (limited to 'korganizer') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/koagenda.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp
index d9d1283..1d4d6de 100644
--- a/korganizer/koagenda.cpp
+++ b/korganizer/koagenda.cpp
@@ -798,115 +798,115 @@ void KOAgenda::performSelectAction(QPoint viewportPos)
798 mSelectionHeight = ( gy + 1 ) * mGridSpacingY - mSelectionYTop; 798 mSelectionHeight = ( gy + 1 ) * mGridSpacingY - mSelectionYTop;
799 799
800 800
801 repaintContents( (KOGlobals::self()->reverseLayout() ? 801 repaintContents( (KOGlobals::self()->reverseLayout() ?
802 mColumns - 1 - mSelectionCellX : mSelectionCellX) * 802 mColumns - 1 - mSelectionCellX : mSelectionCellX) *
803 mGridSpacingX, mSelectionYTop, 803 mGridSpacingX, mSelectionYTop,
804 mGridSpacingX, mSelectionHeight , false); 804 mGridSpacingX, mSelectionHeight , false);
805 805
806 mCurrentCellY = gy; 806 mCurrentCellY = gy;
807 } else if ( gy < mCurrentCellY ) { 807 } else if ( gy < mCurrentCellY ) {
808 if ( gy >= mStartCellY ) { 808 if ( gy >= mStartCellY ) {
809 int selectionHeight = mSelectionHeight; 809 int selectionHeight = mSelectionHeight;
810 mSelectionHeight = ( gy + 1 ) * mGridSpacingY - mSelectionYTop; 810 mSelectionHeight = ( gy + 1 ) * mGridSpacingY - mSelectionYTop;
811 811
812 repaintContents( (KOGlobals::self()->reverseLayout() ? 812 repaintContents( (KOGlobals::self()->reverseLayout() ?
813 mColumns - 1 - mSelectionCellX : mSelectionCellX) * 813 mColumns - 1 - mSelectionCellX : mSelectionCellX) *
814 mGridSpacingX, mSelectionYTop, 814 mGridSpacingX, mSelectionYTop,
815 mGridSpacingX, selectionHeight,false ); 815 mGridSpacingX, selectionHeight,false );
816 816
817 mCurrentCellY = gy; 817 mCurrentCellY = gy;
818 } else { 818 } else {
819 } 819 }
820 } 820 }
821} 821}
822 822
823void KOAgenda::endSelectAction( bool emitNewEvent ) 823void KOAgenda::endSelectAction( bool emitNewEvent )
824{ 824{
825 mActionType = NOP; 825 mActionType = NOP;
826 mScrollUpTimer.stop(); 826 mScrollUpTimer.stop();
827 mScrollDownTimer.stop(); 827 mScrollDownTimer.stop();
828 828
829 emit newTimeSpanSignal(mStartCellX,mStartCellY,mCurrentCellX,mCurrentCellY); 829 emit newTimeSpanSignal(mStartCellX,mStartCellY,mCurrentCellX,mCurrentCellY);
830 if ( emitNewEvent && mStartCellY < mCurrentCellY ) { 830 if ( emitNewEvent && mStartCellY < mCurrentCellY ) {
831 emit newEventSignal(mStartCellX,mStartCellY,mCurrentCellX,mCurrentCellY); 831 emit newEventSignal(mStartCellX,mStartCellY,mCurrentCellX,mCurrentCellY);
832 } 832 }
833} 833}
834 834
835void KOAgenda::startItemAction(QPoint viewportPos) 835void KOAgenda::startItemAction(QPoint viewportPos)
836{ 836{
837 int x,y; 837 int x,y;
838 viewportToContents(viewportPos.x(),viewportPos.y(),x,y); 838 viewportToContents(viewportPos.x(),viewportPos.y(),x,y);
839 int gx,gy; 839 int gx,gy;
840 contentsToGrid(x,y,gx,gy); 840 contentsToGrid(x,y,gx,gy);
841 841
842 mStartCellX = gx; 842 mStartCellX = gx;
843 mStartCellY = gy; 843 mStartCellY = gy;
844 mCurrentCellX = gx; 844 mCurrentCellX = gx;
845 mCurrentCellY = gy; 845 mCurrentCellY = gy;
846 bool allowResize = ( mActionItem->incidence()->typeID() != todoID );
846 847
847 if (mAllDayMode) { 848 if (mAllDayMode) {
848 int gridDistanceX = (x - gx * mGridSpacingX); 849 int gridDistanceX = (x - gx * mGridSpacingX);
849 if (gridDistanceX < mResizeBorderWidth && 850 if ( allowResize && gridDistanceX < mResizeBorderWidth &&
850 mActionItem->cellX() == mCurrentCellX) { 851 mActionItem->cellX() == mCurrentCellX) {
851 mActionType = RESIZELEFT; 852 mActionType = RESIZELEFT;
852 setCursor(sizeHorCursor); 853 setCursor(sizeHorCursor);
853 } else if ((mGridSpacingX - gridDistanceX) < mResizeBorderWidth && 854 } else if ( allowResize && (mGridSpacingX - gridDistanceX) < mResizeBorderWidth &&
854 mActionItem->cellXWidth() == mCurrentCellX) { 855 mActionItem->cellXWidth() == mCurrentCellX) {
855 mActionType = RESIZERIGHT; 856 mActionType = RESIZERIGHT;
856 setCursor(sizeHorCursor); 857 setCursor(sizeHorCursor);
857 } else { 858 } else {
858 mActionType = MOVE; 859 mActionType = MOVE;
859 mActionItem->startMove(); 860 mActionItem->startMove();
860 setCursor(sizeAllCursor); 861 setCursor(sizeAllCursor);
861 } 862 }
862 } else { 863 } else {
863 int gridDistanceY = (y - gy * mGridSpacingY); 864 int gridDistanceY = (y - gy * mGridSpacingY);
864 bool allowResize = ( mActionItem->incidence()->typeID() != todoID );
865 if (allowResize && gridDistanceY < mResizeBorderWidth && 865 if (allowResize && gridDistanceY < mResizeBorderWidth &&
866 mActionItem->cellYTop() == mCurrentCellY && 866 mActionItem->cellYTop() == mCurrentCellY &&
867 !mActionItem->firstMultiItem()) { 867 !mActionItem->firstMultiItem()) {
868 mActionType = RESIZETOP; 868 mActionType = RESIZETOP;
869 setCursor(sizeVerCursor); 869 setCursor(sizeVerCursor);
870 } else if (allowResize &&(mGridSpacingY - gridDistanceY) < mResizeBorderWidth && 870 } else if (allowResize &&(mGridSpacingY - gridDistanceY) < mResizeBorderWidth &&
871 mActionItem->cellYBottom() == mCurrentCellY && 871 mActionItem->cellYBottom() == mCurrentCellY &&
872 !mActionItem->lastMultiItem()) { 872 !mActionItem->lastMultiItem()) {
873 mActionType = RESIZEBOTTOM; 873 mActionType = RESIZEBOTTOM;
874 setCursor(sizeVerCursor); 874 setCursor(sizeVerCursor);
875 } else { 875 } else {
876 mActionType = MOVE; 876 mActionType = MOVE;
877 mActionItem->startMove(); 877 mActionItem->startMove();
878 setCursor(sizeAllCursor); 878 setCursor(sizeAllCursor);
879 } 879 }
880 } 880 }
881} 881}
882 882
883void KOAgenda::performItemAction(QPoint viewportPos) 883void KOAgenda::performItemAction(QPoint viewportPos)
884{ 884{
885// kdDebug() << "viewportPos: " << viewportPos.x() << "," << viewportPos.y() << endl; 885// kdDebug() << "viewportPos: " << viewportPos.x() << "," << viewportPos.y() << endl;
886// QPoint point = viewport()->mapToGlobal(viewportPos); 886// QPoint point = viewport()->mapToGlobal(viewportPos);
887// kdDebug() << "Global: " << point.x() << "," << point.y() << endl; 887// kdDebug() << "Global: " << point.x() << "," << point.y() << endl;
888// point = clipper()->mapFromGlobal(point); 888// point = clipper()->mapFromGlobal(point);
889// kdDebug() << "clipper: " << point.x() << "," << point.y() << endl; 889// kdDebug() << "clipper: " << point.x() << "," << point.y() << endl;
890// kdDebug() << "visible height: " << visibleHeight() << endl; 890// kdDebug() << "visible height: " << visibleHeight() << endl;
891 int x,y; 891 int x,y;
892 viewportToContents(viewportPos.x(),viewportPos.y(),x,y); 892 viewportToContents(viewportPos.x(),viewportPos.y(),x,y);
893// kdDebug() << "contents: " << x << "," << y << "\n" << endl; 893// kdDebug() << "contents: " << x << "," << y << "\n" << endl;
894 int gx,gy; 894 int gx,gy;
895 contentsToGrid(x,y,gx,gy); 895 contentsToGrid(x,y,gx,gy);
896 QPoint clipperPos = clipper()-> 896 QPoint clipperPos = clipper()->
897 mapFromGlobal(viewport()->mapToGlobal(viewportPos)); 897 mapFromGlobal(viewport()->mapToGlobal(viewportPos));
898 898
899 // Cursor left active agenda area. 899 // Cursor left active agenda area.
900 // This starts a drag. 900 // This starts a drag.
901 if ( /*clipperPos.y() < 0 || clipperPos.y() > visibleHeight() ||*/ 901 if ( /*clipperPos.y() < 0 || clipperPos.y() > visibleHeight() ||*/
902 clipperPos.x() < 0 || clipperPos.x() > visibleWidth() ) { 902 clipperPos.x() < 0 || clipperPos.x() > visibleWidth() ) {
903 if ( mActionType == MOVE ) { 903 if ( mActionType == MOVE ) {
904 mScrollUpTimer.stop(); 904 mScrollUpTimer.stop();
905 mScrollDownTimer.stop(); 905 mScrollDownTimer.stop();
906 mActionItem->resetMove(); 906 mActionItem->resetMove();
907 placeSubCells( mActionItem ); 907 placeSubCells( mActionItem );
908 // emit startDragSignal( mActionItem->incidence() ); 908 // emit startDragSignal( mActionItem->incidence() );
909 setCursor( arrowCursor ); 909 setCursor( arrowCursor );
910 mActionItem = 0; 910 mActionItem = 0;
911 mActionType = NOP; 911 mActionType = NOP;
912 mItemMoved = 0; 912 mItemMoved = 0;