mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -04:00
Update comic info when the index changes in GridView.
This commit is contained in:
parent
28b5a29da9
commit
2199206401
@ -187,7 +187,11 @@ void GridComicsView::setModel(ComicModel *model)
|
||||
updateBackgroundConfig();
|
||||
|
||||
if(model->rowCount()>0)
|
||||
{
|
||||
setCurrentIndex(model->index(0,0));
|
||||
if(showInfoAction->isChecked())
|
||||
updateInfoForIndex(0);
|
||||
}
|
||||
}
|
||||
|
||||
void GridComicsView::updateBackgroundConfig()
|
||||
@ -233,6 +237,8 @@ void GridComicsView::showInfo()
|
||||
{
|
||||
QQmlContext *ctxt = view->rootContext();
|
||||
ctxt->setContextProperty("showInfo", showInfoAction->isChecked());
|
||||
|
||||
updateInfoForIndex(currentIndex().row());
|
||||
}
|
||||
|
||||
void GridComicsView::setCurrentIndex(const QModelIndex &index)
|
||||
@ -243,6 +249,9 @@ void GridComicsView::setCurrentIndex(const QModelIndex &index)
|
||||
|
||||
if(settings->value(USE_SELECTED_COMIC_COVER_AS_BACKGROUND_IMAGE_IN_GRID_VIEW, false).toBool())
|
||||
updateBackgroundConfig();
|
||||
|
||||
if(showInfoAction->isChecked())
|
||||
updateInfoForIndex(index.row());
|
||||
}
|
||||
|
||||
QModelIndex GridComicsView::currentIndex()
|
||||
|
@ -75,8 +75,6 @@ private:
|
||||
QAction * coverSizeSliderAction;
|
||||
QAction * showInfoAction;
|
||||
QItemSelectionModel * _selectionModel;
|
||||
QQuickView *view;
|
||||
QWidget *container;
|
||||
bool dummy;
|
||||
void closeEvent ( QCloseEvent * event );
|
||||
void createCoverSizeSliderWidget();
|
||||
|
Loading…
x
Reference in New Issue
Block a user