author | umopapisdn <umopapisdn> | 2003-04-13 22:25:35 (UTC) |
---|---|---|
committer | umopapisdn <umopapisdn> | 2003-04-13 22:25:35 (UTC) |
commit | 053c38bb48ae8e7563293bc029f3c9d029b947f7 (patch) (unidiff) | |
tree | 4277c6ba37ceed2233df07bf8ead89b049977f2f | |
parent | 1745c6565e18506d5cb5631ae13cfc5fab060fee (diff) | |
download | opie-053c38bb48ae8e7563293bc029f3c9d029b947f7.zip opie-053c38bb48ae8e7563293bc029f3c9d029b947f7.tar.gz opie-053c38bb48ae8e7563293bc029f3c9d029b947f7.tar.bz2 |
New Feature: Quick entries now honors the duration selected.
-rw-r--r-- | core/pim/datebook/datebookday.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
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 | |||
@@ -175,10 +175,19 @@ void DateBookDayView::setRowStyle( int style ) | |||
175 | void DateBookDayView::contentsMouseReleaseEvent( QMouseEvent *e ) | 175 | void DateBookDayView::contentsMouseReleaseEvent( QMouseEvent *e ) |
176 | { | 176 | { |
177 | int y=e->y(); | 177 | int sh=99,eh=-1; |
178 | int diff=y%(this->rowHeight(0)); | 178 | |
179 | int hour=y/this->rowHeight(0); | 179 | for(int i=0;i<this->numSelections();i++) { |
180 | quickLineEdit=new DateBookDayViewQuickLineEdit(QDateTime(currDate,QTime(hour,0,0,0)),QDateTime(currDate,QTime(hour,59,0,0)),this->viewport(),"quickedit"); | 180 | QTableSelection sel = this->selection( i ); |
181 | sh = QMIN(sh,sel.topRow()); | ||
182 | eh = QMAX(sh,sel.bottomRow()+1); | ||
183 | } | ||
184 | if (sh > 23 || eh < 1) { | ||
185 | sh=8; | ||
186 | eh=9; | ||
187 | } | ||
188 | |||
189 | quickLineEdit=new DateBookDayViewQuickLineEdit(QDateTime(currDate,QTime(sh,0,0,0)),QDateTime(currDate,QTime(eh,0,0,0)),this->viewport(),"quickedit"); | ||
181 | quickLineEdit->setGeometry(0,0,this->columnWidth(0)-1,this->rowHeight(0)); | 190 | quickLineEdit->setGeometry(0,0,this->columnWidth(0)-1,this->rowHeight(0)); |
182 | this->moveChild(quickLineEdit,0,y-diff); | 191 | this->moveChild(quickLineEdit,0,sh*this->rowHeight(0)); |
183 | quickLineEdit->setFocus(); | 192 | quickLineEdit->setFocus(); |
184 | quickLineEdit->show(); | 193 | quickLineEdit->show(); |