修改部分ui

This commit is contained in:
shuaikangzhou 2023-12-14 22:59:48 +08:00
parent 02020a7886
commit bec28be16e
6 changed files with 58 additions and 54 deletions

View File

@ -8,7 +8,7 @@
# run again. Do not edit this file unless you know what you are doing. # 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_Form(object): class Ui_Form(object):
@ -34,14 +34,14 @@ class Ui_Form(object):
self.lineEdit.setMinimumSize(QtCore.QSize(200, 30)) self.lineEdit.setMinimumSize(QtCore.QSize(200, 30))
self.lineEdit.setMaximumSize(QtCore.QSize(200, 16777215)) self.lineEdit.setMaximumSize(QtCore.QSize(200, 16777215))
self.lineEdit.setStyleSheet("background:transparent;\n" self.lineEdit.setStyleSheet("background:transparent;\n"
"border-radius:5px;\n" " border-radius:5px;\n"
"border-top: 0px solid #b2e281;\n" " border-top: 0px solid #b2e281;\n"
"border-bottom: 0px solid #b2e281;\n" " border-bottom: 0px solid #b2e281;\n"
"border-right: 0px solid #b2e281;\n" " border-right: 0px solid #b2e281;\n"
"border-left: 0px solid #b2e281;\n" " border-left: 0px solid #b2e281;\n"
"border-style:outset;\n" " border-style:outset;\n"
"background-color:rgb(226,226,226);\n" " background-color:rgb(248,249,252);\n"
" ") " ")
self.lineEdit.setCursorMoveStyle(QtCore.Qt.VisualMoveStyle) self.lineEdit.setCursorMoveStyle(QtCore.Qt.VisualMoveStyle)
self.lineEdit.setObjectName("lineEdit") self.lineEdit.setObjectName("lineEdit")
self.horizontalLayout.addWidget(self.lineEdit) self.horizontalLayout.addWidget(self.lineEdit)

View File

@ -8,7 +8,7 @@
# run again. Do not edit this file unless you know what you are doing. # 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_Form(object): class Ui_Form(object):
@ -33,14 +33,14 @@ class Ui_Form(object):
self.lineEdit.setMinimumSize(QtCore.QSize(200, 30)) self.lineEdit.setMinimumSize(QtCore.QSize(200, 30))
self.lineEdit.setMaximumSize(QtCore.QSize(200, 16777215)) self.lineEdit.setMaximumSize(QtCore.QSize(200, 16777215))
self.lineEdit.setStyleSheet("background:transparent;\n" self.lineEdit.setStyleSheet("background:transparent;\n"
"border-radius:5px;\n" " border-radius:5px;\n"
"border-top: 0px solid #b2e281;\n" " border-top: 0px solid #b2e281;\n"
"border-bottom: 0px solid #b2e281;\n" " border-bottom: 0px solid #b2e281;\n"
"border-right: 0px solid #b2e281;\n" " border-right: 0px solid #b2e281;\n"
"border-left: 0px solid #b2e281;\n" " border-left: 0px solid #b2e281;\n"
"border-style:outset;\n" " border-style:outset;\n"
"background-color:rgb(226,226,226);\n" " background-color:rgb(248,249,252);\n"
" ") " ")
self.lineEdit.setCursorMoveStyle(QtCore.Qt.VisualMoveStyle) self.lineEdit.setCursorMoveStyle(QtCore.Qt.VisualMoveStyle)
self.lineEdit.setObjectName("lineEdit") self.lineEdit.setObjectName("lineEdit")
self.horizontalLayout.addWidget(self.lineEdit) self.horizontalLayout.addWidget(self.lineEdit)

View File

