mirror of
https://github.com/YACReader/yacreader
synced 2025-05-28 03:10:27 -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.
|
* Enable dropping content on the FolderContentView.
|
||||||
* Fix `open containing folder...` shortcut for comics.
|
* 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.
|
* 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
|
### 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).
|
* 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("comicsList", comicModel.get());
|
||||||
ctxt->setContextProperty("foldersList", folderModel);
|
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("openHelper", this);
|
||||||
ctxt->setContextProperty("dropManager", this);
|
ctxt->setContextProperty("dropManager", this);
|
||||||
@ -229,6 +230,14 @@ void FolderContentView::setRecentRange(int days)
|
|||||||
folderModel->setRecentRange(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)
|
void FolderContentView::openFolder(int index)
|
||||||
{
|
{
|
||||||
emit subfolderSelected(this->parent, index);
|
emit subfolderSelected(this->parent, index);
|
||||||
|
@ -28,6 +28,9 @@ public:
|
|||||||
void setRecentRange(int days);
|
void setRecentRange(int days);
|
||||||
|
|
||||||
FolderModel *currentFolderModel() { return folderModel; }
|
FolderModel *currentFolderModel() { return folderModel; }
|
||||||
|
public slots:
|
||||||
|
void updateSettings();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void subfolderSelected(QModelIndex, int);
|
void subfolderSelected(QModelIndex, int);
|
||||||
void openComic(const ComicDB &comic, const ComicModel::Mode mode);
|
void openComic(const ComicDB &comic, const ComicModel::Mode mode);
|
||||||
|
@ -381,6 +381,12 @@ void GridComicsView::triggerOpenCurrentComic()
|
|||||||
emit openComic(currentComic, model->getMode());
|
emit openComic(currentComic, model->getMode());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GridComicsView::updateSettings()
|
||||||
|
{
|
||||||
|
updateBackgroundConfig();
|
||||||
|
setCurrentComicIfNeeded();
|
||||||
|
}
|
||||||
|
|
||||||
void GridComicsView::rate(int index, int rating)
|
void GridComicsView::rate(int index, int rating)
|
||||||
{
|
{
|
||||||
model->updateRating(rating, model->index(index, 0));
|
model->updateRating(rating, model->index(index, 0));
|
||||||
@ -442,16 +448,9 @@ void GridComicsView::setCurrentComicIfNeeded()
|
|||||||
(mode == ComicModel::Mode::Folder || mode == ComicModel::Mode::ReadingList) &&
|
(mode == ComicModel::Mode::Folder || mode == ComicModel::Mode::ReadingList) &&
|
||||||
settings->value(DISPLAY_CONTINUE_READING_IN_GRID_VIEW, true).toBool();
|
settings->value(DISPLAY_CONTINUE_READING_IN_GRID_VIEW, true).toBool();
|
||||||
|
|
||||||
if (showCurrentComic) {
|
ctxt->setContextProperty("currentComic", ¤tComic);
|
||||||
ctxt->setContextProperty("currentComic", ¤tComic);
|
ctxt->setContextProperty("currentComicInfo", &(currentComic.info));
|
||||||
ctxt->setContextProperty("currentComicInfo", &(currentComic.info));
|
ctxt->setContextProperty("showCurrentComic", QVariant(showCurrentComic));
|
||||||
ctxt->setContextProperty("showCurrentComic", QVariant(true));
|
|
||||||
} else {
|
|
||||||
ctxt->setContextProperty("currentComic", ¤tComic);
|
|
||||||
ctxt->setContextProperty("currentComicInfo", &(currentComic.info));
|
|
||||||
ctxt->setContextProperty("showCurrentComic", QVariant(false));
|
|
||||||
// ctxt->setContextProperty("currentComic", nullptr);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GridComicsView::resetScroll()
|
void GridComicsView::resetScroll()
|
||||||
|
@ -59,9 +59,8 @@ public slots:
|
|||||||
void selectAll() override;
|
void selectAll() override;
|
||||||
void selectIndex(int index) override;
|
void selectIndex(int index) override;
|
||||||
void triggerOpenCurrentComic();
|
void triggerOpenCurrentComic();
|
||||||
|
void updateSettings();
|
||||||
void updateBackgroundConfig();
|
void updateBackgroundConfig();
|
||||||
|
|
||||||
void showInfo();
|
void showInfo();
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
|
@ -75,6 +75,7 @@ void OptionsDialog::restoreOptions(QSettings *settings)
|
|||||||
blurLabel->setVisible(useBackgroundImage);
|
blurLabel->setVisible(useBackgroundImage);
|
||||||
useCurrentComicCoverCheck->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());
|
displayContinueReadingBannerCheck->setChecked(settings->value(DISPLAY_CONTINUE_READING_IN_GRID_VIEW, true).toBool());
|
||||||
|
|
||||||
updateLibrariesAtStartupCheck->setChecked(settings->value(UPDATE_LIBRARIES_AT_STARTUP, false).toBool());
|
updateLibrariesAtStartupCheck->setChecked(settings->value(UPDATE_LIBRARIES_AT_STARTUP, false).toBool());
|
||||||
@ -384,9 +385,11 @@ QWidget *OptionsDialog::createGridTab()
|
|||||||
auto gridBackgroundGroup = new QGroupBox(tr("Background"));
|
auto gridBackgroundGroup = new QGroupBox(tr("Background"));
|
||||||
gridBackgroundGroup->setLayout(gridBackgroundLayout);
|
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();
|
auto continueReadingLayout = new QVBoxLayout();
|
||||||
|
continueReadingLayout->addWidget(displayGlobalContinueReadingBannerCheck);
|
||||||
continueReadingLayout->addWidget(displayContinueReadingBannerCheck);
|
continueReadingLayout->addWidget(displayContinueReadingBannerCheck);
|
||||||
|
|
||||||
auto continueReadingGroup = new QGroupBox(tr("Continue reading"));
|
auto continueReadingGroup = new QGroupBox(tr("Continue reading"));
|
||||||
@ -399,6 +402,12 @@ QWidget *OptionsDialog::createGridTab()
|
|||||||
connect(resetButton, &QPushButton::clicked, this, &OptionsDialog::resetToDefaults);
|
connect(resetButton, &QPushButton::clicked, this, &OptionsDialog::resetToDefaults);
|
||||||
// end grid view background config
|
// 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]() {
|
connect(displayContinueReadingBannerCheck, &QCheckBox::clicked, this, [this]() {
|
||||||
this->settings->setValue(DISPLAY_CONTINUE_READING_IN_GRID_VIEW, this->displayContinueReadingBannerCheck->isChecked());
|
this->settings->setValue(DISPLAY_CONTINUE_READING_IN_GRID_VIEW, this->displayContinueReadingBannerCheck->isChecked());
|
||||||
|
|
||||||
|
@ -30,6 +30,7 @@ private slots:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
// General tabs
|
// General tabs
|
||||||
|
QCheckBox *displayGlobalContinueReadingBannerCheck;
|
||||||
QCheckBox *displayContinueReadingBannerCheck;
|
QCheckBox *displayContinueReadingBannerCheck;
|
||||||
QCheckBox *trayIconCheckbox;
|
QCheckBox *trayIconCheckbox;
|
||||||
QCheckBox *startToTrayCheckbox;
|
QCheckBox *startToTrayCheckbox;
|
||||||
|
@ -191,7 +191,7 @@ Rectangle {
|
|||||||
id: continueReadingTopView
|
id: continueReadingTopView
|
||||||
color: "#00000000"
|
color: "#00000000"
|
||||||
|
|
||||||
height: list.count > 0 ? main.continuReadingHeight : main.topContentMargin
|
height: list.count > 0 && showContinueReading ? main.continuReadingHeight : main.topContentMargin
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
color: continueReadingBackgroundColor
|
color: continueReadingBackgroundColor
|
||||||
@ -201,7 +201,7 @@ Rectangle {
|
|||||||
width: main.width
|
width: main.width
|
||||||
height: main.continuReadingHeight - main.topContentMargin
|
height: main.continuReadingHeight - main.topContentMargin
|
||||||
|
|
||||||
visible: list.count > 0
|
visible: list.count > 0 && showContinueReading
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
id: continueReadingText
|
id: continueReadingText
|
||||||
|
@ -193,7 +193,7 @@ Rectangle {
|
|||||||
id: continueReadingTopView
|
id: continueReadingTopView
|
||||||
color: "#00000000"
|
color: "#00000000"
|
||||||
|
|
||||||
height: list.count > 0 ? main.continuReadingHeight : main.topContentMargin
|
height: list.count > 0 && showContinueReading ? main.continuReadingHeight : main.topContentMargin
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
color: continueReadingBackgroundColor
|
color: continueReadingBackgroundColor
|
||||||
@ -203,7 +203,7 @@ Rectangle {
|
|||||||
width: main.width
|
width: main.width
|
||||||
height: main.continuReadingHeight - main.topContentMargin
|
height: main.continuReadingHeight - main.topContentMargin
|
||||||
|
|
||||||
visible: list.count > 0
|
visible: list.count > 0 && showContinueReading
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
id: continueReadingText
|
id: continueReadingText
|
||||||
|
@ -38,6 +38,7 @@ YACReaderContentViewsManager::YACReaderContentViewsManager(QSettings *settings,
|
|||||||
default:
|
default:
|
||||||
comicsView = gridComicsView = new GridComicsView();
|
comicsView = gridComicsView = new GridComicsView();
|
||||||
connect(libraryWindow->optionsDialog, &YACReaderOptionsDialog::optionsChanged, gridComicsView, &GridComicsView::updateBackgroundConfig);
|
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;
|
comicsViewStatus = Grid;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -58,6 +59,7 @@ YACReaderContentViewsManager::YACReaderContentViewsManager(QSettings *settings,
|
|||||||
// connections
|
// connections
|
||||||
connect(folderContentView, &FolderContentView::copyComicsToCurrentFolder, libraryWindow, &LibraryWindow::copyAndImportComicsToCurrentFolder);
|
connect(folderContentView, &FolderContentView::copyComicsToCurrentFolder, libraryWindow, &LibraryWindow::copyAndImportComicsToCurrentFolder);
|
||||||
connect(folderContentView, &FolderContentView::moveComicsToCurrentFolder, libraryWindow, &LibraryWindow::moveAndImportComicsToCurrentFolder);
|
connect(folderContentView, &FolderContentView::moveComicsToCurrentFolder, libraryWindow, &LibraryWindow::moveAndImportComicsToCurrentFolder);
|
||||||
|
connect(libraryWindow->optionsDialog, &YACReaderOptionsDialog::optionsChanged, folderContentView, &FolderContentView::updateSettings);
|
||||||
}
|
}
|
||||||
|
|
||||||
QWidget *YACReaderContentViewsManager::containerWidget()
|
QWidget *YACReaderContentViewsManager::containerWidget()
|
||||||
@ -245,6 +247,7 @@ void YACReaderContentViewsManager::_toggleComicsView()
|
|||||||
|
|
||||||
switchToComicsView(classicComicsView, gridComicsView);
|
switchToComicsView(classicComicsView, gridComicsView);
|
||||||
connect(libraryWindow->optionsDialog, &YACReaderOptionsDialog::optionsChanged, gridComicsView, &GridComicsView::updateBackgroundConfig);
|
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;
|
comicsViewStatus = Grid;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -71,6 +71,7 @@
|
|||||||
#define OPACITY_BACKGROUND_IMAGE_IN_GRID_VIEW "OPACITY_BACKGROUND_IMAGE_IN_GRID_VIEW"
|
#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 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 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_CONTINUE_READING_IN_GRID_VIEW "DISPLAY_CONTINUE_READING_IN_GRID_VIEW"
|
||||||
#define DISPLAY_RECENTLY_INDICATOR "DISPLAY_RECENTLY_INDICATOR"
|
#define DISPLAY_RECENTLY_INDICATOR "DISPLAY_RECENTLY_INDICATOR"
|
||||||
#define NUM_DAYS_TO_CONSIDER_RECENT "NUM_DAYS_TO_CONSIDER_RECENT"
|
#define NUM_DAYS_TO_CONSIDER_RECENT "NUM_DAYS_TO_CONSIDER_RECENT"
|
||||||
|
Loading…
Reference in New Issue
Block a user