File tree Expand file tree Collapse file tree 3 files changed +19
-7
lines changed
Expand file tree Collapse file tree 3 files changed +19
-7
lines changed Original file line number Diff line number Diff line change @@ -463,6 +463,8 @@ void MainWindow::draw() {
463463 }
464464 }
465465
466+ // Process menu keybinds
467+ displaymenu::checkKeybinds ();
466468
467469 // Left Column
468470 lockWaterfallControls = false ;
Original file line number Diff line number Diff line change @@ -127,15 +127,24 @@ namespace displaymenu {
127127 uiScaleId = uiScales.valueId (style::uiScale);
128128 }
129129
130+ void setWaterfallShown (bool shown) {
131+ showWaterfall = shown;
132+ showWaterfall ? gui::waterfall.showWaterfall () : gui::waterfall.hideWaterfall ();
133+ core::configManager.acquire ();
134+ core::configManager.conf [" showWaterfall" ] = showWaterfall;
135+ core::configManager.release (true );
136+ }
137+
138+ void checkKeybinds () {
139+ if (ImGui::IsKeyPressed (ImGuiKey_Home, false )) {
140+ setWaterfallShown (!showWaterfall);
141+ }
142+ }
143+
130144 void draw (void * ctx) {
131145 float menuWidth = ImGui::GetContentRegionAvail ().x ;
132- bool homePressed = ImGui::IsKeyPressed (ImGuiKey_Home, false );
133- if (ImGui::Checkbox (" Show Waterfall##_sdrpp" , &showWaterfall) || homePressed) {
134- if (homePressed) { showWaterfall = !showWaterfall; }
135- showWaterfall ? gui::waterfall.showWaterfall () : gui::waterfall.hideWaterfall ();
136- core::configManager.acquire ();
137- core::configManager.conf [" showWaterfall" ] = showWaterfall;
138- core::configManager.release (true );
146+ if (ImGui::Checkbox (" Show Waterfall##_sdrpp" , &showWaterfall)) {
147+ setWaterfallShown (showWaterfall);
139148 }
140149
141150 if (ImGui::Checkbox (" Full Waterfall Update##_sdrpp" , &fullWaterfallUpdate)) {
Original file line number Diff line number Diff line change 22
33namespace displaymenu {
44 void init ();
5+ void checkKeybinds ();
56 void draw (void * ctx);
67}
You can’t perform that action at this time.
0 commit comments