Files
zyt/app/src/doctor_workstation/ui/patients_style.py
T
2026-10-29 16:14:55 +08:00

155 lines
9.4 KiB
Python

"""Quiet clinical surfaces for the patient-list workspace."""
from string import Template
from .design_system import clinical_stylesheet
from .reception_style import body_family, heading_family
def patients_chrome_stylesheet() -> str:
return clinical_stylesheet(Template(_CHROME).safe_substitute(body=body_family(), heading=heading_family()))
def patient_list_stylesheet() -> str:
return clinical_stylesheet(Template(_LIST).safe_substitute(body=body_family()))
_CHROME = """
#PatientsPage { background: $ds_canvas; }
#PatientsPage QWidget#PageHeader QLabel {
font-family: "$body"; font-size: 13px; font-weight: 400; color: $ds_muted;
}
#PatientsPage QWidget#PageHeader QLabel[role="pageTitle"] {
font-family: "$heading"; font-size: 20px; font-weight: 600; color: $ds_heading;
}
#PatientsPage QPushButton#PatientRefreshButton {
font-family: "$body"; font-size: 14px; font-weight: 400; color: $ds_text;
min-height: 38px; max-height: 38px; padding: 0 20px;
border: 1px solid transparent; border-radius: $ds_radius_control; background: $ds_surface_alt;
}
#PatientsPage QPushButton#PatientRefreshButton:hover { background: $ds_surface_alt; border-color: $ds_line_strong; }
#PatientsPage QPushButton#PatientRefreshButton:pressed { background: $ds_accent_soft; }
#PatientsPage QPushButton#PatientRefreshButton:focus { border-color: $ds_focus; }
#PatientsPage QPushButton#PatientRefreshButton:disabled { color: $ds_disabled; background: $ds_disabled_surface; }
#PatientsPage QTabWidget#PatientWorkspaceTabs::pane { border: 0; background: transparent; top: 0; }
#PatientsPage QTabWidget#PatientWorkspaceTabs > QTabBar::tab {
font-family: "$body"; font-size: 14px; font-weight: 400; color: $ds_text;
min-width: 84px; min-height: 42px; padding: 0 10px; margin-right: 22px;
border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent;
}
#PatientsPage QTabWidget#PatientWorkspaceTabs > QTabBar::tab:selected {
color: $ds_accent; border-bottom-color: $ds_accent; background: transparent;
}
#PatientsPage QTabWidget#PatientWorkspaceTabs > QTabBar::tab:hover { color: $ds_accent; background: $ds_accent_soft; }
"""
_LIST = """
#PatientListWorkspace { background: transparent; color: $ds_text; }
#PatientWorkspaceContent, #PatientWorkspaceScroll { background: transparent; border: 0; }
#PatientListWorkspace QLabel, #PatientListWorkspace QPushButton,
#PatientListWorkspace QToolButton, #PatientListWorkspace QDateEdit,
#PatientListWorkspace QTableWidget, #PatientSearchToolbar QLineEdit,
#PatientSearchToolbar QPushButton {
font-family: "$body"; font-size: 14px; font-weight: 400; color: $ds_text;
}
#PatientListWorkspace QLabel[role="muted"], #PatientListWorkspace QLabel[filterLabel="true"] {
color: $ds_muted; font-size: 13px;
}
#PatientListWorkspace QFrame#PatientFilterCard,
#PatientListWorkspace QFrame#PatientListCard {
background: $ds_surface; border: 1px solid $ds_line; border-radius: $ds_radius_panel;
}
#PatientListWorkspace QFrame#PatientSummaryStrip { background: transparent; border: 0; }
#PatientListWorkspace QPushButton, #PatientSearchToolbar QPushButton {
min-height: 38px; max-height: 38px; padding: 0 16px;
border: 1px solid transparent; border-radius: $ds_radius_control; background: $ds_surface_alt;
}
#PatientListWorkspace QPushButton:hover, #PatientSearchToolbar QPushButton:hover {
color: $ds_accent; background: $ds_surface_alt; border-color: $ds_line_strong;
}
#PatientListWorkspace QPushButton:pressed, #PatientSearchToolbar QPushButton:pressed { background: $ds_accent_soft; }
#PatientListWorkspace QPushButton:focus, #PatientSearchToolbar QPushButton:focus { border-color: $ds_focus; }
#PatientSearchToolbar QPushButton#PatientSearchButton {
min-height: 38px; max-height: 38px; color: $ds_surface; background: $ds_accent; border-color: $ds_accent;
}
#PatientSearchToolbar QPushButton#PatientSearchButton:hover { background: $ds_accent_hover; }
#PatientSearchToolbar QPushButton#PatientSearchButton:pressed { background: $ds_accent_pressed; }
#PatientSearchToolbar QPushButton#PatientSearchButton:focus { border-color: $ds_focus; }
#PatientSearchToolbar QLineEdit {
min-height: 38px; max-height: 38px; padding: 0 8px; background: $ds_surface;
border: 1px solid $ds_line; border-radius: $ds_radius_control; selection-background-color: $ds_accent_soft;
}
#PatientSearchToolbar QLineEdit:focus { border-color: $ds_focus; }
#PatientSearchToolbar QLineEdit QToolButton { border: 0; padding: 0; background: transparent; }
#PatientListWorkspace QPushButton[patientStatusChip="true"] {
min-height: 44px; max-height: 44px; padding: 0 16px; font-size: 13px;
color: $ds_text; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent;
}
#PatientListWorkspace QPushButton[patientStatusChip="true"]:checked {
color: $ds_accent; border-bottom-color: $ds_accent; background: transparent;
}
#PatientListWorkspace QPushButton[patientStatusChip="true"]:hover { color: $ds_accent; background: $ds_surface_alt; }
#PatientListWorkspace QPushButton[patientStatusChip="true"]:focus { background: $ds_accent_soft; }
#PatientListWorkspace QPushButton[patientQuickDate="true"] { padding: 0 12px; font-size: 13px; }
#PatientListWorkspace QPushButton[patientQuickDate="true"]:checked,
#PatientListWorkspace QPushButton#PatientCustomDateButton:checked {
color: $ds_accent; background: $ds_accent_soft; border: 1px solid transparent; font-weight: 600;
}
#PatientListWorkspace QPushButton[patientQuickDate="true"]:focus,
#PatientListWorkspace QPushButton#PatientCustomDateButton:focus { border-color: $ds_focus; }
#PatientListWorkspace QDateEdit {
min-height: 38px; max-height: 38px; padding: 0 8px; font-size: 13px;
background: $ds_surface; border: 1px solid $ds_line; border-radius: $ds_radius_control;
selection-background-color: $ds_accent_soft;
}
#PatientListWorkspace QDateEdit:focus { border-color: $ds_focus; }
#PatientListWorkspace QDateEdit:disabled {
color: $ds_disabled; background: $ds_disabled_surface; border-color: $ds_line;
}
#PatientListWorkspace QDateEdit::drop-down { border: 0; width: 20px; background: transparent; }
#PatientListWorkspace QDateEdit::down-arrow { image: none; width: 0; height: 0; }
#PatientListWorkspace QPushButton[summaryCard="true"] {
min-height: 64px; max-height: 64px; padding: 0; background: transparent;
border: 1px solid transparent; border-radius: $ds_radius_control;
}
#PatientListWorkspace QPushButton[summaryCard="true"]:hover { background: $ds_surface_alt; }
#PatientListWorkspace QPushButton[summaryCard="true"]:focus { border-color: $ds_focus; }
#PatientListWorkspace QFrame#PatientSummaryDivider { border: 0; background: $ds_line; }
#PatientListWorkspace QWidget#PatientListHeading { background: transparent; }
#PatientListWorkspace QLabel[role="sectionTitle"] { font-size: 14px; font-weight: 600; color: $ds_text; }
#PatientListWorkspace QTableWidget#PatientTable {
background: $ds_surface; alternate-background-color: $ds_surface; border: 0; border-radius: 0;
selection-background-color: $ds_accent_soft; selection-color: $ds_text; gridline-color: $ds_line;
}
#PatientListWorkspace QTableWidget#PatientTable::item { padding: 0; border: 0; }
#PatientListWorkspace QTableWidget#PatientTable QHeaderView::section {
min-height: 41px; padding: 0 10px; background: $ds_surface_alt; color: $ds_muted;
border: 0; border-top: 1px solid $ds_line; border-bottom: 1px solid $ds_line;
font-family: "$body"; font-size: 13px; font-weight: 400;
}
#PatientListWorkspace QWidget#RowActions, #PatientListWorkspace QWidget#PatientSelectorHost { background: transparent; }
#PatientListWorkspace QPushButton[rowAction="true"],
#PatientListWorkspace QToolButton#RowActionsMore {
min-height: 28px; max-height: 28px; padding: 0 5px; border: 1px solid transparent;
border-radius: $ds_radius_small; background: transparent; color: $ds_accent; font-size: 13px;
}
#PatientListWorkspace QToolButton#RowActionsMore { color: $ds_text; padding-right: 16px; }
#PatientListWorkspace QPushButton[rowAction="true"]:hover,
#PatientListWorkspace QToolButton#RowActionsMore:hover { background: $ds_accent_soft; }
#PatientListWorkspace QPushButton[rowAction="true"]:focus,
#PatientListWorkspace QToolButton#RowActionsMore:focus { border-color: $ds_focus; }
#PatientListWorkspace QMenu { background: $ds_surface; color: $ds_text; border: 1px solid $ds_line; padding: 4px; }
#PatientListWorkspace QMenu::item { padding: 7px 22px; font-size: 13px; }
#PatientListWorkspace QMenu::item:selected { background: $ds_accent_soft; color: $ds_accent; }
#PatientListWorkspace QCheckBox[patientSelector="true"]::indicator {
width: 13px; height: 13px; background: $ds_surface; border: 1px solid $ds_line_strong; border-radius: 3px;
}
#PatientListWorkspace QCheckBox[patientSelector="true"]::indicator:checked { background: $ds_accent; border-color: $ds_accent; }
#PatientListWorkspace QWidget#InfiniteList { background: $ds_surface; border-top: 1px solid $ds_line; }
#PatientListWorkspace QScrollBar:vertical { background: $ds_canvas; width: 7px; margin: 0; }
#PatientListWorkspace QScrollBar:horizontal { background: $ds_canvas; height: 7px; margin: 0; }
#PatientListWorkspace QScrollBar::handle { background: $ds_line_strong; border-radius: 3px; min-width: 24px; min-height: 24px; }
#PatientListWorkspace QScrollBar::add-line, #PatientListWorkspace QScrollBar::sub-line { width: 0; height: 0; }
#PatientListWorkspace QScrollBar::add-page, #PatientListWorkspace QScrollBar::sub-page { background: transparent; }
"""