/***
   This file is part of fly-ocr.

   Copyright (C) 2021 LLC "RusBITech-Astra" (https://astralinux.ru)

   Foobar is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation, either version 3 of the License, or
   (at your option) any later version.

   Foobar is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with fly-ocr. If not, see <https://www.gnu.org/licenses/>.
***/

#include <QtDebug>
#include "pagespinbox.h"

PageSpinBox::PageSpinBox(QWidget* parent) : QSpinBox(parent)
{

}

void PageSpinBox::stepBy(int steps)
{
    QSpinBox::stepBy(-steps);
}

QAbstractSpinBox::StepEnabled PageSpinBox::stepEnabled() const
{
    if (value() == minimum())
        return StepDownEnabled;
    else if (value() == maximum())
        return StepUpEnabled;
    else
        return StepDownEnabled | StepUpEnabled;
}
