summaryrefslogtreecommitdiffabout
path: root/korganizer/kotodoview.cpp
Unidiff
Diffstat (limited to 'korganizer/kotodoview.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/kotodoview.cpp35
1 files changed, 27 insertions, 8 deletions
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index ccc4b01..0a315cb 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -209,6 +209,6 @@ void KOTodoListView::contentsMousePressEvent(QMouseEvent* e)
209{ 209{
210#ifndef KORG_NODND 210
211 QPoint p(contentsToViewport(e->pos())); 211 QPoint p(contentsToViewport(e->pos()));
212 QListViewItem *i = itemAt(p); 212 QListViewItem *i = itemAt(p);
213 mMousePressed = false; 213 bool rootClicked = true;
214 if (i) { 214 if (i) {
@@ -216,14 +216,25 @@ void KOTodoListView::contentsMousePressEvent(QMouseEvent* e)
216 // try to start a drag! 216 // try to start a drag!
217 if (p.x() > header()->sectionPos(header()->mapToIndex(0)) + 217 int X = p.x();
218 //qDebug("%d %d %d", X, header()->sectionPos(0), treeStepSize() );
219 if (X > header()->sectionPos(0) +
218 treeStepSize() * (i->depth() + (rootIsDecorated() ? 1 : 0)) + 220 treeStepSize() * (i->depth() + (rootIsDecorated() ? 1 : 0)) +
219 itemMargin() || 221 itemMargin() ||
220 p.x() < header()->sectionPos(header()->mapToIndex(0))) { 222 X < header()->sectionPos(0)) {
221 if (e->button()==Qt::LeftButton) { 223 rootClicked = false;
222 mPressPos = e->pos();
223 mMousePressed = true;
224 } 224 }
225 } 225 }
226#ifndef KORG_NODND
227 mMousePressed = false;
228 if (! rootClicked ) {
229 mPressPos = e->pos();
230 mMousePressed = true;
226 } 231 }
227#endif 232#endif
233 //qDebug("KOTodoListView::contentsMousePressEvent %d", rootClicked);
234#ifndef DESKTOP_VERSION
235 if (!( e->button() == RightButton && rootClicked) )
236 QListView::contentsMousePressEvent(e);
237#else
228 QListView::contentsMousePressEvent(e); 238 QListView::contentsMousePressEvent(e);
239#endif
229} 240}
@@ -1065,2 +1076,4 @@ void KOTodoView::itemDoubleClicked(QListViewItem *item)
1065 pendingSubtodo = 0; 1076 pendingSubtodo = 0;
1077 int row = mTodoListView->header()->sectionAt ( mTodoListView->header()->mapFromGlobal( QCursor::pos()).x() );
1078 //qDebug("ROW %d ", row);
1066 if (!item) { 1079 if (!item) {
@@ -1068,2 +1081,8 @@ void KOTodoView::itemDoubleClicked(QListViewItem *item)
1068 return; 1081 return;
1082 } else {
1083 if ( row == 1 ) {
1084 mActiveItem = (KOTodoViewItem *) item;
1085 newSubTodo();
1086 return;
1087 }
1069 } 1088 }
@@ -1076,3 +1095,3 @@ void KOTodoView::itemClicked(QListViewItem *item)
1076{ 1095{
1077 1096 //qDebug("KOTodoView::itemClicked %d", item);
1078 if (!item) { 1097 if (!item) {