@ -36,12 +36,15 @@ QListWidget, QListView, QTreeWidget, QTreeView {
/*设置左侧选项的最小最大宽度,文字颜色和背景颜色*/ /*设置左侧选项的最小最大宽度,文字颜色和背景颜色*/
QListWidget { QListWidget {
min-width: 120px; min-width: 120px;
max-width: 120px; max-width: 380px;
color: black; color: black;
border:none; border:none;
} }
QListWidget::item{ QListWidget::item{
height:60; min-width: 80px;
max-width: 380px;
min-height: 60px;
max-height: 60px;
} }
QListWidget::item:hover { QListWidget::item:hover {
background: rgb(230, 235, 240); background: rgb(230, 235, 240);
@ -49,7 +52,7 @@ QListWidget::item:hover {
/*被选中时的背景颜色和左边框颜色*/ /*被选中时的背景颜色和左边框颜色*/
QListWidget::item:selected { QListWidget::item:selected {
background: rgb(230, 235, 240); background: rgb(230, 235, 240);
border-left: 3px solid rgb(62, 62, 62); border-left: 2px solid rgb(62, 62, 62);
color: black; color: black;
font-weight: bold; font-weight: bold;
} }

View File

@ -15,32 +15,13 @@ class Ui_MainWindow(object):
def setupUi(self, MainWindow): def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow") MainWindow.setObjectName("MainWindow")
MainWindow.resize(1280, 779) MainWindow.resize(1280, 779)
MainWindow.setStyleSheet("\n" font = QtGui.QFont()
" /*去掉item虚线边框*/\n" font.setFamily("微软雅黑")
" QListWidget, QListView, QTreeWidget, QTreeView {\n" font.setPointSize(12)
" outline: 0px;\n" font.setBold(False)
" }\n" font.setWeight(50)
" /*设置左侧选项的最小最大宽度,文字颜色和背景颜色*/\n" MainWindow.setFont(font)
" QListWidget {\n" MainWindow.setStyleSheet("")
" min-width: 120px;\n"
" max-width: 120px;\n"
" color: black;\n"
" background: white;\n"
" border:none;\n"
" }\n"
" QListWidget::item{\n"
" height:80;\n"
" }\n"
" /*被选中时的背景颜色和左边框颜色*/\n"
" QListWidget::item:selected {\n"
" background: rgb(204, 204, 204);\n"
" border-left: 4px solid rgb(9, 187, 7);\n"
" }\n"
" /*鼠标悬停颜色*/\n"
" HistoryPanel::item:hover {\n"
" background: rgb(52, 52, 52);\n"
" }\n"
" ")
self.centralwidget = QtWidgets.QWidget(MainWindow) self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget") self.centralwidget.setObjectName("centralwidget")
self.horizontalLayout = QtWidgets.QHBoxLayout(self.centralwidget) self.horizontalLayout = QtWidgets.QHBoxLayout(self.centralwidget)
@ -49,7 +30,7 @@ class Ui_MainWindow(object):
self.horizontalLayout.setObjectName("horizontalLayout") self.horizontalLayout.setObjectName("horizontalLayout")
self.frame_info = QtWidgets.QFrame(self.centralwidget) self.frame_info = QtWidgets.QFrame(self.centralwidget)
self.frame_info.setMinimumSize(QtCore.QSize(80, 500)) self.frame_info.setMinimumSize(QtCore.QSize(80, 500))
self.frame_info.setMaximumSize(QtCore.QSize(80, 16777215)) self.frame_info.setMaximumSize(QtCore.QSize(16777215, 16777215))
self.frame_info.setStyleSheet("") self.frame_info.setStyleSheet("")
self.frame_info.setFrameShape(QtWidgets.QFrame.NoFrame) self.frame_info.setFrameShape(QtWidgets.QFrame.NoFrame)
self.frame_info.setFrameShadow(QtWidgets.QFrame.Plain) self.frame_info.setFrameShadow(QtWidgets.QFrame.Plain)
@ -60,8 +41,8 @@ class Ui_MainWindow(object):
self.myavatar.setObjectName("myavatar") self.myavatar.setObjectName("myavatar")
self.listWidget = QtWidgets.QListWidget(self.frame_info) self.listWidget = QtWidgets.QListWidget(self.frame_info)
self.listWidget.setGeometry(QtCore.QRect(0, 230, 120, 331)) self.listWidget.setGeometry(QtCore.QRect(0, 230, 120, 331))
self.listWidget.setMinimumSize(QtCore.QSize(120, 0)) self.listWidget.setMinimumSize(QtCore.QSize(0, 0))
self.listWidget.setMaximumSize(QtCore.QSize(120, 16777215)) self.listWidget.setMaximumSize(QtCore.QSize(16777215, 16777215))
self.listWidget.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) self.listWidget.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
self.listWidget.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) self.listWidget.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
self.listWidget.setSizeAdjustPolicy(QtWidgets.QAbstractScrollArea.AdjustIgnored) self.listWidget.setSizeAdjustPolicy(QtWidgets.QAbstractScrollArea.AdjustIgnored)
@ -79,7 +60,8 @@ class Ui_MainWindow(object):
self.horizontalLayout.addWidget(self.frame_info) self.horizontalLayout.addWidget(self.frame_info)
self.stackedWidget = QtWidgets.QStackedWidget(self.centralwidget) self.stackedWidget = QtWidgets.QStackedWidget(self.centralwidget)
font = QtGui.QFont() font = QtGui.QFont()
font.setFamily("微软雅黑") font.setFamily("Microsoft YaHei UI")
font.setPointSize(15)
font.setBold(False) font.setBold(False)
font.setWeight(50) font.setWeight(50)
self.stackedWidget.setFont(font) self.stackedWidget.setFont(font)
@ -87,13 +69,22 @@ class Ui_MainWindow(object):
self.horizontalLayout.addWidget(self.stackedWidget) self.horizontalLayout.addWidget(self.stackedWidget)
MainWindow.setCentralWidget(self.centralwidget) MainWindow.setCentralWidget(self.centralwidget)
self.menubar = QtWidgets.QMenuBar(MainWindow) self.menubar = QtWidgets.QMenuBar(MainWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 1280, 23)) self.menubar.setGeometry(QtCore.QRect(0, 0, 1280, 28))
font = QtGui.QFont()
font.setFamily("微软雅黑")
font.setPointSize(12)
font.setBold(False)
font.setWeight(50)
self.menubar.setFont(font)
self.menubar.setObjectName("menubar") self.menubar.setObjectName("menubar")
self.menu_F = QtWidgets.QMenu(self.menubar) self.menu_F = QtWidgets.QMenu(self.menubar)
self.menu_F.setObjectName("menu_F") self.menu_F.setObjectName("menu_F")
self.menu_data = QtWidgets.QMenu(self.menubar) self.menu_data = QtWidgets.QMenu(self.menubar)
font = QtGui.QFont() font = QtGui.QFont()
font.setFamily("微软雅黑") font.setFamily("微软雅黑")
font.setPointSize(12)
font.setBold(False)
font.setWeight(50)
self.menu_data.setFont(font) self.menu_data.setFont(font)
self.menu_data.setObjectName("menu_data") self.menu_data.setObjectName("menu_data")
self.menu_output = QtWidgets.QMenu(self.menu_data) self.menu_output = QtWidgets.QMenu(self.menu_data)
@ -106,6 +97,12 @@ class Ui_MainWindow(object):
self.menu_3.setObjectName("menu_3") self.menu_3.setObjectName("menu_3")
MainWindow.setMenuBar(self.menubar) MainWindow.setMenuBar(self.menubar)
self.statusbar = QtWidgets.QStatusBar(MainWindow) self.statusbar = QtWidgets.QStatusBar(MainWindow)
font = QtGui.QFont()
font.setFamily("微软雅黑")
font.setPointSize(12)
font.setBold(False)
font.setWeight(50)
self.statusbar.setFont(font)
self.statusbar.setObjectName("statusbar") self.statusbar.setObjectName("statusbar")
MainWindow.setStatusBar(self.statusbar) MainWindow.setStatusBar(self.statusbar)
self.action_3 = QtWidgets.QAction(MainWindow) self.action_3 = QtWidgets.QAction(MainWindow)

View File

@ -29,8 +29,10 @@ QListWidget {
border:none; border:none;
} }
QListWidget::item{ QListWidget::item{
height:80px; min-width: 80px;
width:80px; max-width: 400px;
min-height: 80px;
max-height: 80px;
} }
/*被选中时的背景颜色和左边框颜色*/ /*被选中时的背景颜色和左边框颜色*/
QListWidget::item:selected { QListWidget::item:selected {

View File

@ -54,6 +54,8 @@ class ViewController(QWidget):
if __name__ == '__main__': if __name__ == '__main__':
app = QApplication(sys.argv) app = QApplication(sys.argv)
font = QFont('微软雅黑', 12) # 使用 Times New Roman 字体,字体大小为 14
app.setFont(font)
view = ViewController() view = ViewController()
try: try:
# view.loadPCDecryptView() # view.loadPCDecryptView()