mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-01-27 01:54:44 +01:00
Fixed wonky center tuning behavior
This commit is contained in:
parent
2184e15e44
commit
9d34c6a8c1
@ -188,6 +188,7 @@ void MainWindow::init() {
|
|||||||
gui::waterfall.setFFTHeight(fftHeight);
|
gui::waterfall.setFFTHeight(fftHeight);
|
||||||
|
|
||||||
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;
|
||||||
|
gui::waterfall.VFOMoveSingleClick = (tuningMode == tuner::TUNER_MODE_CENTER);
|
||||||
|
|
||||||
core::configManager.release();
|
core::configManager.release();
|
||||||
|
|
||||||
@ -397,6 +398,7 @@ void MainWindow::draw() {
|
|||||||
ImGui::PushID(ImGui::GetID("sdrpp_ena_st_btn"));
|
ImGui::PushID(ImGui::GetID("sdrpp_ena_st_btn"));
|
||||||
if (ImGui::ImageButton(icons::CENTER_TUNING, ImVec2(30, 30), ImVec2(0, 0), ImVec2(1, 1), 5)) {
|
if (ImGui::ImageButton(icons::CENTER_TUNING, ImVec2(30, 30), ImVec2(0, 0), ImVec2(1, 1), 5)) {
|
||||||
tuningMode = tuner::TUNER_MODE_NORMAL;
|
tuningMode = tuner::TUNER_MODE_NORMAL;
|
||||||
|
gui::waterfall.VFOMoveSingleClick = false;
|
||||||
core::configManager.acquire();
|
core::configManager.acquire();
|
||||||
core::configManager.conf["centerTuning"] = false;
|
core::configManager.conf["centerTuning"] = false;
|
||||||
core::configManager.release(true);
|
core::configManager.release(true);
|
||||||
@ -407,6 +409,7 @@ void MainWindow::draw() {
|
|||||||
ImGui::PushID(ImGui::GetID("sdrpp_dis_st_btn"));
|
ImGui::PushID(ImGui::GetID("sdrpp_dis_st_btn"));
|
||||||
if (ImGui::ImageButton(icons::NORMAL_TUNING, ImVec2(30, 30), ImVec2(0, 0), ImVec2(1, 1), 5)) {
|
if (ImGui::ImageButton(icons::NORMAL_TUNING, ImVec2(30, 30), ImVec2(0, 0), ImVec2(1, 1), 5)) {
|
||||||
tuningMode = tuner::TUNER_MODE_CENTER;
|
tuningMode = tuner::TUNER_MODE_CENTER;
|
||||||
|
gui::waterfall.VFOMoveSingleClick = true;
|
||||||
tuner::tune(tuner::TUNER_MODE_CENTER, gui::waterfall.selectedVFO, gui::freqSelect.frequency);
|
tuner::tune(tuner::TUNER_MODE_CENTER, gui::waterfall.selectedVFO, gui::freqSelect.frequency);
|
||||||
core::configManager.acquire();
|
core::configManager.acquire();
|
||||||
core::configManager.conf["centerTuning"] = true;
|
core::configManager.conf["centerTuning"] = true;
|
||||||
@ -525,6 +528,8 @@ void MainWindow::draw() {
|
|||||||
firstMenuRender = true;
|
firstMenuRender = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ImGui::Checkbox("WF Single Click", &gui::waterfall.VFOMoveSingleClick);
|
||||||
|
|
||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -418,7 +418,7 @@ namespace ImGui {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Finally, if nothing else was selected, just move the VFO
|
// Finally, if nothing else was selected, just move the VFO
|
||||||
if (ImGui::IsMouseDown(ImGuiMouseButton_Left) && (mouseInFFT|mouseInWaterfall) && (mouseMoved || hoveredVFOName == "")) {
|
if ((VFOMoveSingleClick ? ImGui::IsMouseClicked(ImGuiMouseButton_Left) : ImGui::IsMouseDown(ImGuiMouseButton_Left)) && (mouseInFFT|mouseInWaterfall) && (mouseMoved || hoveredVFOName == "")) {
|
||||||
if (selVfo != NULL) {
|
if (selVfo != NULL) {
|
||||||
int refCenter = mousePos.x - (widgetPos.x + 50);
|
int refCenter = mousePos.x - (widgetPos.x + 50);
|
||||||
if (refCenter >= 0 && refCenter < dataWidth) {
|
if (refCenter >= 0 && refCenter < dataWidth) {
|
||||||
|
@ -175,6 +175,7 @@ namespace ImGui {
|
|||||||
};
|
};
|
||||||
|
|
||||||
bool inputHandled = false;
|
bool inputHandled = false;
|
||||||
|
bool VFOMoveSingleClick = false;
|
||||||
Event<InputHandlerArgs> onInputProcess;
|
Event<InputHandlerArgs> onInputProcess;
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user