From 159fc26eca23b50cb80ff0a2e15cc89e81fbf52f Mon Sep 17 00:00:00 2001 From: Sergey Palcheh Date: Mon, 11 Aug 2025 17:06:54 +0600 Subject: [PATCH] added clearing of the search field when switching tabs --- winehelper_gui.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/winehelper_gui.py b/winehelper_gui.py index 7caae3c..63e6435 100644 --- a/winehelper_gui.py +++ b/winehelper_gui.py @@ -588,6 +588,7 @@ class WineHelperGUI(QMainWindow): self.install_tabs_data = {} self.current_selected_app = None self.icon_animators = {} + self.previous_tab_index = 0 # Создаем главный виджет и layout self.main_widget = QWidget() @@ -664,6 +665,17 @@ class WineHelperGUI(QMainWindow): def on_tab_changed(self, index): """Скрывает или показывает панель информации в зависимости от активной вкладки.""" + # Очищаем поле поиска на вкладке, которую покинули + previous_widget = self.tabs.widget(self.previous_tab_index) + if previous_widget: + # Ищем QLineEdit в дочерних элементах + search_edit = previous_widget.findChild(QLineEdit) + if search_edit: + search_edit.clear() + + # Обновляем индекс предыдущей вкладки для следующего переключения + self.previous_tab_index = index + current_tab_text = self.tabs.tabText(index) # Сбрасываем растяжение к состоянию по умолчанию: