X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fqtgui%2Fchatwidget.cpp;h=a437a0d3c7e2ebcc4ecabaebfb7dd0ed707d4b29;hb=8c3b7e4773e9f20ad9ea264cbaafaa52485bdf86;hp=d67eb9efff46090fa2205dc0d275b181925446be;hpb=73edffb5f0f6ecae4118c36a7ca2c0d479b7f8c6;p=quassel.git diff --git a/src/qtgui/chatwidget.cpp b/src/qtgui/chatwidget.cpp index d67eb9ef..a437a0d3 100644 --- a/src/qtgui/chatwidget.cpp +++ b/src/qtgui/chatwidget.cpp @@ -89,14 +89,15 @@ void ChatWidget::adjustScrollBar() { //} } -void ChatWidget::scrollBarValChanged(int val) { - return; +void ChatWidget::scrollBarValChanged(int /*val*/) { + /* if(val >= verticalScrollBar()->maximum()) bottomLine = -1; else { int bot = val + viewport()->height(); int line = yToLineIdx(bot); //bottomLine = line; } + */ } void ChatWidget::scrollBarAction(int action) { @@ -269,7 +270,6 @@ void ChatWidget::paintEvent(QPaintEvent *event) { void ChatWidget::layout() { // TODO fix scrollbars //int botLine = yToLineIdx(verticalScrollBar()->value() + - qreal y = 0; for(int i = 0; i < lines.count(); i++) { qreal h = lines[i]->layout(tsWidth, senderWidth, textWidth); ycoords[i+1] = h + ycoords[i]; @@ -281,7 +281,7 @@ void ChatWidget::layout() { } int ChatWidget::yToLineIdx(qreal y) { - if(y >= ycoords[ycoords.count()-1]) ycoords.count()-1; + if(y >= ycoords[ycoords.count()-1]) return ycoords.count()-2; if(ycoords.count() <= 1) return 0; int uidx = 0; int oidx = ycoords.count() - 1; @@ -314,11 +314,13 @@ void ChatWidget::mousePressEvent(QMouseEvent *event) { } mouseMode = Pressed; break; + default: + break; } } } -void ChatWidget::mouseDoubleClickEvent(QMouseEvent *event) { +void ChatWidget::mouseDoubleClickEvent(QMouseEvent * /*event*/) { @@ -386,7 +388,7 @@ void ChatWidget::handleMouseMoveEvent(const QPoint &_pos) { QPoint pos = _pos + QPoint(0, verticalScrollBar()->value()); int x = pos.x(); int y = pos.y(); - MousePos oldpos = mousePos; + //MousePos oldpos = mousePos; if(x >= tsGrabPos - 3 && x <= tsGrabPos + 3) mousePos = OverTsSep; else if(x >= senderGrabPos - 3 && x <= senderGrabPos + 3) mousePos = OverTextSep; else mousePos = None; @@ -450,6 +452,8 @@ void ChatWidget::handleMouseMoveEvent(const QPoint &_pos) { break; case DragTextSep: break; + default: + break; } // Pass 2: Some mouse modes need work after being set... if(mouseMode == DragTsSep && x < size().width() - Style::sepSenderText() - senderWidth - 10) { @@ -535,8 +539,3 @@ QString ChatWidget::selectionToString() { return lines[selectionLine]->text().mid(selectionStart, selectionEnd - selectionStart); } -/************************************************************************************/ - - -/******************************************************************************************************************/ -