#include "whats_new_dialog.h" #include "yacreader_global.h" #include #include #include #include #include #include #include YACReader::WhatsNewDialog::WhatsNewDialog(QWidget *parent) : RoundedCornersDialog(parent) { auto scrollArea = new QScrollArea(this); scrollArea->setStyleSheet("background-color:transparent;" "border:none;"); scrollArea->horizontalScrollBar()->setStyleSheet("QScrollBar {height:0px;}"); scrollArea->verticalScrollBar()->setStyleSheet("QScrollBar {width:0px;}"); scrollArea->setContentsMargins(0, 0, 0, 0); auto mainLayout = new QVBoxLayout(this); mainLayout->setContentsMargins(0, 0, 0, 0); auto contentLayout = new QGridLayout(); auto content = new QFrame(); content->setStyleSheet("background-color:transparent;" "border:none;"); headerImageLabel = new QLabel(); headerLabel = new QLabel(); headerLabel->setText("What's New in\nYACReader"); QFont headerLabelFont("Arial", 34, QFont::ExtraBold); headerLabel->setFont(headerLabelFont); headerLabel->setAlignment(Qt::AlignCenter); versionLabel = new QLabel(); versionLabel->setText(VERSION); QFont versionLabelFont("Arial", 12, QFont::Normal); versionLabel->setFont(versionLabelFont); versionLabel->setAlignment(Qt::AlignCenter); textLabel = new QLabel(); htmlTemplate = "YACReader 10 is finally here!! This is all the exciting new features and improvements:
" "
" "YACReader
" " • Add support for continuous scroll mode
" " • Fix the translator
" " • Add Lanczos interpolation for image scaling. You can control the method used via the settings under Image adjustments
" " • Fix hdpi trackpad scrolling when scroll animations are enabled
" "
" "YACReaderLibrary
" " • Navigating between comics in the metadata editor no longer copies fields from the previous comic into ones that have no value set. To edit shared metadata across multiple comics at once, select them all and use the bulk edit dialog
" "
" "All GUI Apps
" " • Migrate Flow implementation from OpenGL to QRhi. This is a full new implementation with better performance and compatibility with operating systems and hardware
" " • Add light/dark themes support that follow the system configuration
" " • Add a theme editor and support for custom themes
" " • The apps include 12 built in themes to pick from
" " • Add an application language setting with a system default option in YACReader and YACReaderLibrary
" " • Fix fullscreen mode in Windows, interaction with the OS is now possible while the apps are in fullscreen
" " • Improve support for multi-screen setups
" "
" "All apps
" " • Add support for user-installed Qt image format plugins via the shared plugins/imageformats folder in the YACReader settings directory
" "
" "I hope you enjoy the new update. Please, if you like YACReader consider to become a patron in Patreon " "or donate some money using Pay-Pal and help keeping the project alive. " "Remember that there is an iOS version available in the Apple App Store, " "and there is a brand new app for Android that you can get on the Google Play Store."; QFont textLabelFont("Arial", 15, QFont::Light); textLabel->setFont(textLabelFont); textLabel->setWordWrap(true); textLabel->setOpenExternalLinks(true); contentLayout->addItem(new QSpacerItem(0, 50), 0, 0); contentLayout->addWidget(headerImageLabel, 1, 0, Qt::AlignTop | Qt::AlignHCenter); contentLayout->addWidget(headerLabel, 1, 0, Qt::AlignTop | Qt::AlignHCenter); contentLayout->addWidget(versionLabel, 2, 0, Qt::AlignTop | Qt::AlignHCenter); contentLayout->addWidget(textLabel, 3, 0, Qt::AlignTop); contentLayout->setRowStretch(3, 1); content->setLayout(contentLayout); mainLayout->addWidget(scrollArea); scrollArea->setWidget(content); scrollArea->setWidgetResizable(true); this->setLayout(mainLayout); closeButton = new QPushButton(this); closeButton->setFlat(true); closeButton->setStyleSheet("background-color:transparent;"); closeButton->setIconSize(QSize(44, 44)); closeButton->setFixedSize(44, 44); closeButton->move(656, 20); scrollArea->setFixedSize(720, 640); setFixedSize(720, 640); setModal(true); connect(closeButton, &QPushButton::clicked, this, &QDialog::close); initTheme(this); } void YACReader::WhatsNewDialog::applyTheme(const Theme &theme) { auto whatsNewTheme = theme.whatsNewDialog; setBackgroundColor(whatsNewTheme.backgroundColor); headerImageLabel->setPixmap(whatsNewTheme.headerDecoration); headerImageLabel->setFixedSize(whatsNewTheme.headerDecoration.size()); headerLabel->setStyleSheet(QString("padding: 18px 0 0 0;" "background-color:transparent;" "color:%1;") .arg(whatsNewTheme.headerTextColor.name())); versionLabel->setStyleSheet(QString("padding:0 0 0 0;" "background-color:transparent;" "color:%1;") .arg(whatsNewTheme.versionTextColor.name())); textLabel->setStyleSheet(QString("padding:51px;" "background-color:transparent;" "color:%1;") .arg(whatsNewTheme.contentTextColor.name())); textLabel->setText(htmlTemplate.arg(whatsNewTheme.linkColor.name())); closeButton->setIcon(whatsNewTheme.closeButtonIcon); }