MCPcopy Create free account
hub / github.com/YACReader/yacreader / createCoverSizeSliderWidget

Method createCoverSizeSliderWidget

YACReaderLibrary/grid_comics_view.cpp:108–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106}
107
108void 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
140void GridComicsView::setToolBar(QToolBar *toolBar)
141{

Callers

nothing calls this directly

Calls 5

setRangeMethod · 0.80
setPixmapMethod · 0.80
pixmapMethod · 0.80
addSpacingMethod · 0.80
setValueMethod · 0.80

Tested by

no test coverage detected