Skip to content

Commit

Permalink
🐛 修复 mac ui 适配相关 bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeal-L committed Apr 3, 2024
1 parent 1942869 commit 822a303
Show file tree
Hide file tree
Showing 8 changed files with 1,016 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ body:
id: version
attributes:
label: 哔哩哔哩漫画下载器版本号
placeholder: v1.5.0
placeholder: v1.5.1
validations:
required: true
- type: dropdown
Expand Down
2 changes: 1 addition & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
app = QApplication.instance() or QApplication(argv)

if platform == "win32" and ctypes.windll.user32.FindWindowW(None, __main_window_title__) != 0:
box = QMessageBox.information(
_box = QMessageBox.information(
None, "提示", "有一个我已经不满足不了你吗?\n\t...(。•ˇ‸ˇ•。) ..."
)
exit(0)
Expand Down
2 changes: 2 additions & 0 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ poetry install --no-root
echo -e "\033[34m\n 重新编译UI文件 ... \n\033[0m"
poetry run pyside6-rcc src/ui/PySide_src/resource.qrc -o src/ui/PySide_src/resource_rc.py
poetry run pyside6-uic src/ui/PySide_src/mainWindow.ui -o src/ui/PySide_src/mainWindow_ui.py
poetry run pyside6-uic src/ui/PySide_src/mainWindow_mac.ui -o src/ui/PySide_src/mainWindow_ui_mac.py
poetry run pyside6-uic src/ui/PySide_src/myAbout.ui -o src/ui/PySide_src/myAbout_ui.py
poetry run pyside6-uic src/ui/PySide_src/qrCode.ui -o src/ui/PySide_src/qrCode_ui.py

Expand All @@ -24,6 +25,7 @@ else
fi

sed "${SED_INPLACE[@]}" 's/resource_rc/src.ui.PySide_src.resource_rc/' src/ui/PySide_src/mainWindow_ui.py
sed "${SED_INPLACE[@]}" 's/resource_rc/src.ui.PySide_src.resource_rc/' src/ui/PySide_src/mainWindow_mac_ui.py
sed "${SED_INPLACE[@]}" 's/resource_rc/src.ui.PySide_src.resource_rc/' src/ui/PySide_src/myAbout_ui.py
sed "${SED_INPLACE[@]}" 's/resource_rc/src.ui.PySide_src.resource_rc/' src/ui/PySide_src/qrCode_ui.py

Expand Down
5 changes: 3 additions & 2 deletions src/ui/MainGUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@

from src.ui.DownloadUI import DownloadUI
from src.ui.MangaUI import MangaUI
if platform.system() == 'Darwin':

if platform == "darwin":
from src.ui.PySide_src.mainWindow_mac_ui import Ui_MainWindow
else:
from src.ui.PySide_src.mainWindow_ui import Ui_MainWindow
Expand All @@ -40,7 +41,7 @@ def __init__(self, app):
self.app = app
self.setupUi(self)
self.setWindowTitle(f"哔哩哔哩漫画下载器 v{__version__}")
if platform.system() == 'Darwin':
if platform == "darwin":
self.setFont(QFont("PingFang SC", 12))
else:
self.setFont(QFont("Microsoft YaHei", 10))
Expand Down
5 changes: 4 additions & 1 deletion src/ui/PySide_src/mainWindow_mac.ui
Original file line number Diff line number Diff line change
Expand Up @@ -477,11 +477,14 @@ hr { height: 1px; border-width: 0; }
li.unchecked::marker { content: "\2610"; }
li.checked::marker { content: "\2612"; }
</style></head><body style=" font-family:'.AppleSystemUIFont'; font-size:13pt; font-weight:400; font-style:normal;">
<p align="center" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
<p align="center" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Helvetica'; font-size:18pt; font-weight:700; color:#0055ff;"><br /></p>
<p align="center" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Helvetica'; font-size:18pt; font-weight:700; color:#0055ff;">❤欢迎使用本下载器(*`∀´*)ノ</span></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Helvetica';"><br /></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Helvetica';">第一次使用请先在上方的设置页面内扫码登入B站帐号</span></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Helvetica';">并且配置好您需要的漫画保存路径与格式</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Helvetica';">s</span></p>
<p align="center" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Helvetica';"><br /></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Helvetica';">未解锁的章节可以尝试使用BiliPlus解析,可能会给您带来惊喜</span></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Helvetica';"><br /></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Helvetica'; font-size:18pt; color:#aa55ff;">⭐章节选择小技巧(#^.^#)</span></p>
Expand Down
55 changes: 31 additions & 24 deletions src/ui/PySide_src/mainWindow_mac_ui.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-

################################################################################
## Form generated from reading UI file 'mainWindow.ui'
## Form generated from reading UI file 'mainWindow_mac.ui'
##
## Created by: Qt User Interface Compiler version 6.6.3
##
Expand Down Expand Up @@ -145,7 +145,7 @@ def setupUi(self, MainWindow):
self.scrollArea_myLibrary.setWidgetResizable(True)
self.scrollAreaWidgetContents_myLibrary = QWidget()
self.scrollAreaWidgetContents_myLibrary.setObjectName(u"scrollAreaWidgetContents_myLibrary")
self.scrollAreaWidgetContents_myLibrary.setGeometry(QRect(0, 0, 524, 191))
self.scrollAreaWidgetContents_myLibrary.setGeometry(QRect(0, 0, 483, 193))
self.v_Layout_myLibrary = QVBoxLayout(self.scrollAreaWidgetContents_myLibrary)
self.v_Layout_myLibrary.setObjectName(u"v_Layout_myLibrary")
self.scrollArea_myLibrary.setWidget(self.scrollAreaWidgetContents_myLibrary)
Expand Down Expand Up @@ -448,7 +448,7 @@ def setupUi(self, MainWindow):
self.scrollArea_processing.setWidgetResizable(True)
self.scrollAreaWidgetContents_processing = QWidget()
self.scrollAreaWidgetContents_processing.setObjectName(u"scrollAreaWidgetContents_processing")
self.scrollAreaWidgetContents_processing.setGeometry(QRect(0, 0, 1082, 554))
self.scrollAreaWidgetContents_processing.setGeometry(QRect(0, 0, 1032, 525))
self.verticalLayout_processing = QVBoxLayout(self.scrollAreaWidgetContents_processing)
self.verticalLayout_processing.setObjectName(u"verticalLayout_processing")
self.scrollArea_processing.setWidget(self.scrollAreaWidgetContents_processing)
Expand Down Expand Up @@ -903,27 +903,34 @@ def retranslateUi(self, MainWindow):
self.pushButton_resolve_detail.setText(QCoreApplication.translate("MainWindow", u"B\u7ad9\u89e3\u6790", None))
self.pushButton_biliplus_resolve_detail.setText(QCoreApplication.translate("MainWindow", u"BiliPlus\u89e3\u6790", None))
self.label_resolve_status.setText("")
self.textBrowser_tutorial.setHtml(QCoreApplication.translate("MainWindow", """<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><meta name="qrichtext" content="1" /><meta charset="utf-8" /><style type="text/css">
p, li { white-space: pre-wrap; }
hr { height: 1px; border-width: 0; }
li.unchecked::marker { content: "\2610"; }
li.checked::marker { content: "\2612"; }
</style></head><body style=" font-family:'PingFang SC'; font-size:13pt; font-weight:400; font-style:normal;">
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'PingFang SC'; font-size:18pt; font-weight:700; color:#0055ff;">❤欢迎使用本下载器(*`∀´*)ノ</span></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'PingFang SC'; font-size:13pt;"><br /></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'PingFang SC'; font-size:13pt;">第一次使用请先在上方的设置页面内扫码登入B站帐号</span></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'PingFang SC'; font-size:13pt;">并且配置好您需要的漫画保存路径与格式</span></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'PingFang SC'; font-size:13pt;"><br /></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'PingFang SC'; font-size:13pt;">未解锁的章节可以尝试使用BiliPlus解析,可能会给您带来惊喜</span></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'PingFang SC'; font-size:13pt;"><br /></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'PingFang SC'; font-size:18pt; color:#aa55ff;">⭐章节选择小技巧(#^.^#)</span></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'PingFang SC'; font-size:13pt;"><br /></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'PingFang SC'; font-size:13pt;">技巧一:按住鼠标左键拖动可批量框选章节,然后点击鼠标右键确认操作</span></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'PingFang SC'; font-size:13pt;">技巧二:按住⌥ (Option)后鼠标划过章节名快速选中,Shift+⌥快速取消选中</span></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'PingFang SC'; font-size:13pt;">技巧三:使用方向键配合回车单选章节,也可以再配合Shift多选</span></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'PingFang SC'; font-size:13pt;">技巧四:⌘ (Command)+A全选后回车确认 </span></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'PingFang SC'; font-size:13pt;"><br /></p></body></html>""", None))
self.textBrowser_tutorial.setHtml(QCoreApplication.translate("MainWindow", u"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
"<html><head><meta name=\"qrichtext\" content=\"1\" /><meta charset=\"utf-8\" /><style type=\"text/css\">\n"
"p, li { white-space: pre-wrap; }\n"
"hr { height: 1px; border-width: 0; }\n"
"li.unchecked::marker { content: \"\\2610\"; }\n"
"li.checked::marker { content: \"\\2612\"; }\n"
"</style></head><body style=\" font-family:'.AppleSystemUIFont'; font-size:13pt; font-weight:400; font-style:normal;\">\n"
"<p align=\"center\" style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><br /></p>\n"
"<p align=\"center\" style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Helvetica'; font-size:18pt; font-weight:700; color:#0055ff;\"><br /></p>\n"
"<p align=\"center\" style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0"
"px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><br /></p>\n"
"<p align=\"center\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:'Helvetica'; font-size:18pt; font-weight:700; color:#0055ff;\">\u2764\u6b22\u8fce\u4f7f\u7528\u672c\u4e0b\u8f7d\u5668(*\uff40\u2200\u00b4*)\u30ce</span></p>\n"
"<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Helvetica';\"><br /></p>\n"
"<p align=\"center\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:'Helvetica';\">\u7b2c\u4e00\u6b21\u4f7f\u7528\u8bf7\u5148\u5728\u4e0a\u65b9\u7684\u8bbe\u7f6e\u9875\u9762\u5185\u626b\u7801\u767b\u5165B\u7ad9\u5e10\u53f7</span></p>\n"
"<p align=\"center\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; marg"
"in-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:'Helvetica';\">\u5e76\u4e14\u914d\u7f6e\u597d\u60a8\u9700\u8981\u7684\u6f2b\u753b\u4fdd\u5b58\u8def\u5f84\u4e0e\u683c\u5f0f</span></p>\n"
"<p align=\"center\" style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Helvetica';\"><br /></p>\n"
"<p align=\"center\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:'Helvetica';\">\u672a\u89e3\u9501\u7684\u7ae0\u8282\u53ef\u4ee5\u5c1d\u8bd5\u4f7f\u7528BiliPlus\u89e3\u6790\uff0c\u53ef\u80fd\u4f1a\u7ed9\u60a8\u5e26\u6765\u60ca\u559c</span></p>\n"
"<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Helvetica';\"><br /></p>\n"
"<p align=\"center\" style=\" margin-top:0px; margin-bottom:0px; margi"
"n-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:'Helvetica'; font-size:18pt; color:#aa55ff;\">\u2b50\u7ae0\u8282\u9009\u62e9\u5c0f\u6280\u5de7(#^.^#)</span></p>\n"
"<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Helvetica';\"><br /></p>\n"
"<p align=\"center\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:'Helvetica';\">\u6280\u5de7\u4e00\uff1a\u6309\u4f4f\u9f20\u6807\u5de6\u952e\u62d6\u52a8\u53ef\u6279\u91cf\u6846\u9009\u7ae0\u8282\uff0c\u7136\u540e\u70b9\u51fb\u9f20\u6807\u53f3\u952e\u786e\u8ba4\u64cd\u4f5c</span></p>\n"
"<p align=\"center\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:'Helvetica';\">\u6280\u5de7\u4e8c\uff1a\u6309\u4f4f\u2325 (Option)\u540e\u9f20"
"\u6807\u5212\u8fc7\u7ae0\u8282\u540d\u5feb\u901f\u9009\u4e2d\uff0cShift+\u2325\u5feb\u901f\u53d6\u6d88\u9009\u4e2d</span></p>\n"
"<p align=\"center\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:'Helvetica';\">\u6280\u5de7\u4e09\uff1a\u4f7f\u7528\u65b9\u5411\u952e\u914d\u5408\u56de\u8f66\u5355\u9009\u7ae0\u8282\uff0c\u4e5f\u53ef\u4ee5\u518d\u914d\u5408Shift\u591a\u9009</span></p>\n"
"<p align=\"center\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:'Helvetica';\">\u6280\u5de7\u56db\uff1a\u2318 (Cmd)+A\u5168\u9009\u540e\u56de\u8f66\u786e\u8ba4 </span></p>\n"
"<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Helvetica';\"><br /></p></body></html>", None))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_my_manga), QCoreApplication.translate("MainWindow", u"\u6211\u7684\u6f2b\u753b", None))
self.label_total_progress.setText(QCoreApplication.translate("MainWindow", u"\u603b\u8fdb\u5ea6", None))
self.label_tasks_count.setText(QCoreApplication.translate("MainWindow", u"\u4efb\u52a1\u6570\uff1a", None))
Expand Down
3 changes: 2 additions & 1 deletion src/ui/PySide_src/mainWindow_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -969,4 +969,5 @@ def retranslateUi(self, MainWindow):
self.pushButton_check_update.setText(QCoreApplication.translate("MainWindow", u"\u68c0\u67e5\u66f4\u65b0", None))
self.pushButton_about.setText(QCoreApplication.translate("MainWindow", u"\u5173\u4e8e", None))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_setting), QCoreApplication.translate("MainWindow", u"\u8bbe\u7f6e", None))
# retranslateUi
# retranslateUi

Loading

0 comments on commit 822a303

Please sign in to comment.