设置按钮样式
(self)
| 23 | self._setup_button() |
| 24 | |
| 25 | def _setup_button(self): |
| 26 | """设置按钮样式""" |
| 27 | self.setFont(get_button_font()) |
| 28 | self.setCursor(QCursor(Qt.CursorShape.PointingHandCursor)) |
| 29 | |
| 30 | # 设置CSS类名用于样式表 |
| 31 | if self.button_type == "secondary": |
| 32 | self.setProperty("class", "secondary") |
| 33 | elif self.button_type == "warning": |
| 34 | self.setProperty("class", "warning") |
| 35 | elif self.button_type == "success": |
| 36 | self.setProperty("class", "success") |
| 37 | |
| 38 | # 设置最小尺寸 |
| 39 | self.setMinimumHeight(45) |
| 40 | |
| 41 | def set_enabled_state(self, enabled: bool): |
| 42 | """设置按钮启用状态""" |
no test coverage detected