|
1 | | -from PySide6.QtCore import Signal |
2 | | -from PySide6.QtWidgets import QHBoxLayout, QVBoxLayout, QWidget |
| 1 | +from PySide6.QtCore import Signal, Qt |
| 2 | +from PySide6.QtWidgets import QHBoxLayout, QScrollArea, QVBoxLayout, QWidget |
3 | 3 | from qfluentwidgets import ( |
4 | 4 | BodyLabel, FlowLayout, MessageBoxBase, SubtitleLabel, ListWidget, PushButton, FluentIcon, |
5 | 5 | LineEdit |
@@ -58,7 +58,14 @@ def __init__(self, items, parent, options_available=None, allow_duplication=Fals |
58 | 58 | available_layout = QVBoxLayout() |
59 | 59 | available_layout.addWidget(SubtitleLabel(self.tr("Available Options"), self)) |
60 | 60 | available_layout.addWidget(BodyLabel(self.tr("Click an option to add it."), self)) |
61 | | - available_layout.addWidget(self._create_available_options_widget(), stretch=1) |
| 61 | + available_scroll_area = QScrollArea(self) |
| 62 | + available_scroll_area.setWidgetResizable(True) |
| 63 | + available_scroll_area.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff) |
| 64 | + available_scroll_area.setFrameShape(QScrollArea.NoFrame) |
| 65 | + available_scroll_area.setStyleSheet("QScrollArea { background-color: transparent; border: none; }") |
| 66 | + available_scroll_area.viewport().setStyleSheet("background-color: transparent;") |
| 67 | + available_scroll_area.setWidget(self._create_available_options_widget()) |
| 68 | + available_layout.addWidget(available_scroll_area, stretch=1) |
62 | 69 |
|
63 | 70 | selected_layout = QVBoxLayout() |
64 | 71 | selected_layout.addWidget(SubtitleLabel(self.tr("Selected Options"), self)) |
@@ -95,6 +102,7 @@ def _create_selected_list_layout(self): |
95 | 102 |
|
96 | 103 | def _create_available_options_widget(self): |
97 | 104 | widget = QWidget() |
| 105 | + widget.setStyleSheet("background-color: transparent;") |
98 | 106 | layout = FlowLayout(widget, False) |
99 | 107 | layout.setContentsMargins(0, 0, 0, 0) |
100 | 108 | layout.setHorizontalSpacing(10) |
|
0 commit comments