/* HIS-GUI 自定义主题样式表 - 医疗蓝主题 */ /* ========== 全局样式 ========== */ QMainWindow, QWidget { background-color: #f5f7fa; font-family: "Microsoft YaHei", "Segoe UI", "PingFang SC", sans-serif; font-size: 14px; color: #333333; } /* ========== 菜单栏 ========== */ QMenuBar { background-color: #1e3a5f; color: #ffffff; padding: 6px 10px; border-bottom: 2px solid #2980b9; } QMenuBar::item { background-color: transparent; padding: 6px 12px; color: #ffffff; } QMenuBar::item:selected { background-color: #2980b9; border-radius: 4px; } QMenuBar::item:pressed { background-color: #1a5276; } QMenu { background-color: #ffffff; border: 1px solid #d1d8e0; border-radius: 6px; padding: 5px 0; } QMenu::item { padding: 8px 25px 8px 20px; color: #333333; } QMenu::item:selected { background-color: #e8f4fc; color: #1e3a5f; } /* ========== 工具栏 ========== */ QToolBar { background-color: #ffffff; border: none; border-bottom: 1px solid #d1d8e0; padding: 8px; spacing: 10px; } QToolBar::separator { background-color: #d1d8e0; width: 1px; margin: 5px 8px; } /* ========== 侧边导航栏 ========== */ QListWidget { background-color: #1e3a5f; border: none; border-right: 3px solid #2980b9; padding: 10px 0; outline: none; } QListWidget::item { color: #b8c9db; padding: 14px 25px; margin: 3px 10px; border-radius: 8px; font-size: 15px; font-weight: 500; } QListWidget::item:selected { background-color: #2980b9; color: #ffffff; } QListWidget::item:hover:!selected { background-color: #2c5282; color: #ffffff; } /* ========== 按钮样式 ========== */ QPushButton { background-color: #3498db; color: #ffffff; border: none; border-radius: 6px; padding: 10px 20px; font-size: 14px; font-weight: 500; min-width: 80px; } QPushButton:hover { background-color: #2980b9; } QPushButton:pressed { background-color: #1a5276; } QPushButton:disabled { background-color: #bdc3c7; color: #7f8c8d; } /* 主要操作按钮 - 蓝色 */ QPushButton[class="primary"] { background-color: #3498db; } QPushButton[class="primary"]:hover { background-color: #2980b9; } /* 次要操作按钮 - 灰色 */ QPushButton[class="secondary"] { background-color: #95a5a6; } QPushButton[class="secondary"]:hover { background-color: #7f8c8d; } /* 成功按钮 - 绿色 */ QPushButton[class="success"] { background-color: #27ae60; } QPushButton[class="success"]:hover { background-color: #229954; } /* 警告按钮 - 橙色 */ QPushButton[class="warning"] { background-color: #e67e22; } QPushButton[class="warning"]:hover { background-color: #d35400; } /* 危险按钮 - 红色 */ QPushButton[class="danger"] { background-color: #e74c3c; } QPushButton[class="danger"]:hover { background-color: #c0392b; } /* ========== 输入框 ========== */ QLineEdit, QTextEdit, QPlainTextEdit { background-color: #ffffff; border: 2px solid #d1d8e0; border-radius: 6px; padding: 10px 12px; color: #333333; selection-background-color: #3498db; selection-color: #ffffff; } QLineEdit:focus, QTextEdit:focus, QPlainTextEdit:focus { border-color: #3498db; background-color: #f8fbfd; } QLineEdit:disabled, QTextEdit:disabled, QPlainTextEdit:disabled { background-color: #ecf0f1; color: #95a5a6; } /* ========== 下拉框 ========== */ QComboBox { background-color: #ffffff; border: 2px solid #d1d8e0; border-radius: 6px; padding: 10px 12px; color: #333333; min-width: 100px; } QComboBox:hover { border-color: #3498db; } QComboBox:focus { border-color: #2980b9; } QComboBox::drop-down { border: none; width: 30px; } QComboBox::down-arrow { image: none; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid #7f8c8d; margin-right: 10px; } QComboBox QAbstractItemView { background-color: #ffffff; border: 1px solid #d1d8e0; border-radius: 6px; selection-background-color: #e8f4fc; selection-color: #1e3a5f; padding: 5px; outline: none; } /* ========== SpinBox ========== */ QSpinBox, QDoubleSpinBox { background-color: #ffffff; border: 2px solid #d1d8e0; border-radius: 6px; padding: 8px 10px; color: #333333; } QSpinBox:focus, QDoubleSpinBox:focus { border-color: #3498db; } QSpinBox::up-button, QDoubleSpinBox::up-button { border: none; background-color: transparent; width: 20px; } QSpinBox::down-button, QDoubleSpinBox::down-button { border: none; background-color: transparent; width: 20px; } /* ========== 表格 ========== */ QTableWidget, QTableView { background-color: #ffffff; border: 1px solid #d1d8e0; border-radius: 8px; gridline-color: #e8ecef; selection-background-color: #e8f4fc; selection-color: #1e3a5f; outline: none; } QTableWidget::item, QTableView::item { padding: 10px 8px; border-bottom: 1px solid #ecf0f1; } QTableWidget::item:selected, QTableView::item:selected { background-color: #d4e9f7; } QHeaderView::section { background-color: #1e3a5f; color: #ffffff; padding: 12px 8px; border: none; border-right: 1px solid #2c5282; font-weight: 600; text-align: left; } QHeaderView::section:last { border-right: none; } QHeaderView::section:hover { background-color: #2c5282; } /* ========== 树形控件 ========== */ QTreeWidget, QTreeView { background-color: #ffffff; border: 1px solid #d1d8e0; border-radius: 8px; padding: 10px; outline: none; } QTreeWidget::item, QTreeView::item { padding: 8px 5px; border-bottom: 1px solid #ecf0f1; } QTreeWidget::item:hover, QTreeView::item:hover { background-color: #f8fbfd; } QTreeWidget::item:selected, QTreeView::item:selected { background-color: #d4e9f7; color: #1e3a5f; } QTreeWidget::branch:has-children:!has-siblings:closed, QTreeWidget::branch:closed:has-children:has-siblings { border-image: none; image: url(none); } /* ========== Tab标签页 ========== */ QTabWidget::pane { border: 1px solid #d1d8e0; border-radius: 8px; background-color: #ffffff; margin-top: -1px; } QTabBar::tab { background-color: #e8ecef; color: #7f8c8d; padding: 10px 25px; margin-right: 2px; border-top-left-radius: 6px; border-top-right-radius: 6px; font-weight: 500; } QTabBar::tab:selected { background-color: #ffffff; color: #1e3a5f; border-bottom: 3px solid #3498db; } QTabBar::tab:hover:!selected { background-color: #d5dbdb; color: #1e3a5f; } /* ========== 组框 ========== */ QGroupBox { background-color: #ffffff; border: 1px solid #d1d8e0; border-radius: 8px; margin-top: 15px; padding: 15px; padding-top: 25px; font-weight: 600; color: #1e3a5f; } QGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; left: 15px; padding: 0 10px; background-color: #ffffff; } /* ========== 标签 ========== */ QLabel { color: #333333; background-color: transparent; } QLabel[heading="true"] { font-size: 18px; font-weight: bold; color: #1e3a5f; } QLabel[subheading="true"] { font-size: 15px; font-weight: 600; color: #2c5282; } /* ========== 对话框 ========== */ QDialog { background-color: #f5f7fa; } /* ========== 滚动条 ========== */ QScrollBar:vertical { background-color: #f5f7fa; width: 12px; margin: 0; border-radius: 6px; } QScrollBar::handle:vertical { background-color: #bdc3c7; border-radius: 6px; min-height: 30px; } QScrollBar::handle:vertical:hover { background-color: #95a5a6; } QScrollBar::add-line:vertical, QScrollBar::sub-line:vertical { height: 0; } QScrollBar:horizontal { background-color: #f5f7fa; height: 12px; margin: 0; border-radius: 6px; } QScrollBar::handle:horizontal { background-color: #bdc3c7; border-radius: 6px; min-width: 30px; } QScrollBar::handle:horizontal:hover { background-color: #95a5a6; } QScrollBar::add-line:horizontal, QScrollBar::sub-line:horizontal { width: 0; } /* ========== 进度条 ========== */ QProgressBar { background-color: #ecf0f1; border: none; border-radius: 6px; height: 20px; text-align: center; color: #1e3a5f; font-weight: 600; } QProgressBar::chunk { background-color: #3498db; border-radius: 6px; } /* ========== 滑块 ========== */ QSlider::groove:horizontal { border: none; height: 6px; background-color: #ecf0f1; border-radius: 3px; } QSlider::handle:horizontal { background-color: #3498db; border: none; width: 18px; height: 18px; margin: -6px 0; border-radius: 9px; } QSlider::handle:horizontal:hover { background-color: #2980b9; } QSlider::sub-page:horizontal { background-color: #3498db; border-radius: 3px; } /* ========== 复选框 ========== */ QCheckBox { spacing: 10px; color: #333333; } QCheckBox::indicator { width: 20px; height: 20px; border: 2px solid #d1d8e0; border-radius: 4px; background-color: #ffffff; } QCheckBox::indicator:checked { background-color: #3498db; border-color: #3498db; } QCheckBox::indicator:hover { border-color: #3498db; } /* ========== 单选按钮 ========== */ QRadioButton { spacing: 10px; color: #333333; } QRadioButton::indicator { width: 20px; height: 20px; border: 2px solid #d1d8e0; border-radius: 10px; background-color: #ffffff; } QRadioButton::indicator:checked { background-color: #3498db; border-color: #3498db; } QRadioButton::indicator:hover { border-color: #3498db; } /* ========== 工具提示 ========== */ QToolTip { background-color: #1e3a5f; color: #ffffff; border: none; border-radius: 4px; padding: 6px 10px; font-size: 13px; } /* ========== 状态栏 ========== */ QStatusBar { background-color: #ffffff; border-top: 1px solid #d1d8e0; color: #7f8c8d; padding: 5px; } QStatusBar::item { border: none; } /* ========== 日期选择器 ========== */ QDateEdit, QDateTimeEdit { background-color: #ffffff; border: 2px solid #d1d8e0; border-radius: 6px; padding: 8px 10px; color: #333333; } QDateEdit:focus, QDateTimeEdit:focus { border-color: #3498db; } /* ========== 消息框 ========== */ QMessageBox { background-color: #ffffff; } QMessageBox QLabel { color: #333333; padding: 10px; } /* ========== 菜单按钮 ========== */ QMenuButton { background-color: #3498db; color: #ffffff; border: none; border-radius: 6px; padding: 8px 15px; }