style: unify GUI button radius

This commit is contained in:
chengma
2026-07-07 09:21:19 +08:00
parent 6ed3933856
commit ad75afb8f4
7 changed files with 87 additions and 15 deletions
+11
View File
@@ -162,8 +162,11 @@ class GuiTests(TempDirMixin, unittest.TestCase):
[window.tabs.tabText(index) for index in range(window.tabs.count())],
)
self.assertEqual("就绪", window.statusBar().currentMessage())
self.assertEqual(gui.BUTTON_BASE_STYLE, window.styleSheet())
self.assertEqual(TAB_STYLE, window.tabs.styleSheet())
self.assertFalse(window.tabs.tabIcon(TAB_TITLES.index("③ 更新shopee")).isNull())
self.assertIn("QPushButton", window.styleSheet())
self.assertIn("border-radius: 4px", window.styleSheet())
self.assertIn("min-width: 128px", window.tabs.styleSheet())
self.assertIn("padding: 8px 18px", window.tabs.styleSheet())
self.assertIn("margin-right: 8px", window.tabs.styleSheet())
@@ -2452,6 +2455,8 @@ class GuiTests(TempDirMixin, unittest.TestCase):
self.assertEqual("startUpdateButton", tab.start_update_button.objectName())
self.assertIn(gui.COLOR_WARNING, tab.start_update_button.styleSheet())
self.assertIn("border", tab.start_update_button.styleSheet())
self.assertNotIn("border-radius", tab.start_update_button.styleSheet())
self.assertNotIn("padding", tab.start_update_button.styleSheet())
self.assertFalse(tab.stop_update_button.isEnabled())
self.assertEqual(2, tab.model.rowCount())
self.assertEqual("主店", tab.model.index(0, 0).data())
@@ -3482,6 +3487,8 @@ class GuiTests(TempDirMixin, unittest.TestCase):
self.assertEqual(gui.COLOR_MUTED, tab.table.item(0, 4).foreground().color().name())
self.assertEqual("deleteAccountButton", tab.delete_button.objectName())
self.assertIn(gui.COLOR_DANGER, tab.delete_button.styleSheet())
self.assertNotIn("border-radius", tab.delete_button.styleSheet())
self.assertNotIn("padding", tab.delete_button.styleSheet())
visible_values = [
tab.table.item(0, column).text()
for column in range(tab.table.columnCount())
@@ -3634,6 +3641,8 @@ class GuiTests(TempDirMixin, unittest.TestCase):
self.assert_foreground(tab.model, 0, 3, gui.COLOR_PENDING)
self.assertEqual("deleteBatchButton", tab.delete_batch_button.objectName())
self.assertIn(gui.COLOR_DANGER, tab.delete_batch_button.styleSheet())
self.assertNotIn("border-radius", tab.delete_batch_button.styleSheet())
self.assertNotIn("padding", tab.delete_batch_button.styleSheet())
self.assertEqual("Excel副店", tab.model.index(1, 0).data())
self.assertEqual("missing", tab.model.index(1, 1).data())
self.assertEqual("略过", tab.model.index(1, 3).data())
@@ -3645,6 +3654,8 @@ class GuiTests(TempDirMixin, unittest.TestCase):
self.assertIn(gui.COLOR_DANGER, tab.summary_label.text())
self.assertIn(gui.COLOR_DANGER, tab.show_unmatched_button.styleSheet())
self.assertIn("border", tab.show_unmatched_button.styleSheet())
self.assertNotIn("border-radius", tab.show_unmatched_button.styleSheet())
self.assertNotIn("padding", tab.show_unmatched_button.styleSheet())
self.assertIn("主店1", tab.match_detail_label.text())
self.assertIn("未匹配", tab.empty_label.text())