author | zautrix <zautrix> | 2005-03-25 18:26:36 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-25 18:26:36 (UTC) |
commit | 89a72c007045dcfa5dbf57012b4cf0c2aebd1495 (patch) (unidiff) | |
tree | 6accbe5706b724e307d1590152fa2d2c78cdef70 /korganizer/kolistview.cpp | |
parent | 3326831dbf6f962e97a978781361db5198f6a035 (diff) | |
download | kdepimpi-89a72c007045dcfa5dbf57012b4cf0c2aebd1495.zip kdepimpi-89a72c007045dcfa5dbf57012b4cf0c2aebd1495.tar.gz kdepimpi-89a72c007045dcfa5dbf57012b4cf0c2aebd1495.tar.bz2 |
layout fixes
-rw-r--r-- | korganizer/kolistview.cpp | 42 |
1 files changed, 5 insertions, 37 deletions
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp index 3519985..6b63d7f 100644 --- a/korganizer/kolistview.cpp +++ b/korganizer/kolistview.cpp | |||
@@ -299,25 +299,25 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent, | |||
299 | mPopupMenu->insertItem(SmallIcon("delete"), i18n("Delete Event"), this, | 299 | mPopupMenu->insertItem(SmallIcon("delete"), i18n("Delete Event"), this, |
300 | SLOT (deleteEvent())); | 300 | SLOT (deleteEvent())); |
301 | mPopupMenu->insertSeparator(); | 301 | mPopupMenu->insertSeparator(); |
302 | mPopupMenu->insertItem(i18n("Show Dates"), this, | 302 | mPopupMenu->insertItem(i18n("Show Dates"), this, |
303 | SLOT(showDates())); | 303 | SLOT(showDates())); |
304 | mPopupMenu->insertItem(i18n("Hide Dates"), this, | 304 | mPopupMenu->insertItem(i18n("Hide Dates"), this, |
305 | SLOT(hideDates())); | 305 | SLOT(hideDates())); |
306 | */ | 306 | */ |
307 | QObject::connect(mListView,SIGNAL( newEvent()), | 307 | QObject::connect(mListView,SIGNAL( newEvent()), |
308 | this,SIGNAL(signalNewEvent())); | 308 | this,SIGNAL(signalNewEvent())); |
309 | QObject::connect(mListView,SIGNAL(doubleClicked(QListViewItem *)), | 309 | QObject::connect(mListView,SIGNAL(doubleClicked(QListViewItem *)), |
310 | this,SLOT(defaultItemAction(QListViewItem *))); | 310 | this,SLOT(defaultItemAction(QListViewItem *))); |
311 | QObject::connect(mListView,SIGNAL(rightButtonClicked ( QListViewItem *, | 311 | QObject::connect(mListView,SIGNAL(rightButtonPressed( QListViewItem *, |
312 | const QPoint &, int )), | 312 | const QPoint &, int )), |
313 | this,SLOT(popupMenu(QListViewItem *,const QPoint &,int))); | 313 | this,SLOT(popupMenu(QListViewItem *,const QPoint &,int))); |
314 | QObject::connect(mListView,SIGNAL(currentChanged(QListViewItem *)), | 314 | QObject::connect(mListView,SIGNAL(currentChanged(QListViewItem *)), |
315 | SLOT(processSelectionChange(QListViewItem *))); | 315 | SLOT(processSelectionChange(QListViewItem *))); |
316 | QObject::connect(mListView,SIGNAL(showIncidence(Incidence *)), | 316 | QObject::connect(mListView,SIGNAL(showIncidence(Incidence *)), |
317 | SIGNAL(showIncidenceSignal(Incidence *)) ); | 317 | SIGNAL(showIncidenceSignal(Incidence *)) ); |
318 | 318 | ||
319 | readSettings(KOGlobals::config(),"KOListView Layout"); | 319 | readSettings(KOGlobals::config(),"KOListView Layout"); |
320 | } | 320 | } |
321 | 321 | ||
322 | KOListView::~KOListView() | 322 | KOListView::~KOListView() |
323 | { | 323 | { |
@@ -1150,78 +1150,46 @@ void KOListViewListView::keyPressEvent ( QKeyEvent *e) | |||
1150 | } | 1150 | } |
1151 | break; | 1151 | break; |
1152 | default: | 1152 | default: |
1153 | e->ignore(); | 1153 | e->ignore(); |
1154 | } | 1154 | } |
1155 | } | 1155 | } |
1156 | KOListViewListView::KOListViewListView(KOListView * lv ) | 1156 | KOListViewListView::KOListViewListView(KOListView * lv ) |
1157 | : KListView( lv ) | 1157 | : KListView( lv ) |
1158 | { | 1158 | { |
1159 | #ifndef DESKTOP_VERSION | 1159 | #ifndef DESKTOP_VERSION |
1160 | QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold ); | 1160 | QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold ); |
1161 | #endif | 1161 | #endif |
1162 | mYMousePos = -1000; | ||
1163 | setSelectionMode( QListView::Multi ); | 1162 | setSelectionMode( QListView::Multi ); |
1164 | setMultiSelection( true); | 1163 | setMultiSelection( true); |
1165 | mAllowPopupMenu = true; | ||
1166 | mMouseDown = false; | ||
1167 | |||
1168 | } | 1164 | } |
1169 | void KOListViewListView::contentsMouseDoubleClickEvent(QMouseEvent *e) | 1165 | void KOListViewListView::contentsMouseDoubleClickEvent(QMouseEvent *e) |
1170 | { | 1166 | { |
1171 | if (!e) return; | 1167 | if (!e) return; |
1172 | QPoint vp = contentsToViewport(e->pos()); | 1168 | QPoint vp = contentsToViewport(e->pos()); |
1173 | QListViewItem *item = itemAt(vp); | 1169 | QListViewItem *item = itemAt(vp); |
1174 | if (!item) { | 1170 | if (!item) { |
1175 | emit newEvent(); | 1171 | emit newEvent(); |
1176 | return; | 1172 | return; |
1177 | } | 1173 | } |
1178 | KListView::contentsMouseDoubleClickEvent(e); | 1174 | KListView::contentsMouseDoubleClickEvent(e); |
1179 | } | 1175 | } |
1180 | 1176 | ||
1181 | |||
1182 | void KOListViewListView::contentsMousePressEvent(QMouseEvent *e) | 1177 | void KOListViewListView::contentsMousePressEvent(QMouseEvent *e) |
1183 | { | 1178 | { |
1184 | //qDebug("contentsMousePressEvent++++ "); | 1179 | //qDebug("contentsMousePressEvent++++ "); |
1185 | if (! mMouseDown ) { | ||
1186 | mAllowPopupMenu = true; | ||
1187 | mYMousePos = mapToGlobal( (e->pos())).y(); | ||
1188 | } | ||
1189 | if ( e->button() == RightButton && mMouseDown ) | ||
1190 | return; | ||
1191 | if ( e->button() == LeftButton ) | ||
1192 | mMouseDown = true; | ||
1193 | KListView::contentsMousePressEvent( e ); | 1180 | KListView::contentsMousePressEvent( e ); |
1194 | } | ||
1195 | void KOListViewListView::contentsMouseReleaseEvent(QMouseEvent *e) | ||
1196 | { | ||
1197 | //qDebug("contentsMouseReleaseEv---- "); | ||
1198 | if ( ! mMouseDown ) { | ||
1199 | if ( e->button() == RightButton && ! mAllowPopupMenu ) | ||
1200 | return; | ||
1201 | QListViewItem* ci = currentItem(); | ||
1202 | if ( ci ) | ||
1203 | ci->setSelected( true ); | ||
1204 | KListView::contentsMouseReleaseEvent(e); | ||
1205 | return; | ||
1206 | } | ||
1207 | if ( e->button() == LeftButton ) | ||
1208 | mMouseDown = false; | ||
1209 | if ( e->button() == RightButton && ! mAllowPopupMenu ) | ||
1210 | return; | ||
1211 | if ( e->button() == RightButton ) { | 1181 | if ( e->button() == RightButton ) { |
1212 | QListViewItem* ci = currentItem(); | 1182 | QListViewItem* ci = currentItem(); |
1183 | clearSelection () ; | ||
1213 | if ( ci ) | 1184 | if ( ci ) |
1214 | ci->setSelected( true ); | 1185 | ci->setSelected( true ); |
1215 | } | 1186 | } |
1187 | } | ||
1188 | void KOListViewListView::contentsMouseReleaseEvent(QMouseEvent *e) | ||
1189 | { | ||
1216 | KListView::contentsMouseReleaseEvent(e); | 1190 | KListView::contentsMouseReleaseEvent(e); |
1217 | } | 1191 | } |
1218 | void KOListViewListView::contentsMouseMoveEvent(QMouseEvent *e) | 1192 | void KOListViewListView::contentsMouseMoveEvent(QMouseEvent *e) |
1219 | { | 1193 | { |
1220 | // qDebug("contentsMouseMoveEv....... "); | ||
1221 | // qDebug("start: %d current %d ",mYMousePos , mapToGlobal( (e->pos())).y() ); | ||
1222 | int diff = mYMousePos - mapToGlobal( (e->pos())).y(); | ||
1223 | if ( diff < 0 ) diff = -diff; | ||
1224 | if ( diff > 20 ) | ||
1225 | mAllowPopupMenu = false; | ||
1226 | KListView::contentsMouseMoveEvent(e); | 1194 | KListView::contentsMouseMoveEvent(e); |
1227 | } | 1195 | } |