Skip to content

Commit

Permalink
Update upstream source from tag 'upstream/9.15.0'
Browse files Browse the repository at this point in the history
Update to upstream version '9.15.0'
with Debian dir ab95d31c4aaf177f2e086e27be63cca3f94dee58
  • Loading branch information
selmf committed Jan 19, 2025
2 parents 1050b65 + 999d7c1 commit 84c9835
Show file tree
Hide file tree
Showing 127 changed files with 11,586 additions and 6,750 deletions.
33 changes: 32 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,44 @@

Version counting is based on semantic versioning (Major.Feature.Patch)

## 9.15.0

### YACReader
* Save magnifying glass size and zoom level.
* Add shortcut to reset the magnifying glass to its defaults (size and zoom), it is `slash` by default but it can be reasigned.
* Bump PDF render size.
* Fix trackpad scrolling, it makes using trackpads more reponsive and natural.
* Added more info to Help -> System info.

### YACReaderLibrary
* Fix headers in the table view getting stuck in a non moveable state.
* Add option to set the type of a library. It will convert all the content to desired type (comic, manga, etc) and it will set that type as the default one for that library. Available in the library context menu.
* Added more info to Help -> System info.
* New setting to open comics in third party reader apps, it works by entering a command that will launch the app, e.g. "/path/to/the/app {comic_file_path}". You can use `{comic_file_path}` as a placeholder where `YACReaderLibrary` will place thet path to the comic file.
* Purge covers and metadata not being used after a full library update.
* Fix crash when updating the current folder content after a library update.
* Fix crash when current folders is empty after an update.
* Enable dropping content on the FolderContentView.
* Fix `open containing folder...` shortcut for comics.
* Add a dialog to show information about a library, it includes the number of folders and comics and the number of read comics.
* Fix occasional crashes when using automatic library updates.
* Add setting to hide the "Continue Reading..." banner from the home view.
* Improve Grid and Flow Info comics view scroll performance.

### YACReaderLibraryServer
* New command --system-info to print information about the execution environment and available resources (including what image formats are supported and what libraries are used by the app).
* Fix automatic libraries updates not being triggered.

### All apps
* Sorting heuristic to try to find spreads in the content of a comic is now only used for files with less than 1000 pages to avoid false positives.

## 9.14.2

### YACReaderLibrary
* Fix columns in the search results.
* Fix type not being propagated to new folders from their parents.
* Fix default type set to folders in the root folder when they are added.
* Improve and fix comic file size format.
* Improve and fix comic file size format.

## 9.14.1

Expand Down
6 changes: 4 additions & 2 deletions YACReader/YACReader.pro
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ HEADERS += ../common/comic.h \
../common/exit_check.h \
../common/scroll_management.h \
../common/opengl_checker.h \
../common/pdf_comic.h
../common/pdf_comic.h \
../common/global_info_provider.h \

