Skip to content

Commit

Permalink
修改部分UI
Browse files Browse the repository at this point in the history
  • Loading branch information
LC044 committed Nov 9, 2023
1 parent 576981e commit 52b52ab
Show file tree
Hide file tree
Showing 14 changed files with 133 additions and 48 deletions.
39 changes: 21 additions & 18 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions app/ImageBox/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions app/Ui/Icon.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
5 changes: 4 additions & 1 deletion app/Ui/MyComponents/Button_Contact.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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")
Expand Down
6 changes: 4 additions & 2 deletions app/Ui/chat/chatUi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -151,5 +151,7 @@ def retranslateUi(self, Form):
"p, li { white-space: pre-wrap; }\n"
"</style></head><body style=\" font-family:\'SimSun\'; font-size:15pt; font-weight:400; font-style:normal;\">\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"> </p>\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"> </p></body></html>"))
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"> </p>\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"> </p>\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"> </p></body></html>"))
self.btn_sendMsg_2.setText(_translate("Form", "发送"))
4 changes: 3 additions & 1 deletion app/Ui/chat/chatUi.ui
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<bool>false</bool>
</property>
<property name="frameShape">
<enum>QFrame::WinPanel</enum>
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
Expand Down Expand Up @@ -235,6 +235,8 @@
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; &lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; &lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;
</string>
</property>
Expand Down
7 changes: 3 additions & 4 deletions app/Ui/contact/contactInfo.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *

from app import person
Expand Down Expand Up @@ -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)
Expand Down
7 changes: 1 addition & 6 deletions app/Ui/contact/contactInfoUi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 1 addition & 7 deletions app/Ui/contact/contactInfoUi.ui
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,7 @@
<item>
<widget class="QPushButton" name="btn_analysis">
<property name="styleSheet">
<string notr="true">QPushButton:hover {
background-color: rgb(240, 240, 240);
}
QPushButton{
background-color:transparent;
}
</string>
<string notr="true"/>
</property>
<property name="text">
<string>统计信息</string>
Expand Down
2 changes: 1 addition & 1 deletion app/Ui/contact/contactUi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion app/Ui/contact/contactUi.ui
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
<bool>false</bool>
</property>
<property name="frameShape">
<enum>QFrame::WinPanel</enum>
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
Expand Down
8 changes: 8 additions & 0 deletions app/Ui/mainview.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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()

Expand All @@ -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):
Expand Down
Loading

0 comments on commit 52b52ab

Please sign in to comment.