Changeset View
Changeset View
Standalone View
Standalone View
src/view/kateviewhelpers.cpp
Show First 20 Lines • Show All 278 Lines • ▼ Show 20 Line(s) | 276 | { | |||
---|---|---|---|---|---|
279 | 279 | | |||
280 | if (e->button() == Qt::MidButton) { | 280 | if (e->button() == Qt::MidButton) { | ||
281 | m_middleMouseDown = true; | 281 | m_middleMouseDown = true; | ||
282 | } else if (e->button() == Qt::LeftButton) { | 282 | } else if (e->button() == Qt::LeftButton) { | ||
283 | m_leftMouseDown = true; | 283 | m_leftMouseDown = true; | ||
284 | } | 284 | } | ||
285 | 285 | | |||
286 | if (m_showMiniMap) { | 286 | if (m_showMiniMap) { | ||
287 | if (m_leftMouseDown) { | 287 | if (m_leftMouseDown && | ||
288 | e->pos().y() > m_mapGroveRect.top() && | ||||
289 | e->pos().y() < m_mapGroveRect.bottom()) | ||||
290 | { | ||||
288 | // if we show the minimap left-click jumps directly to the selected position | 291 | // if we show the minimap left-click jumps directly to the selected position | ||
289 | int newVal = (e->pos().y()-m_mapGroveRect.top()) / (double)m_mapGroveRect.height() * (double)(maximum()+pageStep()) - pageStep()/2; | 292 | int newVal = (e->pos().y()-m_mapGroveRect.top()) / (double)m_mapGroveRect.height() * (double)(maximum()+pageStep()) - pageStep()/2; | ||
290 | newVal = qBound(0, newVal, maximum()); | 293 | newVal = qBound(0, newVal, maximum()); | ||
291 | setSliderPosition(newVal); | 294 | setSliderPosition(newVal); | ||
292 | } | 295 | } | ||
293 | QMouseEvent eMod(QEvent::MouseButtonPress, | 296 | QMouseEvent eMod(QEvent::MouseButtonPress, | ||
294 | QPoint(6, minimapYToStdY(e->pos().y())), | 297 | QPoint(6, minimapYToStdY(e->pos().y())), | ||
295 | e->button(), e->buttons(), e->modifiers()); | 298 | e->button(), e->buttons(), e->modifiers()); | ||
▲ Show 20 Lines • Show All 2800 Lines • Show Last 20 Lines |