Adds a preference parameter for scroll sensitivity of the scope.

No mechanism for manipulating this value is within wfview yet.
creator-widgets
Elliott Liggett 2023-09-23 13:03:38 -07:00
rodzic c8132bd1a1
commit b501c37171
4 zmienionych plików z 17 dodań i 3 usunięć

Wyświetl plik

@ -167,6 +167,8 @@ struct preferences {
int wftheme;
int plotFloor;
int plotCeiling;
int scopeScrollX;
int scopeScrollY;
QString stylesheetPath;
unsigned int wflength;
bool confirmExit;

Wyświetl plik

@ -1079,11 +1079,14 @@ void spectrumScope::waterfallClick(QMouseEvent *me)
void spectrumScope::scroll(QWheelEvent *we)
{
// angleDelta is supposed to be eights of a degree of mouse wheel rotation
int clicks = we->angleDelta().y() / scrollYperClick;
int clicks = we->angleDelta().y() / 120;
if (!(we->angleDelta().y() / 120))
if (!clicks) {
qInfo() << "Rejecting minor scroll motion, too small. Clicks: " << clicks << ", angleDelta: " << we->angleDelta().y();
qInfo() << "ScrollY per click: " << scrollYperClick;
return;
}
unsigned int stepsHz = stepSize;

Wyświetl plik

@ -54,6 +54,7 @@ public:
void setTuningFloorZeros(bool tf) {this->tuningFloorZeros = tf;}
void setClickDragTuning(bool cg) { this->clickDragTuning = cg;}
void setScrollSpeedXY(int clicksX, int clicksY) { this->scrollXperClick = clicksX; this->scrollYperClick = clicksY;}
void enableScope(bool en);
@ -199,6 +200,8 @@ private:
double oldPlotCeiling = 999;
double mousePressFreq = 0.0;
double mouseReleaseFreq = 0.0;
int scrollYperClick = 24;
int scrollXperClick = 24;
passbandActions passbandAction = passbandStatic;

Wyświetl plik

@ -1271,11 +1271,13 @@ void wfmain::setUIToPrefs()
ui->mainScope->wfAntiAliased(prefs.wfAntiAlias);
ui->mainScope->wfInterpolate(prefs.wfInterpolate);
ui->mainScope->wfTheme(prefs.wftheme);
ui->mainScope->setScrollSpeedXY(prefs.scopeScrollX, prefs.scopeScrollY);
ui->subScope->setUnderlayMode(prefs.underlayMode);
ui->subScope->wfAntiAliased(prefs.wfAntiAlias);
ui->subScope->wfInterpolate(prefs.wfInterpolate);
ui->subScope->wfTheme(prefs.wftheme);
ui->subScope->setScrollSpeedXY(prefs.scopeScrollX, prefs.scopeScrollY);
// switch(underlayMode)
// {
@ -1800,6 +1802,8 @@ void wfmain::setDefPrefs()
defPrefs.wftheme = static_cast<int>(QCPColorGradient::gpJet);
defPrefs.plotFloor = 0;
defPrefs.plotCeiling = 160;
defPrefs.scopeScrollX = 16;
defPrefs.scopeScrollY = 16;
defPrefs.confirmExit = true;
defPrefs.confirmPowerOff = true;
defPrefs.meter2Type = meterNone;
@ -1851,6 +1855,8 @@ void wfmain::loadSettings()
prefs.wftheme = settings->value("WFTheme", defPrefs.wftheme).toInt();
prefs.plotFloor = settings->value("plotFloor", defPrefs.plotFloor).toInt();
prefs.plotCeiling = settings->value("plotCeiling", defPrefs.plotCeiling).toInt();
prefs.scopeScrollX = settings->value("scopeScrollX", defPrefs.scopeScrollX).toInt();
prefs.scopeScrollY = settings->value("scopeScrollY", defPrefs.scopeScrollY).toInt();
plotFloor = prefs.plotFloor;
plotCeiling = prefs.plotCeiling;
wfFloor = prefs.plotFloor;