mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-01-24 08:44:44 +01:00
More UI bugfix
This commit is contained in:
parent
6cca4c654f
commit
eb48dd70fb
@ -196,6 +196,21 @@ void MainWindow::init() {
|
|||||||
tuningMode = core::configManager.conf["centerTuning"] ? tuner::TUNER_MODE_CENTER : tuner::TUNER_MODE_NORMAL;
|
tuningMode = core::configManager.conf["centerTuning"] ? tuner::TUNER_MODE_CENTER : tuner::TUNER_MODE_NORMAL;
|
||||||
|
|
||||||
core::configManager.release();
|
core::configManager.release();
|
||||||
|
|
||||||
|
// Correct the offset of all VFOs so that they fit on the screen
|
||||||
|
float finalBwHalf = gui::waterfall.getBandwidth() / 2.0;
|
||||||
|
for (auto& [_name, _vfo] : gui::waterfall.vfos) {
|
||||||
|
if (_vfo->lowerOffset < -finalBwHalf) {
|
||||||
|
sigpath::vfoManager.setCenterOffset(_name, (_vfo->bandwidth/2)-finalBwHalf);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (_vfo->upperOffset > finalBwHalf) {
|
||||||
|
sigpath::vfoManager.setCenterOffset(_name, finalBwHalf-(_vfo->bandwidth/2));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
initComplete = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::fftHandler(dsp::complex_t* samples, int count, void* ctx) {
|
void MainWindow::fftHandler(dsp::complex_t* samples, int count, void* ctx) {
|
||||||
@ -233,7 +248,8 @@ void MainWindow::vfoAddedHandler(VFOManager::VFO* vfo, void* ctx) {
|
|||||||
}
|
}
|
||||||
double offset = core::configManager.conf["vfoOffsets"][name];
|
double offset = core::configManager.conf["vfoOffsets"][name];
|
||||||
core::configManager.release();
|
core::configManager.release();
|
||||||
sigpath::vfoManager.setOffset(name, std::clamp<double>(offset, -_this->bw/2.0, _this->bw/2.0));
|
|
||||||
|
sigpath::vfoManager.setOffset(name, _this->initComplete ? std::clamp<double>(offset, -_this->bw/2.0, _this->bw/2.0) : offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::draw() {
|
void MainWindow::draw() {
|
||||||
|
@ -65,6 +65,8 @@ private:
|
|||||||
bool demoWindow = false;
|
bool demoWindow = false;
|
||||||
int selectedWindow = 0;
|
int selectedWindow = 0;
|
||||||
|
|
||||||
|
bool initComplete = false;
|
||||||
|
|
||||||
EventHandler<VFOManager::VFO*> vfoCreatedHandler;
|
EventHandler<VFOManager::VFO*> vfoCreatedHandler;
|
||||||
|
|
||||||
};
|
};
|
@ -1151,8 +1151,8 @@ namespace ImGui {
|
|||||||
int _right = right;
|
int _right = right;
|
||||||
left = std::clamp<int>(left, 0, dataWidth - 1);
|
left = std::clamp<int>(left, 0, dataWidth - 1);
|
||||||
right = std::clamp<int>(right, 0, dataWidth - 1);
|
right = std::clamp<int>(right, 0, dataWidth - 1);
|
||||||
if (left != _left) { leftClamped = true; }
|
leftClamped = (left != _left);
|
||||||
if (right != _right) { rightClamped = true; }
|
rightClamped = (right != _right);
|
||||||
|
|
||||||
rectMin = ImVec2(widgetPos.x + 50 + left, widgetPos.y + 10);
|
rectMin = ImVec2(widgetPos.x + 50 + left, widgetPos.y + 10);
|
||||||
rectMax = ImVec2(widgetPos.x + 51 + right, widgetPos.y + fftHeight + 10);
|
rectMax = ImVec2(widgetPos.x + 51 + right, widgetPos.y + fftHeight + 10);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user