-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from Night-stars-1/dev
feat: 优化自动跑商
- Loading branch information
Showing
14 changed files
with
267 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
from PyQt5.QtCore import Qt, pyqtSignal | ||
from qfluentwidgets import PushSettingCard, IndeterminateProgressRing | ||
|
||
class PrimaryPushLoadCard(PushSettingCard): | ||
"""Push setting card with primary color""" | ||
|
||
def __init__(self, text, icon, title, content=None, parent=None): | ||
super().__init__(text, icon, title, content, parent) | ||
self.text = text | ||
self.spinner = IndeterminateProgressRing(self.button) | ||
self.spinner.setFixedSize(24, 24) | ||
self.centerProgressRing() | ||
self.spinner.hide() | ||
|
||
self.button.setObjectName("PrimaryPushLoadCard") | ||
|
||
def centerProgressRing(self): | ||
# 计算进度环在按钮中的居中位置 | ||
ring_size = self.spinner.size() | ||
button_size = self.button.size() | ||
new_x = (button_size.width() - ring_size.width()) // 2 | ||
new_y = (button_size.height() - ring_size.height()) // 2 | ||
self.spinner.move(new_x+5, new_y) | ||
|
||
def loading(self, loading=True): | ||
if loading: | ||
self.spinner.show() | ||
self.button.setText("") | ||
else: | ||
self.spinner.hide() | ||
self.button.setText(self.text) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.