From 053c38bb48ae8e7563293bc029f3c9d029b947f7 Mon Sep 17 00:00:00 2001 From: umopapisdn Date: Sun, 13 Apr 2003 22:25:35 +0000 Subject: New Feature: Quick entries now honors the duration selected. --- (limited to 'core/pim') diff --git a/core/pim/datebook/datebookday.cpp b/core/pim/datebook/datebookday.cpp index 0a40ea9..e212807 100644 --- a/core/pim/datebook/datebookday.cpp +++ b/core/pim/datebook/datebookday.cpp @@ -174,12 +174,21 @@ void DateBookDayView::setRowStyle( int style ) void DateBookDayView::contentsMouseReleaseEvent( QMouseEvent *e ) { - int y=e->y(); - int diff=y%(this->rowHeight(0)); - int hour=y/this->rowHeight(0); - quickLineEdit=new DateBookDayViewQuickLineEdit(QDateTime(currDate,QTime(hour,0,0,0)),QDateTime(currDate,QTime(hour,59,0,0)),this->viewport(),"quickedit"); + int sh=99,eh=-1; + + for(int i=0;inumSelections();i++) { + QTableSelection sel = this->selection( i ); + sh = QMIN(sh,sel.topRow()); + eh = QMAX(sh,sel.bottomRow()+1); + } + if (sh > 23 || eh < 1) { + sh=8; + eh=9; + } + + quickLineEdit=new DateBookDayViewQuickLineEdit(QDateTime(currDate,QTime(sh,0,0,0)),QDateTime(currDate,QTime(eh,0,0,0)),this->viewport(),"quickedit"); quickLineEdit->setGeometry(0,0,this->columnWidth(0)-1,this->rowHeight(0)); - this->moveChild(quickLineEdit,0,y-diff); + this->moveChild(quickLineEdit,0,sh*this->rowHeight(0)); quickLineEdit->setFocus(); quickLineEdit->show(); } -- cgit v0.9.0.2