diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 717ba9ae..a0bdbc60 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -4,23 +4,19 @@ - @@ -590,7 +592,8 @@ - @@ -604,7 +607,7 @@ file://$PROJECT_DIR$/main.py - 23 + 22 diff --git a/app/ImageBox/ui.py b/app/ImageBox/ui.py index 5894631e..c78039eb 100644 --- a/app/ImageBox/ui.py +++ b/app/ImageBox/ui.py @@ -31,7 +31,7 @@ def set_image(self, img_path): # print(img_size) img_size = self.scaled_img.size() x = min(500, max((1000 - img_size.width()) // 2, 0)) - y = min(300, max((600 - img_size.height()) // 2-60, 0)) + y = min(300, max((600 - img_size.height()) // 2 - 60, 0)) # print(x,y) self.point = QPoint(x, y) @@ -97,7 +97,7 @@ def __init__(self): self.setWindowTitle("Image Viewer") self.setFixedSize(1000, 600) - self.setWindowIcon(QIcon('./app/data/icon.png')) + self.setWindowIcon(QIcon('./app/data/icons/logo.svg')) self.zoom_in = QPushButton("") self.zoom_in.clicked.connect(self.large_click) self.zoom_in.setFixedSize(30, 30) diff --git a/app/Ui/Icon.py b/app/Ui/Icon.py index 2bda4c8f..896fb6dd 100644 --- a/app/Ui/Icon.py +++ b/app/Ui/Icon.py @@ -7,3 +7,6 @@ class Icon: Default_avatar = QIcon(Default_avatar_path) Output = QIcon('./app/data/icons/output.svg') Back = QIcon('./app/data/icons/back.svg') + ToDocx = QIcon('app/data/icons/word.svg') + ToCSV = QIcon('app/data/icons/csv.svg') + ToHTML = QIcon('app/data/icons/html.svg') diff --git a/app/Ui/MyComponents/Button_Contact.py b/app/Ui/MyComponents/Button_Contact.py index c9a5f971..7c9bc459 100644 --- a/app/Ui/MyComponents/Button_Contact.py +++ b/app/Ui/MyComponents/Button_Contact.py @@ -48,6 +48,7 @@ def init_ui(self, Ui): self.gridLayout1.setObjectName("gridLayout1") self.label_time = QtWidgets.QLabel(self.layoutWidget) font = QtGui.QFont() + font.setFamily("微软雅黑") font.setPointSize(8) self.label_time.setFont(font) self.label_time.setLayoutDirection(QtCore.Qt.RightToLeft) @@ -56,13 +57,15 @@ def init_ui(self, Ui): self.gridLayout1.addWidget(self.label_time, 0, 2, 1, 1) self.label_remark = QtWidgets.QLabel(self.layoutWidget) font = QtGui.QFont() - font.setFamily("Adobe 黑体 Std R") + font.setFamily("微软雅黑") font.setPointSize(10) + font.setBold(True) self.label_remark.setFont(font) self.label_remark.setObjectName("label_remark") self.gridLayout1.addWidget(self.label_remark, 0, 1, 1, 1) self.label_msg = QtWidgets.QLabel(self.layoutWidget) font = QtGui.QFont() + font.setFamily("微软雅黑") font.setPointSize(8) self.label_msg.setFont(font) self.label_msg.setObjectName("label_msg") diff --git a/app/Ui/chat/chatUi.py b/app/Ui/chat/chatUi.py index 65748744..6566cf61 100644 --- a/app/Ui/chat/chatUi.py +++ b/app/Ui/chat/chatUi.py @@ -23,7 +23,7 @@ def setupUi(self, Form): self.scrollArea_2.setEnabled(True) self.scrollArea_2.setMaximumSize(QtCore.QSize(325, 150000)) self.scrollArea_2.setAutoFillBackground(False) - self.scrollArea_2.setFrameShape(QtWidgets.QFrame.WinPanel) + self.scrollArea_2.setFrameShape(QtWidgets.QFrame.NoFrame) self.scrollArea_2.setFrameShadow(QtWidgets.QFrame.Raised) self.scrollArea_2.setMidLineWidth(0) self.scrollArea_2.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOn) @@ -151,5 +151,7 @@ def retranslateUi(self, Form): "p, li { white-space: pre-wrap; }\n" "\n" "

\n" - "

")) + "

\n" + "

\n" + "

