| 379 | } |
| 380 | |
| 381 | QWidget *OptionsDialog::createGridTab() |
| 382 | { |
| 383 | // grid view background config |
| 384 | useBackgroundImageCheck = new QCheckBox(tr("Enable background image")); |
| 385 | |
| 386 | opacityLabel = new QLabel(tr("Opacity level")); |
| 387 | |
| 388 | backgroundImageOpacitySlider = new QSlider(Qt::Horizontal); |
| 389 | backgroundImageOpacitySlider->setRange(5, 100); |
| 390 | |
| 391 | blurLabel = new QLabel(tr("Blur level")); |
| 392 | |
| 393 | backgroundImageBlurRadiusSlider = new QSlider(Qt::Horizontal); |
| 394 | backgroundImageBlurRadiusSlider->setRange(0, 100); |
| 395 | |
| 396 | useCurrentComicCoverCheck = new QCheckBox(tr("Use selected comic cover as background")); |
| 397 | |
| 398 | resetButton = new QPushButton(tr("Restore defautls")); |
| 399 | |
| 400 | auto gridBackgroundLayout = new QVBoxLayout(); |
| 401 | gridBackgroundLayout->addWidget(useBackgroundImageCheck); |
| 402 | gridBackgroundLayout->addWidget(opacityLabel); |
| 403 | gridBackgroundLayout->addWidget(backgroundImageOpacitySlider); |
| 404 | gridBackgroundLayout->addWidget(blurLabel); |
| 405 | gridBackgroundLayout->addWidget(backgroundImageBlurRadiusSlider); |
| 406 | gridBackgroundLayout->addWidget(useCurrentComicCoverCheck); |
| 407 | gridBackgroundLayout->addWidget(resetButton, 0, Qt::AlignRight); |
| 408 | |
| 409 | auto gridBackgroundGroup = new QGroupBox(tr("Background")); |
| 410 | gridBackgroundGroup->setLayout(gridBackgroundLayout); |
| 411 | |
| 412 | displayGlobalContinueReadingBannerCheck = new QCheckBox(tr("Display continue reading banner")); |
| 413 | displayContinueReadingBannerCheck = new QCheckBox(tr("Display current comic banner")); |
| 414 | |
| 415 | auto continueReadingLayout = new QVBoxLayout(); |
| 416 | continueReadingLayout->addWidget(displayGlobalContinueReadingBannerCheck); |
| 417 | continueReadingLayout->addWidget(displayContinueReadingBannerCheck); |
| 418 | |
| 419 | auto continueReadingGroup = new QGroupBox(tr("Continue reading")); |
| 420 | continueReadingGroup->setLayout(continueReadingLayout); |
| 421 | |
| 422 | connect(useBackgroundImageCheck, &QAbstractButton::clicked, this, &OptionsDialog::useBackgroundImageCheckClicked); |
| 423 | connect(backgroundImageOpacitySlider, &QAbstractSlider::valueChanged, this, &OptionsDialog::backgroundImageOpacitySliderChanged); |
| 424 | connect(backgroundImageBlurRadiusSlider, &QAbstractSlider::valueChanged, this, &OptionsDialog::backgroundImageBlurRadiusSliderChanged); |
| 425 | connect(useCurrentComicCoverCheck, &QCheckBox::clicked, this, &OptionsDialog::useCurrentComicCoverCheckClicked); |
| 426 | connect(resetButton, &QPushButton::clicked, this, &OptionsDialog::resetToDefaults); |
| 427 | // end grid view background config |
| 428 | |
| 429 | connect(displayGlobalContinueReadingBannerCheck, &QCheckBox::clicked, this, [this]() { |
| 430 | this->settings->setValue(DISPLAY_GLOBAL_CONTINUE_READING_IN_GRID_VIEW, this->displayGlobalContinueReadingBannerCheck->isChecked()); |
| 431 | |
| 432 | emit optionsChanged(); |
| 433 | }); |
| 434 | |
| 435 | connect(displayContinueReadingBannerCheck, &QCheckBox::clicked, this, [this]() { |
| 436 | this->settings->setValue(DISPLAY_CONTINUE_READING_IN_GRID_VIEW, this->displayContinueReadingBannerCheck->isChecked()); |
| 437 | |
| 438 | emit optionsChanged(); |