forked from CastroFidel/winehelper
		
	added clearing of the search field when switching tabs
This commit is contained in:
		| @@ -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) | ||||
|  | ||||
|         # Сбрасываем растяжение к состоянию по умолчанию: | ||||
|   | ||||
		Reference in New Issue
	
	Block a user