Merge pull request #328 from ericek111/master

soapy_source: always show the Refresh button
This commit is contained in:
AlexandreRouma 2021-08-30 03:01:42 +02:00 committed by GitHub
commit af59144f5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -353,13 +353,17 @@ 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 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;
}
if (_this->running) { style::beginDisabled(); }