Replace leaf entry with persistent horizontal toolbar and shared panel state
This commit is contained in:
1 parent
d2501d0112
commit
19361fd1cc
18 files changed
+1010
-454
No files matched your search
@@ -1,5 +1,5 @@
|
||||
from PySide6.QtCore import Qt
|
||||
from PySide6.QtWidgets import QToolButton
|
||||
from PySide6.QtWidgets import QAbstractButton, QToolButton
|
||||
|
||||
from dx_productivity.ui.main_window import MainWindow
|
||||
from dx_productivity.ui.app import create_application, create_main_window
|
||||
@@ -12,17 +12,18 @@ def test_main_window_has_approved_minimum_and_navigation(qtbot):
|
||||
window = MainWindow()
|
||||
qtbot.addWidget(window)
|
||||
|
||||
assert window.minimumWidth() == 860
|
||||
assert window.minimumHeight() == 540
|
||||
assert window.minimumWidth() == 720
|
||||
assert window.minimumHeight() == 420
|
||||
assert window.navigation_items()[:3] == ["自动位号", "属性批改", "属性显示"]
|
||||
assert window.apply_button.text() == "应用位号"
|
||||
assert not hasattr(window, "navigation")
|
||||
assert window.toolbar.page_buttons[0].accessibleName() == "自动位号"
|
||||
|
||||
|
||||
def test_icon_buttons_have_accessible_names(qtbot):
|
||||
window = MainWindow()
|
||||
qtbot.addWidget(window)
|
||||
|
||||
for button in window.findChildren(QToolButton):
|
||||
for button in window.toolbar.findChildren(QAbstractButton):
|
||||
assert button.accessibleName()
|
||||
assert button.toolTip()
|
||||
|
||||
@@ -38,7 +39,7 @@ def test_theme_toggle_changes_window_theme(qtbot):
|
||||
window = MainWindow(theme=Theme.LIGHT)
|
||||
qtbot.addWidget(window)
|
||||
|
||||
qtbot.mouseClick(window.theme_button, Qt.MouseButton.LeftButton)
|
||||
window.theme_action.trigger()
|
||||
|
||||
assert window.theme is Theme.DARK
|
||||
|
||||
@@ -100,7 +101,7 @@ def test_main_window_uses_yiyezhqiu_brand_and_feature_pages(qtbot):
|
||||
qtbot.addWidget(window)
|
||||
|
||||
assert window.windowTitle() == "一叶知秋_重构版"
|
||||
assert window.brand_label.text() == "一叶知秋_重构版"
|
||||
assert window.toolbar.windowTitle() == "一叶知秋悬浮工具栏"
|
||||
assert isinstance(window.pages.widget(1), PropertyChangePage)
|
||||
assert isinstance(window.pages.widget(2), PropertyVisibilityPage)
|
||||
assert isinstance(window.pages.widget(3), InspectionPage)
|
||||
|
||||
Reference in new issue
Block a user