merge upstream
This commit is contained in:
@@ -313,12 +313,12 @@ class MainWindow(QMainWindow):
|
||||
def makeHint(icon_name: str, action_text: str, is_gamepad: bool, action: str | None = None,):
|
||||
container = QWidget()
|
||||
layout = QHBoxLayout(container)
|
||||
layout.setContentsMargins(0, 0, 0, 0)
|
||||
layout.setContentsMargins(0, 5, 0, 0)
|
||||
layout.setSpacing(6)
|
||||
|
||||
# иконка кнопки
|
||||
icon_label = QLabel()
|
||||
icon_label.setFixedSize(32, 32)
|
||||
icon_label.setFixedSize(26, 26)
|
||||
icon_label.setAlignment(Qt.AlignmentFlag.AlignCenter)
|
||||
|
||||
pixmap = QPixmap()
|
||||
@@ -331,7 +331,7 @@ class MainWindow(QMainWindow):
|
||||
|
||||
if not pixmap.isNull():
|
||||
icon_label.setPixmap(pixmap.scaled(
|
||||
32, 32,
|
||||
26, 26,
|
||||
Qt.AspectRatioMode.KeepAspectRatio,
|
||||
Qt.TransformationMode.SmoothTransformation
|
||||
))
|
||||
@@ -424,7 +424,7 @@ class MainWindow(QMainWindow):
|
||||
pixmap.load(str(icon_path))
|
||||
if not pixmap.isNull():
|
||||
icon_label.setPixmap(pixmap.scaled(
|
||||
32, 32,
|
||||
26, 26,
|
||||
Qt.AspectRatioMode.KeepAspectRatio,
|
||||
Qt.TransformationMode.SmoothTransformation
|
||||
))
|
||||
@@ -433,7 +433,7 @@ class MainWindow(QMainWindow):
|
||||
placeholder = self.theme_manager.get_theme_image("placeholder", self.current_theme_name)
|
||||
if placeholder:
|
||||
pixmap.load(str(placeholder))
|
||||
icon_label.setPixmap(pixmap.scaled(32, 32, Qt.AspectRatioMode.KeepAspectRatio, Qt.TransformationMode.SmoothTransformation))
|
||||
icon_label.setPixmap(pixmap.scaled(26, 26, Qt.AspectRatioMode.KeepAspectRatio, Qt.TransformationMode.SmoothTransformation))
|
||||
else:
|
||||
container.setVisible(False)
|
||||
else: # Keyboard hint
|
||||
@@ -760,11 +760,22 @@ class MainWindow(QMainWindow):
|
||||
self.searchDebounceTimer = QTimer(self)
|
||||
self.searchDebounceTimer.setSingleShot(True)
|
||||
self.searchDebounceTimer.setInterval(300)
|
||||
self.searchDebounceTimer.timeout.connect(self.game_library_manager.filter_games_delayed)
|
||||
self.searchDebounceTimer.timeout.connect(self.on_search_changed)
|
||||
|
||||
layout.addWidget(self.searchEdit)
|
||||
return self.container, self.searchEdit
|
||||
|
||||
def on_search_text_changed(self, text: str):
|
||||
"""Search text change handler with debounce."""
|
||||
self.searchDebounceTimer.stop()
|
||||
self.searchDebounceTimer.start()
|
||||
|
||||
@Slot()
|
||||
def on_search_changed(self):
|
||||
"""Triggers filtering with delay."""
|
||||
if hasattr(self, 'game_library_manager'):
|
||||
self.game_library_manager.filter_games_delayed()
|
||||
|
||||
def startSearchDebounce(self, text):
|
||||
self.searchDebounceTimer.start()
|
||||
|
||||
|
Reference in New Issue
Block a user