mirror of
https://github.com/YACReader/yacreader
synced 2025-05-27 19:00:29 -04:00
Add setting to hide the "Continue Reading..." banner from the home view.
This commit is contained in:
parent
e5eda8e461
commit
f5eb81dcac
@ -22,7 +22,8 @@ Version counting is based on semantic versioning (Major.Feature.Patch)
|
||||
* 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 ocasional crashes when using automatic library updates.
|
||||
* Fix ocasional crashes when using automatic library updates.
|
||||
* Add setting to hide the "Continue Reading..." banner from the home view.
|
||||
|
||||
### 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).
|
||||
|
@ -163,7 +163,8 @@ FolderContentView::FolderContentView(QAction *toogleRecentVisibilityAction, QWid
|
||||
ctxt->setContextProperty("comicsList", comicModel.get());
|
||||
ctxt->setContextProperty("foldersList", folderModel);
|
||||
|
||||
ctxt->setContextProperty("showCurrentComic", QVariant(false));
|
||||
auto showContinueReading = settings->value(DISPLAY_GLOBAL_CONTINUE_READING_IN_GRID_VIEW, true).toBool();
|
||||
ctxt->setContextProperty("showContinueReading", QVariant(showContinueReading));
|
||||
|
||||
ctxt->setContextProperty("openHelper", this);
|
||||
ctxt->setContextProperty("dropManager", this);
|
||||
@ -229,6 +230,14 @@ void FolderContentView::setRecentRange(int days)
|
||||
folderModel->setRecentRange(days);
|
||||
}
|
||||
|
||||
void FolderContentView::updateSettings()
|
||||
{
|
||||
QQmlContext *ctxt = view->rootContext();
|
||||
|
||||
auto showContinueReading = settings->value(DISPLAY_GLOBAL_CONTINUE_READING_IN_GRID_VIEW, true).toBool();
|
||||
ctxt->setContextProperty("showContinueReading", QVariant(showContinueReading));
|
||||
}
|
||||
|
||||
void FolderContentView::openFolder(int index)
|
||||
{
|
||||
emit subfolderSelected(this->parent, index);
|
||||
|
@ -28,6 +28,9 @@ public:
|
||||
void setRecentRange(int days);
|
||||
|
||||
FolderModel *currentFolderModel() { return folderModel; }
|
||||
public slots:
|
||||
void updateSettings();
|
||||
|
||||
signals:
|
||||
void subfolderSelected(QModelIndex, int);
|
||||
void openComic(const ComicDB &comic, const ComicModel::Mode mode);
|
||||
|
@ -381,6 +381,12 @@ void GridComicsView::triggerOpenCurrentComic()
|
||||
emit openComic(currentComic, model->getMode());
|
||||
}
|
||||
|
||||
void GridComicsView::updateSettings()
|
||||
{
|
||||
updateBackgroundConfig();
|
||||
setCurrentComicIfNeeded();
|
||||
}
|
||||
|
||||
void GridComicsView::rate(int index, int rating)
|
||||
{
|
||||
model->updateRating(rating, model->index(index, 0));
|
||||
@ -442,16 +448,9 @@ void GridComicsView::setCurrentComicIfNeeded()
|
||||
(mode == ComicModel::Mode::Folder || mode == ComicModel::Mode::ReadingList) &&
|
||||
settings->value(DISPLAY_CONTINUE_READING_IN_GRID_VIEW, true).toBool();
|
||||
|
||||
if (showCurrentComic) {
|
||||
ctxt->setContextProperty("currentComic", ¤tComic);
|
||||
ctxt->setContextProperty("currentComicInfo", &(currentComic.info));
|
||||
ctxt->setContextProperty("showCurrentComic", QVariant(true));
|
||||
} else {
|
||||
ctxt->setContextProperty("currentComic", ¤tComic);
|
||||
ctxt->setContextProperty("currentComicInfo", &(currentComic.info));
|
||||
ctxt->setContextProperty("showCurrentComic", QVariant(false));
|
||||
// ctxt->setContextProperty("currentComic", nullptr);
|
||||
}
|
||||
ctxt->setContextProperty("currentComic", ¤tComic);
|
||||
ctxt->setContextProperty("currentComicInfo", &(currentComic.info));
|
||||
ctxt->setContextProperty("showCurrentComic", QVariant(showCurrentComic));
|
||||
}
|
||||
|
||||
void GridComicsView::resetScroll()
|
||||
|
@ -59,9 +59,8 @@ public slots:
|
||||
void selectAll() override;
|
||||
void selectIndex(int index) override;
|
||||
void triggerOpenCurrentComic();
|
||||
|
||||
void updateSettings();
|
||||
void updateBackgroundConfig();
|
||||
|
||||
void showInfo();
|
||||
|
||||
protected slots:
|
||||
|
@ -75,6 +75,7 @@ void OptionsDialog::restoreOptions(QSettings *settings)
|
||||
blurLabel->setVisible(useBackgroundImage);
|
||||
useCurrentComicCoverCheck->setVisible(useBackgroundImage);
|
||||
|
||||
displayGlobalContinueReadingBannerCheck->setChecked(settings->value(DISPLAY_GLOBAL_CONTINUE_READING_IN_GRID_VIEW, true).toBool());
|
||||
displayContinueReadingBannerCheck->setChecked(settings->value(DISPLAY_CONTINUE_READING_IN_GRID_VIEW, true).toBool());
|
||||
|
||||
updateLibrariesAtStartupCheck->setChecked(settings->value(UPDATE_LIBRARIES_AT_STARTUP, false).toBool());
|
||||
@ -384,9 +385,11 @@ QWidget *OptionsDialog::createGridTab()
|
||||
auto gridBackgroundGroup = new QGroupBox(tr("Background"));
|
||||
gridBackgroundGroup->setLayout(gridBackgroundLayout);
|
||||
|
||||
displayContinueReadingBannerCheck = new QCheckBox(tr("Display continue reading banner"));
|
||||
displayGlobalContinueReadingBannerCheck = new QCheckBox(tr("Display continue reading banner"));
|
||||
displayContinueReadingBannerCheck = new QCheckBox(tr("Display current comic banner"));
|
||||
|
||||
auto continueReadingLayout = new QVBoxLayout();
|
||||
continueReadingLayout->addWidget(displayGlobalContinueReadingBannerCheck);
|
||||
continueReadingLayout->addWidget(displayContinueReadingBannerCheck);
|
||||
|
||||
auto continueReadingGroup = new QGroupBox(tr("Continue reading"));
|
||||
@ -399,6 +402,12 @@ QWidget *OptionsDialog::createGridTab()
|
||||
connect(resetButton, &QPushButton::clicked, this, &OptionsDialog::resetToDefaults);
|
||||
// end grid view background config
|
||||
|
||||
connect(displayGlobalContinueReadingBannerCheck, &QCheckBox::clicked, this, [this]() {
|
||||
this->settings->setValue(DISPLAY_GLOBAL_CONTINUE_READING_IN_GRID_VIEW, this->displayGlobalContinueReadingBannerCheck->isChecked());
|
||||
|
||||
emit optionsChanged();
|
||||
});
|
||||
|
||||
connect(displayContinueReadingBannerCheck, &QCheckBox::clicked, this, [this]() {
|
||||
this->settings->setValue(DISPLAY_CONTINUE_READING_IN_GRID_VIEW, this->displayContinueReadingBannerCheck->isChecked());
|
||||
|
||||
|
@ -30,6 +30,7 @@ private slots:
|
||||
|
||||
private:
|
||||
// General tabs
|
||||
QCheckBox *displayGlobalContinueReadingBannerCheck;
|
||||
QCheckBox *displayContinueReadingBannerCheck;
|
||||
QCheckBox *trayIconCheckbox;
|
||||
QCheckBox *startToTrayCheckbox;
|
||||
|
@ -191,7 +191,7 @@ Rectangle {
|
||||
id: continueReadingTopView
|
||||
color: "#00000000"
|
||||
|
||||
height: list.count > 0 ? main.continuReadingHeight : main.topContentMargin
|
||||
height: list.count > 0 && showContinueReading ? main.continuReadingHeight : main.topContentMargin
|
||||
|
||||
Rectangle {
|
||||
color: continueReadingBackgroundColor
|
||||
@ -201,7 +201,7 @@ Rectangle {
|
||||
width: main.width
|
||||
height: main.continuReadingHeight - main.topContentMargin
|
||||
|
||||
visible: list.count > 0
|
||||
visible: list.count > 0 && showContinueReading
|
||||
|
||||
Text {
|
||||
id: continueReadingText
|
||||
|
@ -193,7 +193,7 @@ Rectangle {
|
||||
id: continueReadingTopView
|
||||
color: "#00000000"
|
||||
|
||||
height: list.count > 0 ? main.continuReadingHeight : main.topContentMargin
|
||||
height: list.count > 0 && showContinueReading ? main.continuReadingHeight : main.topContentMargin
|
||||
|
||||
Rectangle {
|
||||
color: continueReadingBackgroundColor
|
||||
@ -203,7 +203,7 @@ Rectangle {
|
||||
width: main.width
|
||||
height: main.continuReadingHeight - main.topContentMargin
|
||||
|
||||
visible: list.count > 0
|
||||
visible: list.count > 0 && showContinueReading
|
||||
|
||||
Text {
|
||||
id: continueReadingText
|
||||
|
@ -38,6 +38,7 @@ YACReaderContentViewsManager::YACReaderContentViewsManager(QSettings *settings,
|
||||
default:
|
||||
comicsView = gridComicsView = new GridComicsView();
|
||||
connect(libraryWindow->optionsDialog, &YACReaderOptionsDialog::optionsChanged, gridComicsView, &GridComicsView::updateBackgroundConfig);
|
||||
connect(libraryWindow->optionsDialog, &YACReaderOptionsDialog::finished, gridComicsView, &GridComicsView::updateSettings); // TODO: we can link constante changes to updateSettings because of bad performance
|
||||
comicsViewStatus = Grid;
|
||||
break;
|
||||
}
|
||||
@ -58,6 +59,7 @@ YACReaderContentViewsManager::YACReaderContentViewsManager(QSettings *settings,
|
||||
// connections
|
||||
connect(folderContentView, &FolderContentView::copyComicsToCurrentFolder, libraryWindow, &LibraryWindow::copyAndImportComicsToCurrentFolder);
|
||||
connect(folderContentView, &FolderContentView::moveComicsToCurrentFolder, libraryWindow, &LibraryWindow::moveAndImportComicsToCurrentFolder);
|
||||
connect(libraryWindow->optionsDialog, &YACReaderOptionsDialog::optionsChanged, folderContentView, &FolderContentView::updateSettings);
|
||||
}
|
||||
|
||||
QWidget *YACReaderContentViewsManager::containerWidget()
|
||||
@ -245,6 +247,7 @@ void YACReaderContentViewsManager::_toggleComicsView()
|
||||
|
||||
switchToComicsView(classicComicsView, gridComicsView);
|
||||
connect(libraryWindow->optionsDialog, &YACReaderOptionsDialog::optionsChanged, gridComicsView, &GridComicsView::updateBackgroundConfig);
|
||||
connect(libraryWindow->optionsDialog, &YACReaderOptionsDialog::finished, gridComicsView, &GridComicsView::updateSettings); // TODO: we can link constante changes to updateSettings because of bad performance
|
||||
comicsViewStatus = Grid;
|
||||
|
||||
break;
|
||||
|
@ -71,6 +71,7 @@
|
||||
#define OPACITY_BACKGROUND_IMAGE_IN_GRID_VIEW "OPACITY_BACKGROUND_IMAGE_IN_GRID_VIEW"
|
||||
#define BLUR_RADIUS_BACKGROUND_IMAGE_IN_GRID_VIEW "BLUR_RADIUS_BACKGROUND_IMAGE_IN_GRID_VIEW"
|
||||
#define USE_SELECTED_COMIC_COVER_AS_BACKGROUND_IMAGE_IN_GRID_VIEW "USE_SELECTED_COMIC_COVER_AS_BACKGROUND_IMAGE_IN_GRID_VIEW"
|
||||
#define DISPLAY_GLOBAL_CONTINUE_READING_IN_GRID_VIEW "DISPLAY_GLOBAL_CONTINUE_READING_IN_GRID_VIEW"
|
||||
#define DISPLAY_CONTINUE_READING_IN_GRID_VIEW "DISPLAY_CONTINUE_READING_IN_GRID_VIEW"
|
||||
#define DISPLAY_RECENTLY_INDICATOR "DISPLAY_RECENTLY_INDICATOR"
|
||||
#define NUM_DAYS_TO_CONSIDER_RECENT "NUM_DAYS_TO_CONSIDER_RECENT"
|
||||
|
Loading…
Reference in New Issue
Block a user