Merge branch 'develop' into clazy_autorefactoring

This commit is contained in:
Luis Ángel San Martín
2021-09-26 08:52:23 +02:00
committed by GitHub
10 changed files with 44 additions and 22 deletions

View File

@ -32,7 +32,8 @@ GoToFlowToolBar::GoToFlowToolBar(QWidget *parent)
" border-radius: 1px;"
"}");
connect(slider, &QSlider::valueChanged, this, [this](int v) { emit(setCenter(v)); });
connect(slider, &QSlider::valueChanged, this, [&](int v) { emit(setCenter(v)); });
connect(slider, &QSlider::valueChanged, this, [=](int v) { emit(setPage(v)); });
pageHint = new QLabel("<b>" + tr("Page : ") + "</b>", this);
v = new QIntValidator(this);
@ -109,8 +110,10 @@ void GoToFlowToolBar::setTop(int numPages)
void GoToFlowToolBar::goTo()
{
if (edit->text().toInt() != 0)
emit(goToPage(edit->text().toInt() - 1));
unsigned int page = edit->text().toInt();
if (page >= 1 && page <= v->top()) {
emit(goTo(page - 1));
}
}
void GoToFlowToolBar::centerSlide()