From 289f14214f5d36491129659548b2cbcf57a45362 Mon Sep 17 00:00:00 2001 From: Adam Honse Date: Thu, 25 Feb 2021 13:47:59 -0600 Subject: [PATCH] Fix fan controller UI --- qt/OpenRGBDialog2/OpenRGBDialog2.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/qt/OpenRGBDialog2/OpenRGBDialog2.cpp b/qt/OpenRGBDialog2/OpenRGBDialog2.cpp index 246e0832f..1440ea727 100644 --- a/qt/OpenRGBDialog2/OpenRGBDialog2.cpp +++ b/qt/OpenRGBDialog2/OpenRGBDialog2.cpp @@ -1341,6 +1341,20 @@ void OpenRGBDialog2::UpdateDevicesList() } } + /*-----------------------------------------------------*\ + | Remove all remaining device tabs | + \*-----------------------------------------------------*/ + tab_count = ui->FanTabBar->count(); + for(unsigned int tab_idx = 0; tab_idx < tab_count; tab_idx++) + { + unsigned int remove_idx = ui->FanTabBar->count() - 1; + QWidget* tab_widget = ui->FanTabBar->widget(remove_idx); + + ui->FanTabBar->removeTab(remove_idx); + + delete tab_widget; + } + /*-----------------------------------------------------*\ | Set up list of fan devices | \*-----------------------------------------------------*/