Skip to content

Commit

Permalink
修复侧边导航栏发生左右滚动的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiyiYo committed Dec 23, 2024
1 parent df069a7 commit a248945
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions qfluentwidgets/components/navigation/navigation_bar.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from ...common.icon import FluentIcon as FIF
from ...common.router import qrouter
from ...common.style_sheet import FluentStyleSheet
from ..widgets.scroll_area import SingleDirectionScrollArea
from ..widgets.scroll_area import ScrollArea
from .navigation_widget import NavigationPushButton, NavigationWidget
from .navigation_panel import RouteKeyError, NavigationItemPosition

Expand Down Expand Up @@ -153,7 +153,7 @@ class NavigationBar(QWidget):
def __init__(self, parent=None):
super().__init__(parent=parent)

self.scrollArea = SingleDirectionScrollArea(self)
self.scrollArea = ScrollArea(self)
self.scrollWidget = QWidget()

self.vBoxLayout = QVBoxLayout(self)
Expand All @@ -173,6 +173,7 @@ def __initWidget(self):

self.scrollArea.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
self.scrollArea.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
self.scrollArea.horizontalScrollBar().setEnabled(False)
self.scrollArea.setWidget(self.scrollWidget)
self.scrollArea.setWidgetResizable(True)

Expand Down
1 change: 1 addition & 0 deletions qfluentwidgets/components/navigation/navigation_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ def __initWidget(self):

self.scrollArea.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
self.scrollArea.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
self.scrollArea.horizontalScrollBar().setEnabled(False)
self.scrollArea.setWidget(self.scrollWidget)
self.scrollArea.setWidgetResizable(True)

Expand Down

0 comments on commit a248945

Please sign in to comment.