fix show/hide waterfall keybind not working with the Display menu hidden

This commit is contained in:
AlexandreRouma 2024-02-21 21:59:55 +01:00
parent 7c933d5103
commit 021928bbda
3 changed files with 19 additions and 7 deletions

View File

@ -463,6 +463,8 @@ void MainWindow::draw() {
}
}
// Process menu keybinds
displaymenu::checkKeybinds();
// Left Column
lockWaterfallControls = false;

View File

@ -127,17 +127,26 @@ namespace displaymenu {
uiScaleId = uiScales.valueId(style::uiScale);
}
void draw(void* ctx) {
float menuWidth = ImGui::GetContentRegionAvail().x;
bool homePressed = ImGui::IsKeyPressed(ImGuiKey_Home, false);
if (ImGui::Checkbox("Show Waterfall##_sdrpp", &showWaterfall) || homePressed) {
if (homePressed) { showWaterfall = !showWaterfall; }
void setWaterfallShown(bool shown) {
showWaterfall = shown;
showWaterfall ? gui::waterfall.showWaterfall() : gui::waterfall.hideWaterfall();
core::configManager.acquire();
core::configManager.conf["showWaterfall"] = showWaterfall;
core::configManager.release(true);
}
void checkKeybinds() {
if (ImGui::IsKeyPressed(ImGuiKey_Home, false)) {
setWaterfallShown(!showWaterfall);
}
}
void draw(void* ctx) {
float menuWidth = ImGui::GetContentRegionAvail().x;
if (ImGui::Checkbox("Show Waterfall##_sdrpp", &showWaterfall)) {
setWaterfallShown(showWaterfall);
}
if (ImGui::Checkbox("Full Waterfall Update##_sdrpp", &fullWaterfallUpdate)) {
gui::waterfall.setFullWaterfallUpdate(fullWaterfallUpdate);
core::configManager.acquire();

View File

@ -2,5 +2,6 @@
namespace displaymenu {
void init();
void checkKeybinds();
void draw(void* ctx);
}