mirror of
https://github.com/YACReader/yacreader
synced 2025-05-28 03:10:27 -04:00
GoTo dialogs: Restrict input values to existing pages
This commit is contained in:
parent
54b9952253
commit
df32cf01fb
@ -60,12 +60,10 @@ void GoToDialog::setupUI()
|
||||
void GoToDialog::goTo()
|
||||
{
|
||||
unsigned int page = pageNumber->text().toInt();
|
||||
pageNumber->clear();
|
||||
|
||||
if (page >= 1)
|
||||
if (page >= 1 && page <= v->top()) {
|
||||
emit(goToPage(page - 1));
|
||||
|
||||
close();
|
||||
close();
|
||||
}
|
||||
}
|
||||
|
||||
void GoToDialog::setNumPages(unsigned int numPages)
|
||||
|
@ -109,8 +109,10 @@ void GoToFlowToolBar::setTop(int numPages)
|
||||
|
||||
void GoToFlowToolBar::goTo()
|
||||
{
|
||||
if (edit->text().toInt() != 0)
|
||||
emit(goTo(edit->text().toInt() - 1));
|
||||
unsigned int page = edit->text().toInt();
|
||||
if (page >= 1 && page <= v->top()) {
|
||||
emit(goTo(page - 1));
|
||||
}
|
||||
}
|
||||
|
||||
void GoToFlowToolBar::centerSlide()
|
||||
|
@ -11,7 +11,7 @@
|
||||
GoToFlowWidget::GoToFlowWidget(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
{
|
||||
mainLayout = new QVBoxLayout;
|
||||
mainLayout = new QVBoxLayout(this);
|
||||
mainLayout->setMargin(0);
|
||||
mainLayout->setSpacing(0);
|
||||
|
||||
@ -22,11 +22,7 @@ GoToFlowWidget::GoToFlowWidget(QWidget *parent)
|
||||
//toolBar->installEventFilter(this);
|
||||
}
|
||||
|
||||
GoToFlowWidget::~GoToFlowWidget()
|
||||
{
|
||||
delete toolBar;
|
||||
delete mainLayout;
|
||||
}
|
||||
GoToFlowWidget::~GoToFlowWidget() { }
|
||||
|
||||
void GoToFlowWidget::setPageNumber(int page)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user