| 106 | } |
| 107 | |
| 108 | void GridComicsView::createCoverSizeSliderWidget() |
| 109 | { |
| 110 | coverSizeSliderWidget = new QWidget(this); |
| 111 | coverSizeSliderWidget->setFixedWidth(200); |
| 112 | coverSizeSlider = new QSlider(); |
| 113 | coverSizeSlider->setOrientation(Qt::Horizontal); |
| 114 | coverSizeSlider->setRange(YACREADER_MIN_GRID_ZOOM_WIDTH, YACREADER_MAX_GRID_ZOOM_WIDTH); |
| 115 | |
| 116 | const auto &comicsToolbar = theme.comicsViewToolbar; |
| 117 | |
| 118 | auto horizontalLayout = new QHBoxLayout(); |
| 119 | smallZoomLabel = new QLabel(); |
| 120 | smallZoomLabel->setPixmap(comicsToolbar.smallGridZoomIcon.pixmap(18, 18)); |
| 121 | horizontalLayout->addWidget(smallZoomLabel); |
| 122 | horizontalLayout->addWidget(coverSizeSlider, 0, Qt::AlignVCenter); |
| 123 | bigZoomLabel = new QLabel(); |
| 124 | bigZoomLabel->setPixmap(comicsToolbar.bigGridZoomIcon.pixmap(18, 18)); |
| 125 | horizontalLayout->addWidget(bigZoomLabel); |
| 126 | horizontalLayout->addSpacing(10); |
| 127 | horizontalLayout->setContentsMargins(0, 0, 0, 0); |
| 128 | |
| 129 | coverSizeSliderWidget->setLayout(horizontalLayout); |
| 130 | // TODO add shortcuts (ctrl-+ and ctrl-- for zooming in out, + ctrl-0 for reseting the zoom) |
| 131 | |
| 132 | connect(coverSizeSlider, &QAbstractSlider::valueChanged, this, &GridComicsView::setCoversSize); |
| 133 | |
| 134 | int coverSize = settings->value(COMICS_GRID_COVER_SIZES, YACREADER_MIN_COVER_WIDTH).toInt(); |
| 135 | |
| 136 | coverSizeSlider->setValue(coverSize); |
| 137 | setCoversSize(coverSize); |
| 138 | } |
| 139 | |
| 140 | void GridComicsView::setToolBar(QToolBar *toolBar) |
| 141 | { |
nothing calls this directly
no test coverage detected