diff --git a/core/src/gui/main_window.cpp b/core/src/gui/main_window.cpp index 4a872d4a..dda82237 100644 --- a/core/src/gui/main_window.cpp +++ b/core/src/gui/main_window.cpp @@ -397,32 +397,35 @@ void MainWindow::draw() { } // Handle menu resize - float curY = ImGui::GetCursorPosY(); ImVec2 winSize = ImGui::GetWindowSize(); ImVec2 mousePos = ImGui::GetMousePos(); - bool click = ImGui::IsMouseClicked(ImGuiMouseButton_Left); - bool down = ImGui::IsMouseDown(ImGuiMouseButton_Left); - if (grabbingMenu) { - newWidth = mousePos.x; - newWidth = std::clamp(newWidth, 250, winSize.x - 250); - ImGui::GetForegroundDrawList()->AddLine(ImVec2(newWidth, curY), ImVec2(newWidth, winSize.y - 10), ImGui::GetColorU32(ImGuiCol_SeparatorActive)); - } - if (mousePos.x >= newWidth - 2 && mousePos.x <= newWidth + 2 && mousePos.y > curY) { - ImGui::SetMouseCursor(ImGuiMouseCursor_ResizeEW); - if (click) { - grabbingMenu = true; + if (!lockWaterfallControls) { + float curY = ImGui::GetCursorPosY(); + bool click = ImGui::IsMouseClicked(ImGuiMouseButton_Left); + bool down = ImGui::IsMouseDown(ImGuiMouseButton_Left); + if (grabbingMenu) { + newWidth = mousePos.x; + newWidth = std::clamp(newWidth, 250, winSize.x - 250); + ImGui::GetForegroundDrawList()->AddLine(ImVec2(newWidth, curY), ImVec2(newWidth, winSize.y - 10), ImGui::GetColorU32(ImGuiCol_SeparatorActive)); + } + if (mousePos.x >= newWidth - 2 && mousePos.x <= newWidth + 2 && mousePos.y > curY) { + ImGui::SetMouseCursor(ImGuiMouseCursor_ResizeEW); + if (click) { + grabbingMenu = true; + } + } + else { + ImGui::SetMouseCursor(ImGuiMouseCursor_Arrow); + } + if(!down && grabbingMenu) { + grabbingMenu = false; + menuWidth = newWidth; + core::configManager.aquire(); + core::configManager.conf["menuWidth"] = menuWidth; + core::configManager.release(true); } } - else { - ImGui::SetMouseCursor(ImGuiMouseCursor_Arrow); - } - if(!down && grabbingMenu) { - grabbingMenu = false; - menuWidth = newWidth; - core::configManager.aquire(); - core::configManager.conf["menuWidth"] = menuWidth; - core::configManager.release(true); - } + // Left Column lockWaterfallControls = false; diff --git a/radio/src/main.cpp b/radio/src/main.cpp index 11c467d1..7c009861 100644 --- a/radio/src/main.cpp +++ b/radio/src/main.cpp @@ -167,11 +167,12 @@ private: static void moduleInterfaceHandler(int code, void* in, void* out, void* ctx) { RadioModule* _this = (RadioModule*)ctx; if (code == RADIO_IFACE_CMD_GET_MODE) { - *(int*)out = _this->demodId; + int* _out = (int*)out; + *_out = _this->demodId; } else if (code == RADIO_IFACE_CMD_SET_MODE) { - int in = *(int*)in; - if (in != _this->demodId) { _this->selectDemodById(in); } + int* _in = (int*)in; + if (*_in != _this->demodId) { _this->selectDemodById(*_in); } } }