")) self.btn_sendMsg_2.setText(_translate("Form", "发送")) diff --git a/app/Ui/chat/chatUi.ui b/app/Ui/chat/chatUi.ui index 9c2cadbc..8ae57141 100644 --- a/app/Ui/chat/chatUi.ui +++ b/app/Ui/chat/chatUi.ui @@ -44,7 +44,7 @@ false - QFrame::WinPanel + QFrame::NoFrame QFrame::Raised @@ -235,6 +235,8 @@ <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> </p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; + margin-right:0px; -qt-block-indent:0; text-indent:0px;"> </p> + <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> </p></body></html> diff --git a/app/Ui/contact/contactInfo.py b/app/Ui/contact/contactInfo.py index b921c408..f2b421e5 100644 --- a/app/Ui/contact/contactInfo.py +++ b/app/Ui/contact/contactInfo.py @@ -1,5 +1,4 @@ from PyQt5.QtCore import * -from PyQt5.QtGui import * from PyQt5.QtWidgets import * from app import person @@ -39,9 +38,9 @@ def init_ui(self): self.stackedWidget.addWidget(self.view_emotion) self.stackedWidget.setCurrentWidget(self.view_userinfo) menu = QMenu(self) - self.toDocxAct = QAction(QIcon('app/data/icons/word.svg'), '导出Docx', self) - self.toCSVAct = QAction(QIcon('app/data/icons/csv.svg'), '导出CSV', self) - self.toHtmlAct = QAction(QIcon('app/data/icons/html.svg'), '导出HTML', self) + self.toDocxAct = QAction(Icon.ToDocx, '导出Docx', self) + self.toCSVAct = QAction(Icon.ToCSV, '导出CSV', self) + self.toHtmlAct = QAction(Icon.ToHTML, '导出HTML', self) self.toolButton_output.setPopupMode(QToolButton.MenuButtonPopup) self.toolButton_output.clicked.connect(self.toolButton_show) menu.addAction(self.toDocxAct) diff --git a/app/Ui/contact/contactInfoUi.py b/app/Ui/contact/contactInfoUi.py index a441126f..83d3962f 100644 --- a/app/Ui/contact/contactInfoUi.py +++ b/app/Ui/contact/contactInfoUi.py @@ -39,12 +39,7 @@ def setupUi(self, Form): self.label_remark.setObjectName("label_remark") self.horizontalLayout_3.addWidget(self.label_remark) self.btn_analysis = QtWidgets.QPushButton(self.frame) - self.btn_analysis.setStyleSheet("QPushButton:hover {\n" - " background-color: rgb(240, 240, 240);\n" - "}\n" - "QPushButton{\n" - " background-color:transparent;\n" - "}") + self.btn_analysis.setStyleSheet("") self.btn_analysis.setFlat(True) self.btn_analysis.setObjectName("btn_analysis") self.horizontalLayout_3.addWidget(self.btn_analysis) diff --git a/app/Ui/contact/contactInfoUi.ui b/app/Ui/contact/contactInfoUi.ui index 52be0da5..86b3e261 100644 --- a/app/Ui/contact/contactInfoUi.ui +++ b/app/Ui/contact/contactInfoUi.ui @@ -79,13 +79,7 @@ - QPushButton:hover { - background-color: rgb(240, 240, 240); - } - QPushButton{ - background-color:transparent; - } - + 统计信息 diff --git a/app/Ui/contact/contactUi.py b/app/Ui/contact/contactUi.py index 1b0840b0..08798ef3 100644 --- a/app/Ui/contact/contactUi.py +++ b/app/Ui/contact/contactUi.py @@ -34,7 +34,7 @@ def setupUi(self, Dialog): self.scrollArea.setMinimumSize(QtCore.QSize(325, 0)) self.scrollArea.setMaximumSize(QtCore.QSize(325, 150000)) self.scrollArea.setAutoFillBackground(False) - self.scrollArea.setFrameShape(QtWidgets.QFrame.WinPanel) + self.scrollArea.setFrameShape(QtWidgets.QFrame.NoFrame) self.scrollArea.setFrameShadow(QtWidgets.QFrame.Raised) self.scrollArea.setMidLineWidth(0) self.scrollArea.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOn) diff --git a/app/Ui/contact/contactUi.ui b/app/Ui/contact/contactUi.ui index 4ee47181..42973cdf 100644 --- a/app/Ui/contact/contactUi.ui +++ b/app/Ui/contact/contactUi.ui @@ -80,7 +80,7 @@ false - QFrame::WinPanel + QFrame::NoFrame QFrame::Raised diff --git a/app/Ui/mainview.py b/app/Ui/mainview.py index 2987bd24..4d2dea60 100644 --- a/app/Ui/mainview.py +++ b/app/Ui/mainview.py @@ -52,6 +52,11 @@ def __init__(self, username, parent=None): self.lastView = None self.show_avatar() self.init_ui() + # self.state_lable = QLabel(self) + # self.state_lable.raise_() + # pixmap = QPixmap('./app/data/icons/default_avatar.svg').scaled(32, 32) # 按指定路径找到图片 + # self.state_lable.setPixmap(pixmap) + # self.state_lable.setText("T") # 创建右键菜单函数 def init_ui(self): @@ -90,6 +95,7 @@ def chat_view(self): self.last_btn.setStyleSheet("QPushButton {background-color: rgb(240,240,240);}" "QPushButton:hover{background-color: rgb(209,209,209);}\n") self.last_btn = self.btn_chat + # self.state_lable.setGeometry(20, 300, 32, 32) self.stackedWidget.setCurrentIndex(0) self.chatView.showChat() @@ -104,6 +110,8 @@ def contact_view(self): self.last_btn.setStyleSheet("QPushButton {background-color: rgb(240,240,240);}" "QPushButton:hover{background-color: rgb(209,209,209);}\n") self.last_btn = self.btn_contact + # geometry = self.btn_chat.geometry() + # self.state_lable.setGeometry(geometry) self.stackedWidget.setCurrentIndex(1) def myInfo(self): diff --git a/app/Ui/mainwindow.py b/app/Ui/mainwindow.py index 81722a47..773e7328 100644 --- a/app/Ui/mainwindow.py +++ b/app/Ui/mainwindow.py @@ -8,7 +8,7 @@ # run again. Do not edit this file unless you know what you are doing. -from PyQt5 import QtCore, QtWidgets +from PyQt5 import QtCore, QtGui, QtWidgets class Ui_MainWindow(object): @@ -25,8 +25,8 @@ def setupUi(self, MainWindow): self.frame_info.setMinimumSize(QtCore.QSize(80, 500)) self.frame_info.setMaximumSize(QtCore.QSize(80, 16777215)) self.frame_info.setStyleSheet("background-color:rgb(240,240,240)") - self.frame_info.setFrameShape(QtWidgets.QFrame.StyledPanel) - self.frame_info.setFrameShadow(QtWidgets.QFrame.Sunken) + self.frame_info.setFrameShape(QtWidgets.QFrame.NoFrame) + self.frame_info.setFrameShadow(QtWidgets.QFrame.Plain) self.frame_info.setObjectName("frame_info") self.verticalLayoutWidget = QtWidgets.QWidget(self.frame_info) self.verticalLayoutWidget.setGeometry(QtCore.QRect(0, 190, 77, 271)) @@ -37,30 +37,46 @@ def setupUi(self, MainWindow): self.verticalLayout_2.setObjectName("verticalLayout_2") self.btn_chat = QtWidgets.QPushButton(self.verticalLayoutWidget) self.btn_chat.setMinimumSize(QtCore.QSize(0, 60)) + font = QtGui.QFont() + font.setFamily("微软雅黑") + self.btn_chat.setFont(font) self.btn_chat.setStyleSheet("QPushButton {background-color: rgb(240,240,240);}\n" " QPushButton:hover{background-color: rgb(209,209,209);}\n" " ") + self.btn_chat.setFlat(True) self.btn_chat.setObjectName("btn_chat") self.verticalLayout_2.addWidget(self.btn_chat) self.btn_contact = QtWidgets.QPushButton(self.verticalLayoutWidget) self.btn_contact.setMinimumSize(QtCore.QSize(0, 60)) + font = QtGui.QFont() + font.setFamily("微软雅黑") + self.btn_contact.setFont(font) self.btn_contact.setStyleSheet("QPushButton {background-color: rgb(240,240,240);}\n" " QPushButton:hover{background-color: rgb(209,209,209);}\n" " ") + self.btn_contact.setFlat(True) self.btn_contact.setObjectName("btn_contact") self.verticalLayout_2.addWidget(self.btn_contact) self.btn_myinfo = QtWidgets.QPushButton(self.verticalLayoutWidget) self.btn_myinfo.setMinimumSize(QtCore.QSize(60, 60)) + font = QtGui.QFont() + font.setFamily("微软雅黑") + self.btn_myinfo.setFont(font) self.btn_myinfo.setStyleSheet("QPushButton {background-color: rgb(240,240,240);}\n" " QPushButton:hover{background-color: rgb(209,209,209);}\n" " ") + self.btn_myinfo.setFlat(True) self.btn_myinfo.setObjectName("btn_myinfo") self.verticalLayout_2.addWidget(self.btn_myinfo) self.btn_about = QtWidgets.QPushButton(self.verticalLayoutWidget) self.btn_about.setMinimumSize(QtCore.QSize(60, 60)) + font = QtGui.QFont() + font.setFamily("微软雅黑") + self.btn_about.setFont(font) self.btn_about.setStyleSheet("QPushButton {background-color: rgb(240,240,240);}\n" " QPushButton:hover{background-color: rgb(209,209,209);}\n" " ") + self.btn_about.setFlat(True) self.btn_about.setObjectName("btn_about") self.verticalLayout_2.addWidget(self.btn_about) self.verticalLayout_2.setStretch(0, 1) @@ -72,6 +88,11 @@ def setupUi(self, MainWindow): self.myavatar.setObjectName("myavatar") self.horizontalLayout.addWidget(self.frame_info) self.stackedWidget = QtWidgets.QStackedWidget(self.centralwidget) + font = QtGui.QFont() + font.setFamily("微软雅黑") + font.setBold(False) + font.setWeight(50) + self.stackedWidget.setFont(font) self.stackedWidget.setObjectName("stackedWidget") self.page_chat = QtWidgets.QWidget() self.page_chat.setObjectName("page_chat") @@ -93,6 +114,9 @@ def setupUi(self, MainWindow): self.menu_F = QtWidgets.QMenu(self.menubar) self.menu_F.setObjectName("menu_F") self.menu = QtWidgets.QMenu(self.menubar) + font = QtGui.QFont() + font.setFamily("微软雅黑") + self.menu.setFont(font) self.menu.setObjectName("menu") self.menu_2 = QtWidgets.QMenu(self.menubar) self.menu_2.setObjectName("menu_2") @@ -105,6 +129,9 @@ def setupUi(self, MainWindow): self.action_4 = QtWidgets.QAction(MainWindow) self.action_4.setObjectName("action_4") self.action = QtWidgets.QAction(MainWindow) + font = QtGui.QFont() + font.setFamily("Microsoft YaHei UI") + self.action.setFont(font) self.action.setObjectName("action") self.menu_F.addSeparator() self.menu_F.addSeparator() diff --git a/app/Ui/mainwindow.ui b/app/Ui/mainwindow.ui index c093b38f..f28e78ca 100644 --- a/app/Ui/mainwindow.ui +++ b/app/Ui/mainwindow.ui @@ -48,10 +48,10 @@ background-color:rgb(240,240,240) - QFrame::StyledPanel + QFrame::NoFrame - QFrame::Sunken + QFrame::Plain @@ -74,6 +74,11 @@ 60 + + + 微软雅黑 + + QPushButton {background-color: rgb(240,240,240);} QPushButton:hover{background-color: rgb(209,209,209);} @@ -82,6 +87,9 @@ 聊天 + + true + @@ -92,6 +100,11 @@ 60 + + + 微软雅黑 + + QPushButton {background-color: rgb(240,240,240);} QPushButton:hover{background-color: rgb(209,209,209);} @@ -100,6 +113,9 @@ 联系人 + + true + @@ -110,6 +126,11 @@ 60 + + + 微软雅黑 + + QPushButton {background-color: rgb(240,240,240);} QPushButton:hover{background-color: rgb(209,209,209);} @@ -118,6 +139,9 @@ 我的 + + true + @@ -128,6 +152,11 @@ 60 + + + 微软雅黑 + + QPushButton {background-color: rgb(240,240,240);} QPushButton:hover{background-color: rgb(209,209,209);} @@ -136,6 +165,9 @@ 关于 + + true + @@ -157,6 +189,13 @@ + + + 微软雅黑 + 50 + false + + @@ -184,6 +223,11 @@ + + + 微软雅黑 + + 编辑 @@ -213,6 +257,11 @@ 关于 + + + Microsoft YaHei UI + +