diff options
| author | Danilo M. <danix@danix.xyz> | 2026-10-20 12:23:50 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-10-20 12:23:50 +0200 |
| commit | ecf11290bda5a670ff520f62a96d85645ad95d82 (patch) | |
| tree | 1e6390a28297e3fb5a9ba8c2fd5c8ee58de37a41 /sb_builder/packages.py | |
| parent | aa4d36c541e603ed4d60ee1185806c51818eccc9 (diff) | |
| download | sb-builder-ecf11290bda5a670ff520f62a96d85645ad95d82.tar.gz sb-builder-ecf11290bda5a670ff520f62a96d85645ad95d82.zip | |
Filter bars: chips read as buttons, status dots, group labels
Chips get a button background and border, a dot in the color the table
uses for that status, and a muted label per group (overlay, status,
state, result). Search fields get a search icon and a clear button.
Phase 2 spec: why the signing key locks after the GUI quits.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'sb_builder/packages.py')
| -rw-r--r-- | sb_builder/packages.py | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/sb_builder/packages.py b/sb_builder/packages.py index 30215e0..a4d1f1b 100644 --- a/sb_builder/packages.py +++ b/sb_builder/packages.py @@ -20,13 +20,13 @@ import html from PyQt6.QtCore import QAbstractTableModel, QModelIndex, QSortFilterProxyModel, Qt, pyqtSignal from PyQt6.QtGui import QColor, QKeySequence, QShortcut -from PyQt6.QtWidgets import (QHBoxLayout, QLabel, QLineEdit, QMessageBox, QPushButton, QScrollArea, - QSplitter, QTableView, QVBoxLayout, QWidget) +from PyQt6.QtWidgets import (QHBoxLayout, QLabel, QMessageBox, QScrollArea, QSplitter, QTableView, + QVBoxLayout, QWidget) from . import hints as hintlib from .dashboard import STATUS from .fmt import NA, fmt_time -from .ui import SP, action, enable +from .ui import SP, action, chip, enable, group_label, search_field OVERLAYS = ("personal", "pentesting") STATUSES = ("ok", "failed", "never", "outdated") @@ -159,15 +159,6 @@ class Filter(QSortFilterProxyModel): return matches(row, self.terms, self.overlays, self.statuses) -def chip(text): - b = QPushButton(text, checkable=True) - b.setStyleSheet("QPushButton { border: 1px solid palette(mid); border-radius: 10px;" - " padding: 2px 10px; }" - "QPushButton:checked { background: palette(highlight);" - " color: palette(highlighted-text); }") - return b - - def detail_html(row): """The detail pane for one package: facts, dependencies, then its hints.""" view = hintlib.interpret(row["hints"], row["name"], row["info_version"], row["requires"]) @@ -219,13 +210,14 @@ class PackagesTab(QWidget): self.proxy = Filter() self.proxy.setSourceModel(self.model) - self.query = QLineEdit(placeholderText="search (cat: maint: req: status:)") + self.query = search_field("search (cat: maint: req: status:)") self.query.textChanged.connect(self.refilter) self.chips = {} chips = QHBoxLayout() - for group in (("personal", "pentesting", "upstream"), STATUSES): + for label, group in (("overlay", ("personal", "pentesting", "upstream")), ("status", STATUSES)): + chips.addWidget(group_label(label)) for name in group: - self.chips[name] = chip(name) + self.chips[name] = chip(name, STATUS_COLOR.get(name) if group is STATUSES else None) self.chips[name].toggled.connect(self.refilter) chips.addWidget(self.chips[name]) chips.addSpacing(16) |
