PDF: minor fixes

This commit is contained in:
Nicolas Mailloux 2021-09-02 19:00:54 -04:00
parent 94e0319576
commit 5c274e21ec
3 changed files with 18 additions and 21 deletions

View file

@ -1953,8 +1953,8 @@ void reader::setupLocalSettingsEnvironment() {
void reader::setupPng() {
// Note: Output file is supposed to be '/run/page.png', but somehow mutool puts it in '/run/page1.png'
// QGraphicsScene * graphicsScene = new QGraphicsScene();
QPixmap pixmap("/run/page1.png");
// Initialized above
graphicsScene->addPixmap(pixmap);
ui->graphicsView->items().clear();
ui->graphicsView->setScene(graphicsScene);
@ -2021,7 +2021,6 @@ void reader::on_pdfScaleSlider_valueChanged(int value)
}
}
mupdf::pdf::pdfPageNumber = mupdf::pdf::pdfPageNumber + 1;
setup_book(book_file, mupdf::pdf::pdfPageNumber, true);
setupPng();
}

View file

@ -154,9 +154,7 @@ private slots:
void setupLocalSettingsEnvironment();
void setupPng();
void on_pdfScaleSlider_valueChanged(int value);
void on_decreaseScaleBtn_clicked();
void on_increaseScaleBtn_clicked();
private:

View file

@ -705,10 +705,19 @@
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QPushButton" name="decreaseScaleBtn">
<property name="text">
<string>Decrease scale</string>
<item row="2" column="1">
<widget class="QSlider" name="pdfScaleSlider">
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>4</number>
</property>
<property name="pageStep">
<number>1</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
@ -728,19 +737,10 @@
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QSlider" name="pdfScaleSlider">
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>4</number>
</property>
<property name="pageStep">
<number>1</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
<item row="2" column="0">
<widget class="QPushButton" name="decreaseScaleBtn">
<property name="text">
<string>Decrease scale</string>
</property>
</widget>
</item>