You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

884 lines
20 KiB
Plaintext

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

/* ==================== DCS2025 工业控制系统样式表 ==================== */
/* 重构版本 - 消除重复,统一样式 */
/* ==================== 全局变量和基础样式 ==================== */
* {
font-family: "PingFangSC-Regular", "Microsoft YaHei", sans-serif;
}
/* ==================== 主容器样式 ==================== */
QWidget#centralwidget {
background-color: #F5F5F5;
border-radius: 8px;
}
QWidget#titlewidget {
background-color: #FFFFFF;
}
QWidget#topWidget {
background-color: #2277EF;
}
QWidget#userWidget,
QWidget#projectWidget,
QWidget#LoginWidget {
background-color: #FFFFFF;
border-radius: 8px;
border: 1px solid #E5E7EB;
}
QWidget#userBtnWidget,
QWidget#projectBtnWidget {
background-color: #FFFFFF;
margin-top: 7px;
margin-right: 7px;
}
QWidget#userCheckWidget {
background-color: #FFFFFF;
margin-top: 7px;
}
QWidget#registerWidget {
background: #181922;
}
/* ==================== 左侧导航栏样式 ==================== */
QWidget#leftWidget {
background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
stop:0 #FFFFFF,
stop:0.2 #FEFEFE,
stop:0.5 #FAFBFC,
stop:0.8 #F6F8FA,
stop:1 #F1F3F5);
border-right: 1px solid #E1E5E9;
min-width: 260px;
max-width: 260px;
}
/* 导航按钮基础样式 */
QPushButton#createProject,
QPushButton#openProject,
QPushButton#userMag,
QPushButton#protocolMag,
QPushButton#controlMag,
QPushButton#procedureMag,
QPushButton#varMag,
QPushButton#trendMag {
border: none;
font-size: 16px;
text-align: left;
font-family: "PingFangSC-Medium", "Microsoft YaHei", sans-serif;
color: #6B7280;
background-color: transparent;
padding: 16px 20px;
margin: 4px 16px;
border-radius: 12px;
min-height: 52px;
icon-size: 22px 22px;
}
/* 导航按钮悬停效果 */
QPushButton#createProject:hover,
QPushButton#openProject:hover,
QPushButton#userMag:hover,
QPushButton#protocolMag:hover,
QPushButton#controlMag:hover,
QPushButton#procedureMag:hover,
QPushButton#varMag:hover,
QPushButton#trendMag:hover {
color: #2277EF;
background: qlineargradient(x1:0, y1:0, x2:1, y2:0,
stop:0 rgba(34, 119, 239, 15),
stop:1 rgba(34, 119, 239, 5));
border-radius: 12px;
}
/* 导航按钮选中状态 */
QPushButton#createProject:checked,
QPushButton#openProject:checked,
QPushButton#userMag:checked,
QPushButton#protocolMag:checked,
QPushButton#controlMag:checked,
QPushButton#procedureMag:checked,
QPushButton#varMag:checked,
QPushButton#trendMag:checked {
background: qlineargradient(x1:0, y1:0, x2:1, y2:0,
stop:0 #2277EF,
stop:0.3 #3B82F6,
stop:0.7 #60A5FA,
stop:1 rgba(96, 165, 250, 200));
color: #FFFFFF;
font-weight: bold;
border-radius: 12px;
border: none;
}
/* ==================== 表格统一样式 ==================== */
/* 表格容器基础样式 */
QTableView {
border: none;
outline: none;
gridline-color: transparent;
background-color: #FFFFFF;
selection-color: #1976D2;
font-size: 15px;
font-family: "PingFangSC-Regular", "Microsoft YaHei", sans-serif;
font-weight: 400;
color: #374151;
}
/* 表格项统一样式 */
QTableView::item {
border: none;
outline: none;
min-height: 48px;
/* 不设置background-color让模型的背景颜色生效 */
}
/* 表格项悬停效果 */
QTableView::item:hover {
color: #2277EF;
}
/* 表格项选中效果 */
QTableView::item:selected {
color: #1976D2;
font-weight: 500;
}
/* ==================== 专用表格样式 ==================== */
/* 用户和工程表格特殊样式 */
QTableView#userView,
QTableView#projectView {
background-color: #FFFFFF;
padding: 10px;
}
QTableView#userView::item,
QTableView#projectView::item {
/* margin: 4px 2px; */
border-radius: 6px;
min-height: 40px !important;
height: 40px;
/* padding: 8px 14px; */
font-size: 15px;
line-height: 24px;
}
/* ==================== 表头统一样式 ==================== */
/* 表头基础样式 */
QHeaderView {
border: none;
outline: none;
background-color: transparent;
}
QHeaderView::section {
border: none;
outline: none;
text-align: center;
font-family: "PingFangSC-Medium", "Microsoft YaHei", sans-serif;
font-weight: 600;
}
/* 用户和工程表头样式 */
QHeaderView#userHeader::section,
QHeaderView#projectHeader::section {
color: #1F2937;
font-size: 16px;
height: 26px;
background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
stop:0 #FFFFFF,
stop:1 #F8F9FA);
padding: 16px 12px;
border-bottom: 2px solid #E5E7EB;
}
/* ==================== 按钮统一样式 ==================== */
/* 基础按钮样式 */
QPushButton {
border: none;
outline: none;
font-family: "PingFangSC-Medium", "Microsoft YaHei", sans-serif;
}
/* 设置按钮样式 */
QPushButton#setButton {
min-height: 36px;
background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
stop:0 #2277EF,
stop:1 #1976D2);
border-radius: 6px;
color: #FFFFFF;
font-size: 14px;
font-weight: 600;
padding: 8px 16px;
}
QPushButton#setButton:hover {
background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
stop:0 #3B82F6,
stop:1 #2277EF);
}
QPushButton#setButton:pressed {
background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
stop:0 #1976D2,
stop:1 #1565C0);
}
/* 功能按钮样式 */
/* 新建按钮样式 */
QPushButton#createBtn {
color: #1D4ED8;
font-size: 15px;
font-weight: 600;
padding: 8px 16px;
background-color: #EBF8FF;
border-radius: 6px;
border: 1px solid #BFDBFE;
font-family: "PingFangSC-Medium", "Microsoft YaHei", sans-serif;
}
QPushButton#createBtn:hover {
background-color: #DBEAFE;
border-color: #93C5FD;
color: #1E40AF;
}
QPushButton#createBtn:pressed {
background-color: #BFDBFE;
border-color: #60A5FA;
color: #1E3A8A;
}
/* 导入按钮样式 */
QPushButton#importBtn {
color: #047857;
font-size: 15px;
font-weight: 600;
padding: 8px 16px;
background-color: #ECFDF5;
border-radius: 6px;
border: 1px solid #BBF7D0;
font-family: "PingFangSC-Medium", "Microsoft YaHei", sans-serif;
}
QPushButton#importBtn:hover {
background-color: #D1FAE5;
border-color: #86EFAC;
color: #065F46;
}
QPushButton#importBtn:pressed {
background-color: #A7F3D0;
border-color: #6EE7B7;
color: #064E3B;
}
/* 导出按钮样式 */
QPushButton#exportBtn {
color: #6D28D9;
font-size: 15px;
font-weight: 600;
padding: 8px 16px;
background-color: #F3E8FF;
border-radius: 6px;
border: 1px solid #C4B5FD;
font-family: "PingFangSC-Medium", "Microsoft YaHei", sans-serif;
}
QPushButton#exportBtn:hover {
background-color: #EDE9FE;
border-color: #A78BFA;
color: #5B21B6;
}
QPushButton#exportBtn:pressed {
background-color: #DDD6FE;
border-color: #8B5CF6;
color: #4C1D95;
}
/* 批量强制按钮样式 */
QPushButton#forceBtn {
color: #D97706;
font-size: 15px;
font-weight: 600;
padding: 8px 16px;
background-color: #FEF3C7;
border-radius: 6px;
border: 1px solid #FCD34D;
font-family: "PingFangSC-Medium", "Microsoft YaHei", sans-serif;
}
QPushButton#forceBtn:hover {
background-color: #FDE68A;
border-color: #FBBF24;
color: #B45309;
}
QPushButton#forceBtn:pressed {
background-color: #FCD34D;
border-color: #F59E0B;
color: #92400E;
}
/* 清除颜色按钮样式 */
QPushButton#clearBtn {
color: #B91C1C;
font-size: 15px;
font-weight: 600;
padding: 8px 16px;
background-color: #FEF2F2;
border-radius: 6px;
border: 1px solid #FECACA;
font-family: "PingFangSC-Medium", "Microsoft YaHei", sans-serif;
}
QPushButton#clearBtn:hover {
background-color: #FEE2E2;
border-color: #FCA5A5;
color: #991B1B;
}
QPushButton#clearBtn:pressed {
background-color: #FECACA;
border-color: #F87171;
color: #7F1D1D;
}
/* 查看报文按钮样式 */
QPushButton#messageBtn {
color: #7C3AED;
font-size: 15px;
font-weight: 600;
padding: 8px 16px;
background-color: #F3E8FF;
border-radius: 6px;
border: 1px solid #C4B5FD;
font-family: "PingFangSC-Medium", "Microsoft YaHei", sans-serif;
}
QPushButton#messageBtn:hover {
background-color: #EDE9FE;
border-color: #A78BFA;
color: #6D28D9;
}
QPushButton#messageBtn:pressed {
background-color: #DDD6FE;
border-color: #8B5CF6;
color: #5B21B6;
}
/* 开始通讯按钮样式 */
QPushButton#startProtocolBtn {
color: #047857;
font-size: 15px;
font-weight: 600;
padding: 8px 16px;
background-color: #ECFDF5;
border-radius: 6px;
border: 1px solid #BBF7D0;
font-family: "PingFangSC-Medium", "Microsoft YaHei", sans-serif;
}
QPushButton#startProtocolBtn:hover {
background-color: #D1FAE5;
border-color: #86EFAC;
color: #065F46;
}
QPushButton#startProtocolBtn:pressed {
background-color: #A7F3D0;
border-color: #6EE7B7;
color: #064E3B;
}
/* 批量删除按钮样式 */
QPushButton#delBtn {
color: #B91C1C;
font-size: 15px;
font-weight: 600;
padding: 8px 16px;
background-color: #FEF2F2;
border-radius: 6px;
border: 1px solid #FECACA;
font-family: "PingFangSC-Medium", "Microsoft YaHei", sans-serif;
}
QPushButton#delBtn:hover {
background-color: #FEE2E2;
border-color: #FCA5A5;
color: #991B1B;
}
QPushButton#delBtn:pressed {
background-color: #FECACA;
border-color: #F87171;
color: #7F1D1D;
}
/* 登录按钮样式 */
QPushButton#loginButton,
QPushButton#exitButton {
min-width: 80px;
min-height: 36px;
max-width: 120px;
max-height: 36px;
background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
stop:0 #2277EF,
stop:1 #1976D2);
border: 1px solid #1976D2;
border-radius: 6px;
color: #FFFFFF;
font-size: 14px;
font-weight: 600;
font-family: "PingFangSC-Medium", "Microsoft YaHei", sans-serif;
padding: 8px 16px;
}
QPushButton#loginButton:hover,
QPushButton#exitButton:hover {
background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
stop:0 #3B82F6,
stop:1 #2277EF);
border-color: #2277EF;
}
QPushButton#loginButton:pressed,
QPushButton#exitButton:pressed {
background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
stop:0 #1976D2,
stop:1 #1565C0);
border-color: #1565C0;
}
QPushButton#loginButton:focus,
QPushButton#exitButton:focus {
outline: none;
border: 2px solid #60A5FA;
}
/* ==================== 输入框统一样式 ==================== */
/* 基础输入框样式 */
QLineEdit {
border: 1px solid #D1D5DB;
border-radius: 6px;
padding: 8px 12px;
font-size: 14px;
font-family: "PingFangSC-Regular", "Microsoft YaHei", sans-serif;
background-color: #FFFFFF;
color: #374151;
}
QLineEdit:focus {
border-color: #2277EF;
background-color: #F8F9FF;
}
/* 用户输入框样式 */
QLineEdit#userEdit,
QLineEdit#pwdEdit {
width: 240px;
height: 36px;
background-color: #F9FAFB;
border: 1px solid #E5E7EB;
font-size: 14px;
}
/* 搜索输入框样式 */
QLineEdit#searchEdit {
background-color: #4b8cf2;
border: none;
padding: 8px 15px;
color: #FFFFFF;
font-size: 14px;
}
QLineEdit#searchEdit::placeholder {
color: rgba(255, 255, 255, 0.7);
}
/* ==================== 标签统一样式 ==================== */
/* 标题标签样式 */
QLabel#titleLabel {
color: #FFFFFF;
font-size: 24px;
font-family: "PingFangSC-Semibold", "Microsoft YaHei", sans-serif;
font-weight: bold;
}
/* 设置标签样式 */
QLabel#mesLabel {
background-color: #F3F4F6;
border: none;
min-width: 180px;
min-height: 32px;
border-radius: 6px;
padding: 8px 12px;
color: #374151;
font-size: 14px;
font-weight: 500;
}
/* ==================== 下拉框统一样式 ==================== */
QComboBox {
border-radius: 6px;
padding: 6px 12px;
font-size: 14px;
font-family: "PingFangSC-Regular", "Microsoft YaHei", sans-serif;
background-color: #FFFFFF;
color: #374151;
min-height: 32px;
}
QComboBox:focus {
border-color: #2277EF;
}
QComboBox::drop-down {
subcontrol-origin: padding;
subcontrol-position: top right;
width: 20px;
border: none;
}
QComboBox::down-arrow {
image: url(./Static/down.png);
width: 12px;
height: 12px;
}
QComboBox QAbstractItemView {
border: 1px solid #E5E7EB;
/* border-radius: 6px; */
background-color: #FFFFFF;
selection-background-color: #E3F2FD;
selection-color: #1976D2;
font-size: 14px;
outline: none;
}
QComboBox QAbstractItemView::item {
padding: 8px 12px;
min-height: 32px;
}
QComboBox QAbstractItemView::item:hover {
background-color: #F3F4F6;
}
/* 全局下拉列表样式 - 强制修复黑色背景问题 */
QComboBox QAbstractItemView {
background-color: white !important;
color: black !important;
border: 1px solid #E5E7EB;
/* border-radius: 4px; */
selection-background-color: #E3F2FD !important;
selection-color: #1976D2 !important;
outline: none;
font-size: 14px;
show-decoration-selected: 1;
}
QComboBox QAbstractItemView::item {
background-color: white !important;
color: black !important;
padding: 8px 12px;
min-height: 28px;
border: none;
}
QComboBox QAbstractItemView::item:hover {
background-color: #F3F4F6 !important;
color: black !important;
}
QComboBox QAbstractItemView::item:selected {
background-color: #E3F2FD !important;
color: #1976D2 !important;
}
/* ==================== 滚动条统一样式 ==================== */
QScrollBar:vertical {
background: #F3F4F6;
width: 12px;
border-radius: 6px;
margin: 0px;
}
QScrollBar::handle:vertical {
background: #9CA3AF;
border-radius: 6px;
min-height: 20px;
}
QScrollBar::handle:vertical:hover {
background: #6B7280;
}
QScrollBar::add-line:vertical,
QScrollBar::sub-line:vertical {
height: 0px;
}
QScrollBar::add-page:vertical,
QScrollBar::sub-page:vertical {
background: transparent;
}
/* ==================== 复选框样式 ==================== */
QCheckBox#userBox::indicator {
width: 20px;
height: 20px;
}
QCheckBox#userBox::indicator:checked {
image: url(./Static/checkoff.png);
}
QCheckBox#userBox::indicator:unchecked {
image: url(./Static/checkon.png);
}
/* ==================== 文本编辑框样式 ==================== */
QTextEdit#mesEdit {
border: 1px solid #D1D5DB;
border-radius: 8px;
font-size: 14px;
font-family: "PingFangSC-Regular", "Microsoft YaHei", sans-serif;
background-color: #FFFFFF;
color: #374151;
padding: 8px;
}
QTextEdit#mesEdit:focus {
border-color: #2277EF;
}
/* ==================== 列表视图样式 ==================== */
QListView {
background-color: #FFFFFF;
font-size: 14px;
font-family: "PingFangSC-Regular", "Microsoft YaHei", sans-serif;
border: 1px solid #E5E7EB;
border-radius: 6px;
padding: 4px;
}
QListView::item {
border-radius: 4px;
padding: 8px 12px;
margin: 2px;
border: none;
}
QListView::item:hover {
background-color: #F3F4F6;
color: #1F2937;
}
QListView::item:selected {
background-color: #E3F2FD;
color: #1976D2;
border: none;
}
/* ==================== 表格视图样式 ==================== */
QTableView {
background-color: #FFFFFF;
alternate-background-color: #F8F9FA;
gridline-color: #E5E7EB;
selection-background-color: #E3F2FD;
selection-color: #1976D2;
font-size: 13px;
font-family: "PingFangSC-Regular", "Microsoft YaHei", sans-serif;
border: 1px solid #E5E7EB;
border-radius: 6px;
}
QTableView::item {
padding: 8px 12px;
border: none;
border-bottom: 1px solid #F1F3F4;
}
QTableView::item:hover {
background-color: #F3F4F6;
}
QTableView::item:selected {
background-color: #E3F2FD;
color: #1976D2;
}
/* 表格行交替颜色 */
QTableView::item:alternate {
background-color: #F8F9FA;
}
/* 表格焦点样式 */
QTableView:focus {
border: 2px solid #2277EF;
outline: none;
}
/* ==================== 消息框样式 ==================== */
QMessageBox {
background-color: #FFFFFF;
border-radius: 8px;
font-family: "Microsoft YaHei", "PingFangSC-Regular", sans-serif;
border: 1px solid #d1d9e0;
min-width: 300px;
min-height: 120px;
}
QMessageBox QLabel {
color: #2c3e50;
font-size: 14px;
padding: 10px;
font-weight: 400;
}
QMessageBox QPushButton {
background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
stop:0 #2277EF,
stop:1 #1976D2);
color: #FFFFFF;
border: 1px solid #1976D2;
border-radius: 6px;
padding: 8px 16px;
font-weight: bold;
min-width: 80px;
min-height: 32px;
font-size: 13px;
font-family: "PingFangSC-Medium", "Microsoft YaHei", sans-serif;
}
QMessageBox QPushButton:hover {
background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
stop:0 #3B82F6,
stop:1 #2277EF);
border-color: #2277EF;
}
QMessageBox QPushButton:pressed {
background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
stop:0 #1976D2,
stop:1 #1565C0);
border-color: #1565C0;
}
QMessageBox QPushButton:default {
background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
stop:0 #059669,
stop:1 #047857);
border-color: #047857;
}
QMessageBox QPushButton:default:hover {
background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
stop:0 #10B981,
stop:1 #059669);
}
/* ==================== Tab标签页样式 ==================== */
QTabBar#varManageTabBar::tab {
font-family: "PingFangSC-Medium", "Microsoft YaHei", sans-serif;
font-size: 16px;
width: 160px;
height: 40px;
padding: 8px 16px;
margin: 2px;
border-radius: 6px;
background-color: #F3F4F6;
color: #6B7280;
}
QTabBar#varManageTabBar::tab:hover {
background-color: #E3F2FD;
color: #2277EF;
}
QTabBar#varManageTabBar::tab:selected {
background-color: #2277EF;
color: #FFFFFF;
font-weight: 600;
}
/* ==================== 分组框样式 ==================== */
QGroupBox {
font-family: "PingFangSC-Medium", "Microsoft YaHei", sans-serif;
font-weight: 600;
border: 1px solid #E5E7EB;
border-radius: 8px;
margin-top: 12px;
padding-top: 8px;
background-color: #FFFFFF;
}
QGroupBox::title {
subcontrol-origin: margin;
left: 10px;
padding: 0 8px;
background-color: #FFFFFF;
color: #374151;
font-size: 16px;
}
/* ==================== 注册界面样式 ==================== */
QPushButton#registerPushButton {
width: 100px;
height: 32px;
border-radius: 6px;
color: #FFFFFF;
font-size: 14px;
font-weight: 600;
background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
stop:0 #10B981,
stop:1 #059669);
}
QPushButton#cancel_btn {
width: 100px;
height: 32px;
border-radius: 6px;
color: #FFFFFF;
font-size: 14px;
font-weight: 600;
background: #6B7280;
}
QLabel#registerlabel {
color: #6B7280;
font-size: 13px;
font-family: "PingFangSC-Regular", "Microsoft YaHei", sans-serif;
text-align: center;
}
QLabel#registerlabel_1,
QLabel#registerlabel_2 {
color: #FFFFFF;
font-size: 15px;
font-family: "PingFangSC-Medium", "Microsoft YaHei", sans-serif;
font-weight: 600;
}
QLineEdit#registerlineEdit {
width: 360px;
height: 38px;
border-radius: 8px;
background: #21232f;
color: #FFFFFF;
font-size: 16px;
padding: 8px 12px;
border: 1px solid #4A5568;
}
QLineEdit#registerlineEdit:focus {
border-color: #2277EF;
}