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

pull/1338/head
AlexandreRouma 2024-02-21 21:59:55 +01:00
rodzic 7c933d5103
commit 021928bbda
3 zmienionych plików z 19 dodań i 7 usunięć

Wyświetl plik

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

Wyświetl plik

@ -127,15 +127,24 @@ namespace displaymenu {
uiScaleId = uiScales.valueId(style::uiScale);
}
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;
bool homePressed = ImGui::IsKeyPressed(ImGuiKey_Home, false);
if (ImGui::Checkbox("Show Waterfall##_sdrpp", &showWaterfall) || homePressed) {
if (homePressed) { showWaterfall = !showWaterfall; }
showWaterfall ? gui::waterfall.showWaterfall() : gui::waterfall.hideWaterfall();
core::configManager.acquire();
core::configManager.conf["showWaterfall"] = showWaterfall;
core::configManager.release(true);
if (ImGui::Checkbox("Show Waterfall##_sdrpp", &showWaterfall)) {
setWaterfallShown(showWaterfall);
}
if (ImGui::Checkbox("Full Waterfall Update##_sdrpp", &fullWaterfallUpdate)) {

Wyświetl plik

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