added clearing of the search field when switching tabs

This commit is contained in:
Sergey Palcheh
2025-08-11 17:06:54 +06:00
parent 2666ee33ad
commit 159fc26eca

View File

@@ -588,6 +588,7 @@ class WineHelperGUI(QMainWindow):
self.install_tabs_data = {} self.install_tabs_data = {}
self.current_selected_app = None self.current_selected_app = None
self.icon_animators = {} self.icon_animators = {}
self.previous_tab_index = 0
# Создаем главный виджет и layout # Создаем главный виджет и layout
self.main_widget = QWidget() self.main_widget = QWidget()
@@ -664,6 +665,17 @@ class WineHelperGUI(QMainWindow):
def on_tab_changed(self, index): 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) current_tab_text = self.tabs.tabText(index)
# Сбрасываем растяжение к состоянию по умолчанию: # Сбрасываем растяжение к состоянию по умолчанию: