mirror of
https://github.com/YACReader/yacreader
synced 2025-05-28 03:10:27 -04:00
Extract method
This commit is contained in:
parent
2ae9b83bbf
commit
59ae6c5e51
@ -417,6 +417,11 @@ void GridComicsView::setCoversSize(int width)
|
||||
Q_ARG(QVariant, cellCustomWidth));
|
||||
}
|
||||
|
||||
updateCoversSizeInContext(width, ctxt);
|
||||
}
|
||||
|
||||
void GridComicsView::updateCoversSizeInContext(int width, QQmlContext *ctxt)
|
||||
{
|
||||
int cellBottomMarging = 8 * (1 + 2 * (1 - (float(YACREADER_MAX_GRID_ZOOM_WIDTH - width) / (YACREADER_MAX_GRID_ZOOM_WIDTH - YACREADER_MIN_GRID_ZOOM_WIDTH))));
|
||||
|
||||
ctxt->setContextProperty("cellCustomHeight", ((width * YACREADER_MAX_COVER_HEIGHT) / YACREADER_MIN_COVER_WIDTH) + 51 + cellBottomMarging);
|
||||
|
@ -10,6 +10,7 @@
|
||||
class QAbstractListModel;
|
||||
class QItemSelectionModel;
|
||||
class QQuickWidget;
|
||||
class QQmlContext;
|
||||
|
||||
class YACReaderToolBarStretch;
|
||||
class YACReaderComicsSelectionHelper;
|
||||
@ -64,6 +65,7 @@ protected slots:
|
||||
void requestedContextMenu(const QPoint &point);
|
||||
|
||||
void setCoversSize(int width);
|
||||
void updateCoversSizeInContext(int width, QQmlContext *ctxt);
|
||||
|
||||
void dummyUpdater(); // TODO remove this
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user