Update Screen: Bao Mat, Hanh Dong, MCP, Agent, Agent Admin
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -18,6 +18,25 @@ from ..theme import current_palette
|
||||
from .icons import DOT_BLUE, DOT_GREEN, DOT_GREY, DOT_RED, dot_icon, icon
|
||||
|
||||
|
||||
def badge_pill_widget(text: str, object_name: str) -> QWidget:
|
||||
"""A small rounded pill for a table cell — a coloured role/status tag
|
||||
(``object_name`` is one of theme.py's ``badge*`` QLabel names). Wrapped in
|
||||
a transparent container rather than passed as a bare label: a
|
||||
``setCellWidget()`` widget is stretched to fill the whole cell, and
|
||||
without the container's own ``background: transparent`` the app-wide
|
||||
``QWidget { background: $bg }`` rule (theme.py) paints that stretched
|
||||
area opaque, hiding the pill inside a solid block instead of a snug tag."""
|
||||
container = QWidget()
|
||||
container.setStyleSheet("background: transparent;")
|
||||
lay = QHBoxLayout(container)
|
||||
lay.setContentsMargins(4, 2, 4, 2)
|
||||
lbl = QLabel(text)
|
||||
lbl.setObjectName(object_name)
|
||||
lay.addWidget(lbl, 0, Qt.AlignVCenter)
|
||||
lay.addStretch(1)
|
||||
return container
|
||||
|
||||
|
||||
def _style_card(frame: QFrame) -> None:
|
||||
"""Give a stat/budget card its surface. Flat by design: the raised surface
|
||||
plus a hairline is what separates it from the page — the old drop shadow
|
||||
|
||||
Reference in New Issue
Block a user