From 99441ea2eb0173efce95279029d2511ff343a8f4 Mon Sep 17 00:00:00 2001 From: ericek111 Date: Mon, 30 Aug 2021 00:12:13 +0200 Subject: [PATCH 1/2] soapy_source: always show the Refresh button --- soapy_source/src/main.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/soapy_source/src/main.cpp b/soapy_source/src/main.cpp index e73a1f1..13111d8 100644 --- a/soapy_source/src/main.cpp +++ b/soapy_source/src/main.cpp @@ -353,13 +353,18 @@ private: static void menuHandler(void* ctx) { SoapyModule* _this = (SoapyModule*)ctx; - - // If no device is available, do not attempt to display menu - if (_this->devId < 0) { - return; - } float menuWidth = ImGui::GetContentRegionAvailWidth(); + + // If no device is selected, draw just the refresh button + if (_this->devId < 0) { + if (ImGui::Button(CONCAT("Refresh##_dev_select_", _this->name), ImVec2(menuWidth, 0))) { + _this->refresh(); + _this->selectDevice(config.conf["device"]); + } + + return; + } if (_this->running) { style::beginDisabled(); } From ba6d9f720243745f1056e6584cbf8c108830cacc Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Mon, 30 Aug 2021 01:23:42 +0200 Subject: [PATCH 2/2] minor style change --- soapy_source/src/main.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/soapy_source/src/main.cpp b/soapy_source/src/main.cpp index 13111d8..8314fb2 100644 --- a/soapy_source/src/main.cpp +++ b/soapy_source/src/main.cpp @@ -356,13 +356,12 @@ private: float menuWidth = ImGui::GetContentRegionAvailWidth(); - // If no device is selected, draw just the refresh button + // If no device is selected, draw only the refresh button if (_this->devId < 0) { if (ImGui::Button(CONCAT("Refresh##_dev_select_", _this->name), ImVec2(menuWidth, 0))) { _this->refresh(); _this->selectDevice(config.conf["device"]); } - return; }