Project

General

Profile

pgstep.diff

epostavs, 09/19/2018 11:41 PM

View differences:

src/qtui/chatview.cpp
208 208
}
209 209

  
210 210

  
211
void ChatView::setPageStep()
212
{
213
	auto line = _scene->chatItemAt(QPointF(0, 0));
214
	if (line) {
215
		qreal line_height = line->height();
216
		int viewport_height = viewport()->size().height();
217
		int context = 2;
218

  
219
		verticalScrollBar()->setPageStep(viewport_height - context * line_height);
220
	}
221
}
222

  
223

  
211 224
void ChatView::mouseMoveWhileSelecting(const QPointF &scenePos)
212 225
{
213 226
    int y = (int)mapFromScene(scenePos).y();
......
394 407
    _currentScaleFactor *= 1.2;
395 408
    scale(1.2, 1.2);
396 409
    scene()->setWidth(viewport()->width() / _currentScaleFactor - 2);
410

  
411
	setPageStep();
397 412
}
398 413

  
399 414

  
......
402 417
    _currentScaleFactor /= 1.2;
403 418
    scale(1 / 1.2, 1 / 1.2);
404 419
    scene()->setWidth(viewport()->width() / _currentScaleFactor - 2);
420

  
421
	setPageStep();
405 422
}
406 423

  
407 424

  
......
410 427
    scale(1/_currentScaleFactor, 1/_currentScaleFactor);
411 428
    _currentScaleFactor = 1;
412 429
    scene()->setWidth(viewport()->width() - 2);
430

  
431
	setPageStep();
413 432
}
414 433

  
415 434

  
src/qtui/chatview.h
96 96

  
97 97
protected slots:
98 98
    virtual void verticalScrollbarChanged(int);
99
	void setPageStep();
99 100

  
100 101
private slots:
101 102
    void lastLineChanged(QGraphicsItem *chatLine, qreal offset);