!CONFIG(no_opengl) {
HEADERS += ../common/gl/yacreader_flow_gl.h \
Expand Down Expand Up @@ -143,7 +144,8 @@ SOURCES += ../common/comic.cpp \
../common/yacreader_global_gui.cpp \
../common/exit_check.cpp \
../common/scroll_management.cpp \
../common/opengl_checker.cpp
../common/opengl_checker.cpp \
../common/global_info_provider.cpp \

!CONFIG(no_opengl) {
SOURCES += ../common/gl/yacreader_flow_gl.cpp \
Expand Down
4 changes: 2 additions & 2 deletions YACReader/configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ void Configuration::load(QSettings *settings)
settings->setValue(GO_TO_FLOW_SIZE, QSize(126, 200));
if (!settings->contains(MAG_GLASS_SIZE))
settings->setValue(MAG_GLASS_SIZE, QSize(350, 175));
if (!settings->contains(ZOOM_LEVEL))
settings->setValue(MAG_GLASS_SIZE, QSize(350, 175));
if (!settings->contains(MAG_GLASS_ZOOM))
settings->setValue(MAG_GLASS_ZOOM, 0.5);
if (!settings->contains(FLOW_TYPE))
settings->setValue(FLOW_TYPE, 0);
if (!settings->contains(FULLSCREEN))
Expand Down
2 changes: 2 additions & 0 deletions YACReader/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ class Configuration : public QObject
void setDefaultPath(QString defaultPath) { settings->setValue(PATH, defaultPath); }
QSize getMagnifyingGlassSize() { return settings->value(MAG_GLASS_SIZE).toSize(); }
void setMagnifyingGlassSize(const QSize &mgs) { settings->setValue(MAG_GLASS_SIZE, mgs); }
float getMagnifyingGlassZoom() { return settings->value(MAG_GLASS_ZOOM, 0.5).toFloat(); }
void setMagnifyingGlassZoom(float mgz) { settings->setValue(MAG_GLASS_ZOOM, mgz); }
QSize getGotoSlideSize() { return settings->value(GO_TO_FLOW_SIZE).toSize(); }
void setGotoSlideSize(const QSize &gss) { settings->setValue(GO_TO_FLOW_SIZE, gss); }
float getZoomLevel() { return settings->value(ZOOM_LEVEL).toFloat(); }
Expand Down
18 changes: 14 additions & 4 deletions YACReader/magnifying_glass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

#include <QScrollBar>

MagnifyingGlass::MagnifyingGlass(int w, int h, QWidget *parent)
: QLabel(parent), zoomLevel(0.5)
MagnifyingGlass::MagnifyingGlass(int w, int h, float zoomLevel, QWidget *parent)
: QLabel(parent), zoomLevel(zoomLevel)
{
setup(QSize(w, h));
}

MagnifyingGlass::MagnifyingGlass(const QSize &size, QWidget *parent)
: QLabel(parent), zoomLevel(0.5)
MagnifyingGlass::MagnifyingGlass(const QSize &size, float zoomLevel, QWidget *parent)
: QLabel(parent), zoomLevel(zoomLevel)
{
setup(size);
}
Expand Down Expand Up @@ -178,6 +178,7 @@ void MagnifyingGlass::zoomIn()
{
if (zoomLevel > 0.2f) {
zoomLevel -= 0.025f;
emit zoomChanged(zoomLevel);
updateImage();
}
}
Expand All @@ -186,6 +187,7 @@ void MagnifyingGlass::zoomOut()
{
if (zoomLevel < 0.9f) {
zoomLevel += 0.025f;
emit zoomChanged(zoomLevel);
updateImage();
}
}
Expand Down Expand Up @@ -234,9 +236,17 @@ void MagnifyingGlass::widthDown()
resizeAndUpdate(w, height());
}

void MagnifyingGlass::reset()
{
zoomLevel = 0.5f;
emit zoomChanged(zoomLevel);
resizeAndUpdate(350, 175);
}

void MagnifyingGlass::resizeAndUpdate(int w, int h)
{
resize(w, h);
emit sizeChanged(size());
updateImage();
}

Expand Down
9 changes: 7 additions & 2 deletions YACReader/magnifying_glass.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ class MagnifyingGlass : public QLabel
bool shrinkHeight(int &h) const;

public:
MagnifyingGlass(int width, int height, QWidget *parent);
MagnifyingGlass(const QSize &size, QWidget *parent);
MagnifyingGlass(int width, int height, float zoomLevel, QWidget *parent);
MagnifyingGlass(const QSize &size, float zoomLevel, QWidget *parent);
void mouseMoveEvent(QMouseEvent *event) override;
public slots:
void updateImage(int x, int y);
Expand All @@ -38,6 +38,11 @@ public slots:
void heightDown();
void widthUp();
void widthDown();
void reset();

signals:
void sizeChanged(QSize newSize);
void zoomChanged(float newZoomLevel);
};

#endif
6 changes: 5 additions & 1 deletion YACReader/main_window_viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1187,8 +1187,12 @@ void MainWindowViewer::setUpShortcutsManagement()
auto *const zoomOutMglassAction = addActionWithShortcut(tr("Zoom out magnifying glass"), ZOOM_OUT_MGLASS_ACTION_Y);
connect(zoomOutMglassAction, &QAction::triggered, viewer, &Viewer::magnifyingGlassZoomOut);

