Fixed UI bug in radio

This commit is contained in:
Ryzerth 2020-12-06 20:02:22 +01:00
parent fe1de4bed9
commit e5123dd8bf
10 changed files with 13 additions and 13 deletions

View File

@ -123,7 +123,6 @@ void windowInit() {
// TODO for 0.2.5 // TODO for 0.2.5
// Add "select folder" option for the file source // Add "select folder" option for the file source
// Fix SSB demod
// FIX AUDIO ISSUE ON BOTH LINUX AND SOMETIMES WINDOWS (probly the ring buffer, though double buffering could help) // FIX AUDIO ISSUE ON BOTH LINUX AND SOMETIMES WINDOWS (probly the ring buffer, though double buffering could help)
// Add default main config to avoid having to ship one // Add default main config to avoid having to ship one
// Have a good directory system on both linux and windows // Have a good directory system on both linux and windows

View File

@ -101,9 +101,9 @@ public:
setBandwidth(bw); setBandwidth(bw);
} }
ImGui::SetNextItemWidth(menuWidth - ImGui::CalcTextSize("Snap Interval").x - 8);
ImGui::Text("Snap Interval"); ImGui::Text("Snap Interval");
ImGui::SameLine(); ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::InputFloat(("##_radio_am_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, 0)) { if (ImGui::InputFloat(("##_radio_am_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, 0)) {
setSnapInterval(snapInterval); setSnapInterval(snapInterval);
} }

View File

@ -111,9 +111,9 @@ public:
setBandwidth(bw); setBandwidth(bw);
} }
ImGui::SetNextItemWidth(menuWidth - ImGui::CalcTextSize("Snap Interval").x - 8);
ImGui::Text("Snap Interval"); ImGui::Text("Snap Interval");
ImGui::SameLine(); ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::InputFloat(("##_radio_cw_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, 0)) { if (ImGui::InputFloat(("##_radio_cw_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, 0)) {
setSnapInterval(snapInterval); setSnapInterval(snapInterval);
} }

View File

@ -101,9 +101,9 @@ public:
setBandwidth(bw); setBandwidth(bw);
} }
ImGui::SetNextItemWidth(menuWidth - ImGui::CalcTextSize("Snap Interval").x - 8);
ImGui::Text("Snap Interval"); ImGui::Text("Snap Interval");
ImGui::SameLine(); ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::InputFloat(("##_radio_dsb_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, 0)) { if (ImGui::InputFloat(("##_radio_dsb_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, 0)) {
setSnapInterval(snapInterval); setSnapInterval(snapInterval);
} }

View File

@ -97,9 +97,9 @@ public:
setBandwidth(bw); setBandwidth(bw);
} }
ImGui::SetNextItemWidth(menuWidth - ImGui::CalcTextSize("Snap Interval").x - 8);
ImGui::Text("Snap Interval"); ImGui::Text("Snap Interval");
ImGui::SameLine(); ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::InputFloat(("##_radio_fm_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, 0)) { if (ImGui::InputFloat(("##_radio_fm_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, 0)) {
setSnapInterval(snapInterval); setSnapInterval(snapInterval);
} }

View File

@ -101,9 +101,9 @@ public:
setBandwidth(bw); setBandwidth(bw);
} }
ImGui::SetNextItemWidth(menuWidth - ImGui::CalcTextSize("Snap Interval").x - 8);
ImGui::Text("Snap Interval"); ImGui::Text("Snap Interval");
ImGui::SameLine(); ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::InputFloat(("##_radio_lsb_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, 0)) { if (ImGui::InputFloat(("##_radio_lsb_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, 0)) {
setSnapInterval(snapInterval); setSnapInterval(snapInterval);
} }

View File

@ -70,9 +70,9 @@ public:
void showMenu() { void showMenu() {
float menuWidth = ImGui::GetContentRegionAvailWidth(); float menuWidth = ImGui::GetContentRegionAvailWidth();
ImGui::SetNextItemWidth(menuWidth - ImGui::CalcTextSize("Snap Interval").x - 8);
ImGui::Text("Snap Interval"); ImGui::Text("Snap Interval");
ImGui::SameLine(); ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::InputFloat(("##_radio_raw_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, 0)) { if (ImGui::InputFloat(("##_radio_raw_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, 0)) {
setSnapInterval(snapInterval); setSnapInterval(snapInterval);
} }

View File

@ -101,9 +101,9 @@ public:
setBandwidth(bw); setBandwidth(bw);
} }
ImGui::SetNextItemWidth(menuWidth - ImGui::CalcTextSize("Snap Interval").x - 8);
ImGui::Text("Snap Interval"); ImGui::Text("Snap Interval");
ImGui::SameLine(); ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::InputFloat(("##_radio_usb_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, 0)) { if (ImGui::InputFloat(("##_radio_usb_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, 0)) {
setSnapInterval(snapInterval); setSnapInterval(snapInterval);
} }

View File

@ -104,16 +104,17 @@ public:
setBandwidth(bw); setBandwidth(bw);
} }
ImGui::SetNextItemWidth(menuWidth - ImGui::CalcTextSize("Snap Interval").x - 8);
ImGui::Text("Snap Interval"); ImGui::Text("Snap Interval");
ImGui::SameLine(); ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::InputFloat(("##_radio_wfm_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, 0)) { if (ImGui::InputFloat(("##_radio_wfm_snap_" + uiPrefix).c_str(), &snapInterval, 1, 100, 0)) {
setSnapInterval(snapInterval); setSnapInterval(snapInterval);
} }
ImGui::SetNextItemWidth(menuWidth - ImGui::CalcTextSize("De-emphasis").x - 8);
ImGui::Text("De-emphasis"); ImGui::Text("De-emphasis");
ImGui::SameLine(); ImGui::SameLine();
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::Combo(("##_radio_wfm_deemp_" + uiPrefix).c_str(), &deempId, deempModes)) { if (ImGui::Combo(("##_radio_wfm_deemp_" + uiPrefix).c_str(), &deempId, deempModes)) {
setDeempIndex(deempId); setDeempIndex(deempId);
} }

View File

@ -19,7 +19,7 @@
"bandPlan": "General", "bandPlan": "General",
"bandPlanEnabled": true, "bandPlanEnabled": true,
"fftHeight": 296, "fftHeight": 296,
"frequency": 95000000, "frequency": 99000000,
"max": 0.0, "max": 0.0,
"maximized": false, "maximized": false,
"menuOrder": [ "menuOrder": [
@ -42,7 +42,7 @@
"Radio": { "Radio": {
"muted": false, "muted": false,
"sink": "Audio", "sink": "Audio",
"volume": 0.831632673740387 "volume": 0.6887755393981934
}, },
"Radio 1": { "Radio 1": {
"muted": true, "muted": true,