FB2 fixes
This commit is contained in:
4 files changed
+28
-7
No files matched your search
+4
-1
@@ -169,8 +169,9 @@ int main(int argc, char *argv[])
|
||||
readingModel.setFontParams(readingPreferences.fontSize(), readingPreferences.lineSpacing());
|
||||
});
|
||||
|
||||
// Track the current image provider so setContentWidth can reach it
|
||||
// Track the current image provider and content width so both stay in sync.
|
||||
IImageProvider *currentImageProvider = nullptr;
|
||||
int currentContentWidth = 0;
|
||||
|
||||
// Before a new book open: snapshot the outgoing book's progress into the library.
|
||||
// Scroll position is handled by PageView's scroll tracker via book.saveCurrentPosition().
|
||||
@@ -201,6 +202,7 @@ int main(int argc, char *argv[])
|
||||
engine.removeImageProvider(provider->scheme());
|
||||
engine.addImageProvider(provider->scheme(), provider);
|
||||
provider->setFilePath(filePath);
|
||||
provider->setDisplayWidth(currentContentWidth);
|
||||
currentImageProvider = provider;
|
||||
|
||||
if (!reader->coverImagePath().isEmpty())
|
||||
@@ -220,6 +222,7 @@ int main(int argc, char *argv[])
|
||||
// Propagate content-width changes to image provider + reading model.
|
||||
// Called from Book::setContentWidth which is triggered by QML's PageView.
|
||||
QObject::connect(&book, &Book::contentWidthChanged, [&](int width){
|
||||
currentContentWidth = width;
|
||||
if (currentImageProvider)
|
||||
currentImageProvider->setDisplayWidth(width);
|
||||
readingModel.setContentWidth(width);
|
||||
|
||||
Reference in new issue
Block a user