mirror of
https://github.com/YACReader/yacreader
synced 2026-03-26 07:29:48 -04:00
Merge branch 'develop' into clazy_autorefactoring
This commit is contained in:
@ -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)
|
||||
|
||||
@ -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()
|
||||
|
||||
@ -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)
|
||||
{
|
||||
|
||||
@ -89,6 +89,13 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
qInstallMessageHandler(messageHandler);
|
||||
|
||||
static const char ENV_VAR_QT_DEVICE_PIXEL_RATIO[] = "QT_DEVICE_PIXEL_RATIO";
|
||||
if (!qEnvironmentVariableIsSet(ENV_VAR_QT_DEVICE_PIXEL_RATIO) && !qEnvironmentVariableIsSet("QT_AUTO_SCREEN_SCALE_FACTOR") && !qEnvironmentVariableIsSet("QT_SCALE_FACTOR") && !qEnvironmentVariableIsSet("QT_SCREEN_SCALE_FACTORS")) {
|
||||
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
||||
}
|
||||
|
||||
QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
|
||||
|
||||
#if defined(_MSC_VER) && defined(_DEBUG)
|
||||
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
|
||||
#endif
|
||||
@ -105,7 +112,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
app.setApplicationName("YACReader");
|
||||
app.setOrganizationName("YACReader");
|
||||
app.setAttribute(Qt::AA_UseHighDpiPixmaps);
|
||||
|
||||
if (QIcon::hasThemeIcon("YACReader")) {
|
||||
app.setWindowIcon(QIcon::fromTheme("YACReader"));
|
||||
}
|
||||
|
||||
@ -810,6 +810,9 @@ void MainWindowViewer::openComicFromRecentAction(QAction *action)
|
||||
} else if (info1.isDir()) {
|
||||
openFolderFromPath(action->data().toString());
|
||||
}
|
||||
} else {
|
||||
viewer->resetContent();
|
||||
viewer->showMessageErrorOpening();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -587,9 +587,6 @@ bool Render::nextPageIsDoublePage()
|
||||
|
||||
bool Render::previousPageIsDoublePage()
|
||||
{
|
||||
qWarning("Previous page is doublepage!");
|
||||
qWarning("%d", currentIndex);
|
||||
qWarning("%d", currentPageBufferedIndex);
|
||||
if (currentIndex == 2 && Configuration::getConfiguration().getSettings()->value(COVER_IS_SP, true).toBool()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -844,9 +844,9 @@ void Viewer::animateShowGoToFlow()
|
||||
showGoToFlowAnimation->setStartValue(QPoint((width() - goToFlow->width()) / 2, height() - 10));
|
||||
showGoToFlowAnimation->setEndValue(QPoint((width() - goToFlow->width()) / 2, height() - goToFlow->height()));
|
||||
showGoToFlowAnimation->start();
|
||||
goToFlow->centerSlide(render->getIndex());
|
||||
goToFlow->setPageNumber(render->getIndex());
|
||||
goToFlow->show();
|
||||
goToFlow->setPageNumber(render->getIndex());
|
||||
goToFlow->centerSlide(render->getIndex());
|
||||
goToFlow->setFocus(Qt::OtherFocusReason);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user