Changeset View
Changeset View
Standalone View
Standalone View
src/mergeresultwindow.cpp
Show First 20 Lines • Show All 946 Lines • ▼ Show 20 Line(s) | 946 | if(mlIt == m_currentMergeLineIt) | |||
---|---|---|---|---|---|
947 | break; | 947 | break; | ||
948 | line1 += mlIt->mergeEditLineList.size(); | 948 | line1 += mlIt->mergeEditLineList.size(); | ||
949 | } | 949 | } | ||
950 | 950 | | |||
951 | int nofLines = m_currentMergeLineIt->mergeEditLineList.size(); | 951 | int nofLines = m_currentMergeLineIt->mergeEditLineList.size(); | ||
952 | int newFirstLine = getBestFirstLine(line1, nofLines, m_firstLine, getNofVisibleLines()); | 952 | int newFirstLine = getBestFirstLine(line1, nofLines, m_firstLine, getNofVisibleLines()); | ||
953 | if(newFirstLine != m_firstLine) | 953 | if(newFirstLine != m_firstLine) | ||
954 | { | 954 | { | ||
955 | scroll(0, newFirstLine - m_firstLine); | 955 | emit scrollMergeResultWindow(0, newFirstLine - m_firstLine); | ||
956 | } | 956 | } | ||
957 | 957 | | |||
958 | if(m_selection.isEmpty()) | 958 | if(m_selection.isEmpty()) | ||
959 | { | 959 | { | ||
960 | m_cursorXPos = 0; | 960 | m_cursorXPos = 0; | ||
961 | m_cursorOldXPixelPos = 0; | 961 | m_cursorOldXPixelPos = 0; | ||
962 | m_cursorYPos = line1; | 962 | m_cursorYPos = line1; | ||
963 | } | 963 | } | ||
▲ Show 20 Lines • Show All 649 Lines • ▼ Show 20 Line(s) | 1608 | { | |||
1613 | { | 1613 | { | ||
1614 | update(); | 1614 | update(); | ||
1615 | m_bMyUpdate = false; | 1615 | m_bMyUpdate = false; | ||
1616 | } | 1616 | } | ||
1617 | 1617 | | |||
1618 | if(m_scrollDeltaX != 0 || m_scrollDeltaY != 0) | 1618 | if(m_scrollDeltaX != 0 || m_scrollDeltaY != 0) | ||
1619 | { | 1619 | { | ||
1620 | m_selection.end(m_selection.getLastLine() + m_scrollDeltaY, m_selection.getLastPos() + m_scrollDeltaX); | 1620 | m_selection.end(m_selection.getLastLine() + m_scrollDeltaY, m_selection.getLastPos() + m_scrollDeltaX); | ||
1621 | scroll(m_scrollDeltaX, m_scrollDeltaY); | 1621 | emit scrollMergeResultWindow(m_scrollDeltaX, m_scrollDeltaY); | ||
1622 | killTimer(m_delayedDrawTimer); | 1622 | killTimer(m_delayedDrawTimer); | ||
1623 | m_delayedDrawTimer = startTimer(50); | 1623 | m_delayedDrawTimer = startTimer(50); | ||
1624 | } | 1624 | } | ||
1625 | } | 1625 | } | ||
1626 | 1626 | | |||
1627 | QString MergeResultWindow::MergeEditLine::getString(const MergeResultWindow* mrw) | 1627 | QString MergeResultWindow::MergeEditLine::getString(const MergeResultWindow* mrw) | ||
1628 | { | 1628 | { | ||
1629 | if(isRemoved()) | 1629 | if(isRemoved()) | ||
▲ Show 20 Lines • Show All 579 Lines • ▼ Show 20 Line(s) | 2207 | { | |||
2209 | if(e->x() < fontWidth) deltaX = +1; | 2209 | if(e->x() < fontWidth) deltaX = +1; | ||
2210 | } | 2210 | } | ||
2211 | if(e->y() < topLineYOffset) deltaY = -1; | 2211 | if(e->y() < topLineYOffset) deltaY = -1; | ||
2212 | if(e->y() > height()) deltaY = +1; | 2212 | if(e->y() > height()) deltaY = +1; | ||
2213 | m_scrollDeltaX = deltaX; | 2213 | m_scrollDeltaX = deltaX; | ||
2214 | m_scrollDeltaY = deltaY; | 2214 | m_scrollDeltaY = deltaY; | ||
2215 | if(deltaX != 0 || deltaY != 0) | 2215 | if(deltaX != 0 || deltaY != 0) | ||
2216 | { | 2216 | { | ||
2217 | scroll(deltaX, deltaY); | 2217 | emit scrollMergeResultWindow(deltaX, deltaY); | ||
2218 | } | 2218 | } | ||
2219 | } | 2219 | } | ||
2220 | } | 2220 | } | ||
2221 | 2221 | | |||
2222 | void MergeResultWindow::slotCursorUpdate() | 2222 | void MergeResultWindow::slotCursorUpdate() | ||
2223 | { | 2223 | { | ||
2224 | m_cursorTimer.stop(); | 2224 | m_cursorTimer.stop(); | ||
2225 | m_bCursorOn = !m_bCursorOn; | 2225 | m_bCursorOn = !m_bCursorOn; | ||
Show All 13 Lines | |||||
2239 | 2239 | | |||
2240 | m_cursorTimer.start(500); | 2240 | m_cursorTimer.start(500); | ||
2241 | } | 2241 | } | ||
2242 | 2242 | | |||
2243 | void MergeResultWindow::wheelEvent(QWheelEvent* e) | 2243 | void MergeResultWindow::wheelEvent(QWheelEvent* e) | ||
2244 | { | 2244 | { | ||
2245 | int d = -e->delta() * QApplication::wheelScrollLines() / 120; | 2245 | int d = -e->delta() * QApplication::wheelScrollLines() / 120; | ||
2246 | e->accept(); | 2246 | e->accept(); | ||
2247 | scroll(0, std::min(d, getNofVisibleLines())); | 2247 | emit scrollMergeResultWindow(0, std::min(d, getNofVisibleLines())); | ||
2248 | } | 2248 | } | ||
2249 | 2249 | | |||
2250 | bool MergeResultWindow::event(QEvent* e) | 2250 | bool MergeResultWindow::event(QEvent* e) | ||
2251 | { | 2251 | { | ||
2252 | if(e->type() == QEvent::KeyPress) | 2252 | if(e->type() == QEvent::KeyPress) | ||
2253 | { | 2253 | { | ||
2254 | QKeyEvent* ke = static_cast<QKeyEvent*>(e); | 2254 | QKeyEvent* ke = static_cast<QKeyEvent*>(e); | ||
2255 | if(ke->key() == Qt::Key_Tab) | 2255 | if(ke->key() == Qt::Key_Tab) | ||
▲ Show 20 Lines • Show All 388 Lines • ▼ Show 20 Line(s) | 2643 | if(!bYMoveKey) | |||
2644 | m_cursorOldXPixelPos = m_cursorXPixelPos; | 2644 | m_cursorOldXPixelPos = m_cursorXPixelPos; | ||
2645 | 2645 | | |||
2646 | m_bCursorOn = true; | 2646 | m_bCursorOn = true; | ||
2647 | m_cursorTimer.start(500); | 2647 | m_cursorTimer.start(500); | ||
2648 | 2648 | | |||
2649 | update(); | 2649 | update(); | ||
2650 | if(newFirstLine != m_firstLine || newHorizScrollOffset != m_horizScrollOffset) | 2650 | if(newFirstLine != m_firstLine || newHorizScrollOffset != m_horizScrollOffset) | ||
2651 | { | 2651 | { | ||
2652 | scroll(newHorizScrollOffset - m_horizScrollOffset, newFirstLine - m_firstLine); | 2652 | emit scrollMergeResultWindow(newHorizScrollOffset - m_horizScrollOffset, newFirstLine - m_firstLine); | ||
2653 | return; | 2653 | return; | ||
2654 | } | 2654 | } | ||
2655 | } | 2655 | } | ||
2656 | 2656 | | |||
2657 | void MergeResultWindow::calcIteratorFromLineNr( | 2657 | void MergeResultWindow::calcIteratorFromLineNr( | ||
2658 | int line, | 2658 | int line, | ||
2659 | MergeResultWindow::MergeLineList::iterator& mlIt, | 2659 | MergeResultWindow::MergeLineList::iterator& mlIt, | ||
2660 | MergeResultWindow::MergeEditLineList::iterator& melIt) | 2660 | MergeResultWindow::MergeEditLineList::iterator& melIt) | ||
▲ Show 20 Lines • Show All 949 Lines • Show Last 20 Lines |