fix(ui): thanh menu trái không kéo mất được nữa
Kéo thanh chia sang trái hết cỡ thì thanh menu biến mất hẳn, và khi đã mất thì không còn gì đủ rộng để nhận ra, nói gì tới bắt lại mà kéo ra. _nav_wrap.setMinimumWidth(132) chỉ chi phối việc BỐ TRÍ, không chi phối thao tác kéo: QSplitter mặc định cho phép người dùng kéo một ngăn vượt qua chính minimum của nó rồi đóng sập về 0. Tắt bằng setChildrenCollapsible(False). Thu gọn vẫn là việc của nút MENU, và nó dừng ở 54px chứ không về 0. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -163,6 +163,12 @@ class NavRailMixin:
|
||||
self.split = QSplitter(Qt.Horizontal)
|
||||
self.split.addWidget(self._nav_wrap)
|
||||
self.split.addWidget(right)
|
||||
# A QSplitter lets the user drag a pane past its own minimumWidth and
|
||||
# snap it shut at zero — the minimum only governs LAYOUT, not the drag.
|
||||
# So the rail set a 132px floor and still vanished entirely when dragged
|
||||
# hard left, with no handle left wide enough to notice, let alone grab.
|
||||
# Collapsing is what the MENU button is for, and that stops at 54px.
|
||||
self.split.setChildrenCollapsible(False)
|
||||
self.split.setStretchFactor(0, 0)
|
||||
self.split.setStretchFactor(1, 1)
|
||||
self.split.setSizes([_NAV_EXPANDED_WIDTH, 1000])
|
||||
|
||||
Reference in New Issue
Block a user