From 311e4e8aeb5f349fdbc491d8a7a6336bbcec5268 Mon Sep 17 00:00:00 2001 From: Shaowen Yin Date: Sat, 30 Nov 2024 16:12:33 +0800 Subject: [PATCH] [bugfix](gui) clear nav_btns before switch provider (#887) --- feeluown/gui/uimain/provider_bar.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/feeluown/gui/uimain/provider_bar.py b/feeluown/gui/uimain/provider_bar.py index d1d129cff..638c04001 100644 --- a/feeluown/gui/uimain/provider_bar.py +++ b/feeluown/gui/uimain/provider_bar.py @@ -164,8 +164,10 @@ def _add_btn(self, btn): self._btn_layout.addWidget(btn) def _clear_btns(self): - for btn in self._btn_layout.children(): - btn.deleteLater() + for _ in range(self._btn_layout.count()): + item = self._btn_layout.takeAt(0) + item.widget().deleteLater() + del item def _create_playlist(self): provider_ui = self._app.current_pvd_ui_mgr.get()