auto *const resetMglassAction = addActionWithShortcut(tr("Reset magnifying glass"), RESET_MGLASS_ACTION_Y);
connect(resetMglassAction, &QAction::triggered, viewer, &Viewer::resetMagnifyingGlass);

mglassActions = { sizeUpMglassAction, sizeDownMglassAction,
zoomInMglassAction, zoomOutMglassAction };
zoomInMglassAction, zoomOutMglassAction,
resetMglassAction };

editShortcutsDialog->addActionsGroup(tr("Magnifiying glass"), QIcon(":/images/shortcuts_group_mglass.svg"),
tmpList = QList<QAction *>()
Expand Down
4 changes: 2 additions & 2 deletions YACReader/render.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ class Render;
class ImageFilter
{
public:
ImageFilter() {};
virtual ~ImageFilter() {};
ImageFilter() { };
virtual ~ImageFilter() { };
virtual QImage setFilter(const QImage &image) = 0;
inline int getLevel() { return level; };
inline void setLevel(int l) { level = l; };
Expand Down
119 changes: 94 additions & 25 deletions YACReader/viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,18 @@ Viewer::Viewer(QWidget *parent)
palette.setColor(backgroundRole(), Configuration::getConfiguration().getBackgroundColor());
setPalette(palette);
//---------------------------------------
mglass = new MagnifyingGlass(Configuration::getConfiguration().getMagnifyingGlassSize(), this);
mglass = new MagnifyingGlass(
Configuration::getConfiguration().getMagnifyingGlassSize(),
Configuration::getConfiguration().getMagnifyingGlassZoom(),
this);

connect(mglass, &MagnifyingGlass::sizeChanged, this, [](QSize size) {
Configuration::getConfiguration().setMagnifyingGlassSize(size);
});
connect(mglass, &MagnifyingGlass::zoomChanged, this, [](float zoom) {
Configuration::getConfiguration().setMagnifyingGlassZoom(zoom);
});

mglass->hide();
content->setMouseTracking(true);
setMouseTracking(true);
Expand Down Expand Up @@ -159,6 +170,7 @@ void Viewer::createConnections()
connect(this, &Viewer::magnifyingGlassSizeDown, mglass, &MagnifyingGlass::sizeDown);
connect(this, &Viewer::magnifyingGlassZoomIn, mglass, &MagnifyingGlass::zoomIn);
connect(this, &Viewer::magnifyingGlassZoomOut, mglass, &MagnifyingGlass::zoomOut);
connect(this, &Viewer::resetMagnifyingGlass, mglass, &MagnifyingGlass::reset);

// goToDialog
connect(goToDialog, &GoToDialog::goToPage, this, &Viewer::goTo);
Expand Down Expand Up @@ -648,44 +660,101 @@ void Viewer::animateScroll(QPropertyAnimation &scroller, const QScrollBar &scrol

void Viewer::wheelEvent(QWheelEvent *event)
{
if (render->hasLoadedComic()) {
auto delta = event->angleDelta();
if (!render->hasLoadedComic()) {
return;
}

if (delta.x() != 0) {
animateScroll(*horizontalScroller, *horizontalScrollBar(), delta.x());
return;
}
if (!event->pixelDelta().isNull()) {
wheelEventTrackpad(event);
} else {
wheelEventMouse(event);
}
}

auto turnPageOnScroll = !Configuration::getConfiguration().getDoNotTurnPageOnScroll();
auto getUseSingleScrollStepToTurnPage = Configuration::getConfiguration().getUseSingleScrollStepToTurnPage();
void Viewer::wheelEventMouse(QWheelEvent *event)
{
auto delta = event->angleDelta();

if ((delta.y() < 0) && (verticalScrollBar()->sliderPosition() == verticalScrollBar()->maximum()) && turnPageOnScroll) {
if (delta.x() != 0) {
animateScroll(*horizontalScroller, *horizontalScrollBar(), delta.x());
return;
}

auto turnPageOnScroll = !Configuration::getConfiguration().getDoNotTurnPageOnScroll();
auto getUseSingleScrollStepToTurnPage = Configuration::getConfiguration().getUseSingleScrollStepToTurnPage();

if ((delta.y() < 0) && (verticalScrollBar()->sliderPosition() == verticalScrollBar()->maximum()) && turnPageOnScroll) {
if (wheelStop || getUseSingleScrollStepToTurnPage || verticalScrollBar()->maximum() == verticalScrollBar()->minimum()) {
if (getMovement(event) == Forward) {
next();
verticalScroller->stop();
event->accept();
wheelStop = false;
}
return;
} else
wheelStop = true;
} else {
if ((delta.y() > 0) && (verticalScrollBar()->sliderPosition() == verticalScrollBar()->minimum()) && turnPageOnScroll) {
if (wheelStop || getUseSingleScrollStepToTurnPage || verticalScrollBar()->maximum() == verticalScrollBar()->minimum()) {
if (getMovement(event) == Forward) {
next();
if (getMovement(event) == Backward) {
prev();
verticalScroller->stop();
event->accept();
wheelStop = false;
}
return;
} else
wheelStop = true;
}
}

animateScroll(*verticalScroller, *verticalScrollBar(), delta.y());
}

void Viewer::wheelEventTrackpad(QWheelEvent *event)
{
auto delta = event->pixelDelta();

// Apply delta to horizontal scrollbar
if (delta.x() != 0) {
int newHorizontalValue = horizontalScrollBar()->value() - delta.x();
horizontalScrollBar()->setValue(newHorizontalValue);
}

// Apply delta to vertical scrollbar
if (delta.y() != 0) {
int newVerticalValue = verticalScrollBar()->value() - delta.y();
verticalScrollBar()->setValue(newVerticalValue);
}

auto turnPageOnScroll = !Configuration::getConfiguration().getDoNotTurnPageOnScroll();
auto getUseSingleScrollStepToTurnPage = Configuration::getConfiguration().getUseSingleScrollStepToTurnPage();

if ((delta.y() < 0) && (verticalScrollBar()->sliderPosition() == verticalScrollBar()->maximum()) && turnPageOnScroll) {
if (wheelStop || getUseSingleScrollStepToTurnPage || verticalScrollBar()->maximum() == verticalScrollBar()->minimum()) {
if (getMovement(event) == Forward) {
next();
event->accept();
wheelStop = false;
}
return;
} else {
if ((delta.y() > 0) && (verticalScrollBar()->sliderPosition() == verticalScrollBar()->minimum()) && turnPageOnScroll) {
if (wheelStop || getUseSingleScrollStepToTurnPage || verticalScrollBar()->maximum() == verticalScrollBar()->minimum()) {
if (getMovement(event) == Backward) {
prev();
verticalScroller->stop();
event->accept();
wheelStop = false;
}
return;
} else
wheelStop = true;
wheelStop = true;
}
} else {
if ((delta.y() > 0) && (verticalScrollBar()->sliderPosition() == verticalScrollBar()->minimum()) && turnPageOnScroll) {
if (wheelStop || getUseSingleScrollStepToTurnPage || verticalScrollBar()->maximum() == verticalScrollBar()->minimum()) {
if (getMovement(event) == Backward) {
prev();
event->accept();
wheelStop = false;
}
return;
} else {
wheelStop = true;
}
}

animateScroll(*verticalScroller, *verticalScrollBar(), delta.y());
}
}

Expand Down
3 changes: 3 additions & 0 deletions YACReader/viewer.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ public slots:
//! Event handlers:
void resizeEvent(QResizeEvent *event) override;
void wheelEvent(QWheelEvent *event) override;
void wheelEventMouse(QWheelEvent *event);
void wheelEventTrackpad(QWheelEvent *event);
void mouseMoveEvent(QMouseEvent *event) override;

int verticalScrollStep() const;
Expand Down Expand Up @@ -210,6 +212,7 @@ public slots:
void magnifyingGlassSizeDown();
void magnifyingGlassZoomIn();
void magnifyingGlassZoomOut();
void resetMagnifyingGlass();
};

#endif
Loading

0 comments on commit 84c9835

Please sign in to comment.