From 33f8ac0c2353ffd0f6d4ddb95235b05496897a4e Mon Sep 17 00:00:00 2001 From: shuaikangzhou <863909694@qq.com> Date: Sun, 14 Jan 2024 19:57:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=83=A8=E5=88=86ui?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/components/bubble_message.py | 1 - app/ui/mainview.py | 38 ++++++++++++++++++++++++++++++++ app/ui/menu/exportUi.py | 24 ++++++++++++++++---- app/ui/tool/setting/setting.py | 4 +++- app/ui/tool/setting/settingUi.py | 10 ++++++--- app/util/compress_content.py | 2 +- 6 files changed, 69 insertions(+), 10 deletions(-) diff --git a/app/components/bubble_message.py b/app/components/bubble_message.py index 18ed56c..d2b5e0c 100644 --- a/app/components/bubble_message.py +++ b/app/components/bubble_message.py @@ -264,7 +264,6 @@ class ChatWidget(QWidget): self.scrollArea = ScrollArea(self) scrollBar = ScrollBar() self.scrollArea.setVerticalScrollBar(scrollBar) - # self.scrollArea.setGeometry(QRect(9, 9, 261, 211)) # 生成滚动区域的内容部署层部件 self.scrollAreaWidgetContents = ScrollAreaContent(self.scrollArea) self.scrollAreaWidgetContents.setMinimumSize(50, 100) diff --git a/app/ui/mainview.py b/app/ui/mainview.py index c5e4563..daea9e0 100644 --- a/app/ui/mainview.py +++ b/app/ui/mainview.py @@ -83,6 +83,44 @@ QCheckBox::indicator:checked{ Height:20px; image: url(:/icons/icons/select.svg); } +QScrollBar:vertical { + border-width: 0px; + border: none; + background:rgba(133, 135, 138, 0); + width:4px; + margin: 0px 0px 0px 0px; +} +QScrollBar::handle:vertical { + background: qlineargradient(x1:0, y1:0, x2:1, y2:0, + stop: 0 rgb(133, 135, 138), stop: 0.5 rgb(133, 135, 138), stop:1 rgb(133, 135, 138)); + min-height: 20px; + max-height: 20px; + margin: 0 0px 0 0px; + border-radius: 2px; +} +QScrollBar::add-line:vertical { + background: qlineargradient(x1:0, y1:0, x2:1, y2:0, + stop: 0 rgba(133, 135, 138, 0), stop: 0.5 rgba(133, 135, 138, 0), stop:1 rgba(133, 135, 138, 0)); + height: 0px; + border: none; + subcontrol-position: bottom; + subcontrol-origin: margin; +} +QScrollBar::sub-line:vertical { + background: qlineargradient(x1:0, y1:0, x2:1, y2:0, + stop: 0 rgba(133, 135, 138, 0), stop: 0.5 rgba(133, 135, 138, 0), stop:1 rgba(133, 135, 138, 0)); + height: 0 px; + border: none; + subcontrol-position: top; + subcontrol-origin: margin; +} +QScrollBar::sub-page:vertical { + background: rgba(133, 135, 138, 0); +} + +QScrollBar::add-page:vertical { + background: rgba(133, 135, 138, 0); +} """ diff --git a/app/ui/menu/exportUi.py b/app/ui/menu/exportUi.py index 15f1381..0c25746 100644 --- a/app/ui/menu/exportUi.py +++ b/app/ui/menu/exportUi.py @@ -14,7 +14,7 @@ from PyQt5 import QtCore, QtGui, QtWidgets class Ui_Dialog(object): def setupUi(self, Dialog): Dialog.setObjectName("Dialog") - Dialog.resize(553, 394) + Dialog.resize(459, 599) self.verticalLayout_3 = QtWidgets.QVBoxLayout(Dialog) self.verticalLayout_3.setObjectName("verticalLayout_3") self.horizontalLayout = QtWidgets.QHBoxLayout() @@ -44,6 +44,11 @@ class Ui_Dialog(object): self.verticalLayout = QtWidgets.QVBoxLayout() self.verticalLayout.setObjectName("verticalLayout") self.label = QtWidgets.QLabel(Dialog) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Preferred) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.label.sizePolicy().hasHeightForWidth()) + self.label.setSizePolicy(sizePolicy) self.label.setObjectName("label") self.verticalLayout.addWidget(self.label) self.checkBox_word = QtWidgets.QCheckBox(Dialog) @@ -65,17 +70,28 @@ class Ui_Dialog(object): self.verticalLayout_2 = QtWidgets.QVBoxLayout() self.verticalLayout_2.setObjectName("verticalLayout_2") self.label_2 = QtWidgets.QLabel(Dialog) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.label_2.sizePolicy().hasHeightForWidth()) + self.label_2.setSizePolicy(sizePolicy) self.label_2.setObjectName("label_2") self.verticalLayout_2.addWidget(self.label_2) self.horizontalLayout_2.addLayout(self.verticalLayout_2) self.listWidget = QtWidgets.QListWidget(Dialog) self.listWidget.setObjectName("listWidget") self.horizontalLayout_2.addWidget(self.listWidget) - self.horizontalLayout_2.setStretch(0, 1) - self.horizontalLayout_2.setStretch(1, 1) - self.horizontalLayout_2.setStretch(2, 5) self.verticalLayout_3.addLayout(self.horizontalLayout_2) self.textBrowser = QtWidgets.QTextBrowser(Dialog) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.textBrowser.sizePolicy().hasHeightForWidth()) + self.textBrowser.setSizePolicy(sizePolicy) + self.textBrowser.setMaximumSize(QtCore.QSize(16777215, 120)) + self.textBrowser.setFrameShape(QtWidgets.QFrame.StyledPanel) + self.textBrowser.setTabStopWidth(0) + self.textBrowser.setOpenExternalLinks(False) self.textBrowser.setObjectName("textBrowser") self.verticalLayout_3.addWidget(self.textBrowser) self.progressBar = QtWidgets.QProgressBar(Dialog) diff --git a/app/ui/tool/setting/setting.py b/app/ui/tool/setting/setting.py index 37b5335..e5f1a19 100644 --- a/app/ui/tool/setting/setting.py +++ b/app/ui/tool/setting/setting.py @@ -60,6 +60,7 @@ QCheckBox::indicator:checked{ Height:60px; image: url(:/icons/icons/按钮_开启.svg); } + """ @@ -67,8 +68,9 @@ class SettingControl(QWidget, Ui_Form): def __init__(self, parent=None): super(SettingControl, self).__init__(parent) - self.setupUi(self) self.setStyleSheet(Stylesheet) + self.setupUi(self) + self.btn_addstopword.clicked.connect(self.add_stopwords) self.init_ui() self.read_data() diff --git a/app/ui/tool/setting/settingUi.py b/app/ui/tool/setting/settingUi.py index 880b5a2..0a3cd5b 100644 --- a/app/ui/tool/setting/settingUi.py +++ b/app/ui/tool/setting/settingUi.py @@ -18,10 +18,14 @@ class Ui_Form(object): self.verticalLayout_2 = QtWidgets.QVBoxLayout(Form) self.verticalLayout_2.setObjectName("verticalLayout_2") self.scrollArea = QtWidgets.QScrollArea(Form) + self.scrollArea.setFrameShape(QtWidgets.QFrame.NoFrame) + self.scrollArea.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOn) + self.scrollArea.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) self.scrollArea.setWidgetResizable(True) + self.scrollArea.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter) self.scrollArea.setObjectName("scrollArea") self.scrollAreaWidgetContents = QtWidgets.QWidget() - self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 567, 553)) + self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 552, 555)) self.scrollAreaWidgetContents.setObjectName("scrollAreaWidgetContents") self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.scrollAreaWidgetContents) self.verticalLayout_3.setObjectName("verticalLayout_3") @@ -67,8 +71,7 @@ class Ui_Form(object): self.widget_2 = QtWidgets.QWidget(self.scrollAreaWidgetContents) self.widget_2.setStyleSheet("QWidget{\n" " background-color:rgb(251,251,251);\n" -" border-radius: 10\n" -"px;\n" +" border-radius: 10px;\n" "}\n" "\n" "QPushButton{\n" @@ -85,6 +88,7 @@ class Ui_Form(object): "}") self.widget_2.setObjectName("widget_2") self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.widget_2) + self.horizontalLayout_2.setContentsMargins(9, -1, -1, -1) self.horizontalLayout_2.setObjectName("horizontalLayout_2") self.commandLinkButton = QtWidgets.QCommandLinkButton(self.widget_2) self.commandLinkButton.setEnabled(True) diff --git a/app/util/compress_content.py b/app/util/compress_content.py index c65fd62..31a5b94 100644 --- a/app/util/compress_content.py +++ b/app/util/compress_content.py @@ -170,7 +170,7 @@ def share_card(bytesExtra, compress_content_): return { 'title': escape_js_and_html(title), 'description': escape_js_and_html(des), - 'url': url, + 'url': escape_js_and_html(url), 'app_name': escape_js_and_html(show_display_name), 'thumbnail': thumbnail, 'app_logo': app_logo