MCPcopy Create free account
hub / github.com/BatchDrake/SigDigger / refreshHScrollBar

Method refreshHScrollBar

Components/SamplerDialog.cpp:253–276  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

251}
252
253void
254SamplerDialog::refreshHScrollBar(void) const
255{
256 unsigned int visible =
257 static_cast<unsigned>(this->ui->symView->width()) /
258 this->ui->symView->getZoom();
259
260 if (visible < this->ui->symView->getStride()) {
261 unsigned int max = this->ui->symView->getStride() - visible;
262 this->ui->horizontalScrollBar->setPageStep(static_cast<int>(visible));
263 this->ui->horizontalScrollBar->setMaximum(static_cast<int>(max));
264 this->ui->horizontalScrollBar->setVisible(true);
265 } else {
266 this->ui->horizontalScrollBar->setPageStep(static_cast<int>(0));
267 this->ui->horizontalScrollBar->setMaximum(static_cast<int>(0));
268 this->ui->horizontalScrollBar->setVisible(false);
269 }
270
271 if (!this->ui->symView->getAutoStride())
272 this->ui->horizontalScrollBar->setEnabled(
273 this->ui->symView->getLength() >= visible);
274 else
275 this->ui->horizontalScrollBar->setEnabled(false);
276}
277
278void
279SamplerDialog::refreshVScrollBar(void) const

Callers 3

feedSetMethod · 0.95
onStrideChangedMethod · 0.95
onSymViewZoomChangedMethod · 0.95

Calls 2

widthMethod · 0.80
setEnabledMethod · 0.45

Tested by

no test coverage detected