diff --git a/portprotonqt/dialogs.py b/portprotonqt/dialogs.py index 9cb0a90..f44bf4f 100644 --- a/portprotonqt/dialogs.py +++ b/portprotonqt/dialogs.py @@ -4,7 +4,7 @@ import re from typing import cast, TYPE_CHECKING from PySide6.QtGui import QPixmap, QIcon from PySide6.QtWidgets import ( - QDialog, QFormLayout, QHBoxLayout, QLabel, QVBoxLayout, QListWidget, QScrollArea, QWidget, QListWidgetItem, QSizePolicy, QApplication, QProgressBar + QDialog, QFormLayout, QHBoxLayout, QLabel, QVBoxLayout, QListWidget, QScrollArea, QWidget, QListWidgetItem, QSizePolicy, QApplication, QProgressBar, QScroller ) from PySide6.QtCore import Qt, QObject, Signal, QMimeDatabase, QTimer, QThreadPool, QRunnable, Slot from icoextract import IconExtractor, IconExtractorError @@ -374,6 +374,9 @@ class FileExplorer(QDialog): self.file_list.itemDoubleClicked.connect(self.handle_item_double_click) self.file_list.setContextMenuPolicy(Qt.ContextMenuPolicy.CustomContextMenu) self.file_list.customContextMenuRequested.connect(self.show_folder_context_menu) + self.file_list.setHorizontalScrollMode(QListWidget.ScrollMode.ScrollPerPixel) + self.file_list.setVerticalScrollMode(QListWidget.ScrollMode.ScrollPerPixel) + QScroller.grabGesture(self.file_list.viewport(), QScroller.ScrollerGestureType.LeftMouseButtonGesture) self.main_layout.addWidget(self.file_list) # Connect scroll signal for lazy loading diff --git a/portprotonqt/main_window.py b/portprotonqt/main_window.py index 7d06c8e..a250a8d 100644 --- a/portprotonqt/main_window.py +++ b/portprotonqt/main_window.py @@ -36,7 +36,7 @@ from portprotonqt.downloader import Downloader from portprotonqt.tray_manager import TrayManager from PySide6.QtWidgets import (QLineEdit, QMainWindow, QStatusBar, QWidget, QVBoxLayout, QLabel, QHBoxLayout, QStackedWidget, QComboBox, QScrollArea, QSlider, - QDialog, QFormLayout, QFrame, QGraphicsDropShadowEffect, QMessageBox, QApplication, QPushButton, QProgressBar, QCheckBox, QSizePolicy) + QDialog, QFormLayout, QFrame, QGraphicsDropShadowEffect, QMessageBox, QApplication, QPushButton, QProgressBar, QCheckBox, QSizePolicy, QScroller) from PySide6.QtCore import Qt, QAbstractAnimation, QUrl, Signal, QTimer, Slot from PySide6.QtGui import QIcon, QPixmap, QColor, QDesktopServices from typing import cast @@ -865,6 +865,7 @@ class MainWindow(QMainWindow): scrollArea = QScrollArea() scrollArea.setWidgetResizable(True) scrollArea.setStyleSheet(self.theme.SCROLL_AREA_STYLE) + QScroller.grabGesture(scrollArea.viewport(), QScroller.ScrollerGestureType.LeftMouseButtonGesture) self.gamesListWidget = QWidget() self.gamesListWidget.setStyleSheet(self.theme.LIST_WIDGET_STYLE)