mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-03-26 17:45:28 +01:00
Fixed UI and frequency manager bug
This commit is contained in:
parent
7d720e4d6f
commit
4a2774367f
@ -397,32 +397,35 @@ void MainWindow::draw() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Handle menu resize
|
// Handle menu resize
|
||||||
float curY = ImGui::GetCursorPosY();
|
|
||||||
ImVec2 winSize = ImGui::GetWindowSize();
|
ImVec2 winSize = ImGui::GetWindowSize();
|
||||||
ImVec2 mousePos = ImGui::GetMousePos();
|
ImVec2 mousePos = ImGui::GetMousePos();
|
||||||
bool click = ImGui::IsMouseClicked(ImGuiMouseButton_Left);
|
if (!lockWaterfallControls) {
|
||||||
bool down = ImGui::IsMouseDown(ImGuiMouseButton_Left);
|
float curY = ImGui::GetCursorPosY();
|
||||||
if (grabbingMenu) {
|
bool click = ImGui::IsMouseClicked(ImGuiMouseButton_Left);
|
||||||
newWidth = mousePos.x;
|
bool down = ImGui::IsMouseDown(ImGuiMouseButton_Left);
|
||||||
newWidth = std::clamp<float>(newWidth, 250, winSize.x - 250);
|
if (grabbingMenu) {
|
||||||
ImGui::GetForegroundDrawList()->AddLine(ImVec2(newWidth, curY), ImVec2(newWidth, winSize.y - 10), ImGui::GetColorU32(ImGuiCol_SeparatorActive));
|
newWidth = mousePos.x;
|
||||||
}
|
newWidth = std::clamp<float>(newWidth, 250, winSize.x - 250);
|
||||||
if (mousePos.x >= newWidth - 2 && mousePos.x <= newWidth + 2 && mousePos.y > curY) {
|
ImGui::GetForegroundDrawList()->AddLine(ImVec2(newWidth, curY), ImVec2(newWidth, winSize.y - 10), ImGui::GetColorU32(ImGuiCol_SeparatorActive));
|
||||||
ImGui::SetMouseCursor(ImGuiMouseCursor_ResizeEW);
|
}
|
||||||
if (click) {
|
if (mousePos.x >= newWidth - 2 && mousePos.x <= newWidth + 2 && mousePos.y > curY) {
|
||||||
grabbingMenu = true;
|
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
|
// Left Column
|
||||||
lockWaterfallControls = false;
|
lockWaterfallControls = false;
|
||||||
|
@ -167,11 +167,12 @@ private:
|
|||||||
static void moduleInterfaceHandler(int code, void* in, void* out, void* ctx) {
|
static void moduleInterfaceHandler(int code, void* in, void* out, void* ctx) {
|
||||||
RadioModule* _this = (RadioModule*)ctx;
|
RadioModule* _this = (RadioModule*)ctx;
|
||||||
if (code == RADIO_IFACE_CMD_GET_MODE) {
|
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) {
|
else if (code == RADIO_IFACE_CMD_SET_MODE) {
|
||||||
int in = *(int*)in;
|
int* _in = (int*)in;
|
||||||
if (in != _this->demodId) { _this->selectDemodById(in); }
|
if (*_in != _this->demodId) { _this->selectDemodById(*_in); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user