fix: adaptive empty state, escaped button ampersand, no tenant preselection for APs

- Empty states hide icon and text when space is short instead of being
  squeezed; title and button always stay readable
- "Standorte & Mandanten" button no longer shows a mnemonic underscore
- The tenant on the access point page is always chosen deliberately

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
MrBlakeandClaude Opus 5.5 committed 2026-11-02 13:18:21 +01:00
1 parent ba50527ee5
commit b402591cdf
2 files changed
+19 -12

No files matched your search

+3 -2
View File
@@ -144,7 +144,7 @@ class AccessPointsPage(Page):
self.body.addWidget(source)
result = Card("Abgleich")
self.sites_button = result.add_action(button("Standorte & Mandanten …", "globe", on_click=self.map_sites))
self.sites_button = result.add_action(button("Standorte && Mandanten …", "globe", on_click=self.map_sites))
self.refresh_button = result.add_action(button("Neu abgleichen", "refresh", on_click=self.compare))
filters = QHBoxLayout()
self.search = SearchField("Name, S/N, MAC, IP, Standort …")
@@ -269,7 +269,8 @@ class AccessPointsPage(Page):
def done(result):
self.tenants, roles = result
settings = self._settings()
self.tenant.set_items(self.tenants, settings.get("tenant_id"))
# The tenant is always chosen deliberately – never preselected.
self.tenant.set_items(self.tenants)
role_id = settings.get("role_id") or next(
(role_id for name, role_id in roles if name.casefold() in ROLE_HINTS
or "access point" in name.casefold()), None)
+16 -10
View File
@@ -257,20 +257,26 @@ class EmptyState(QWidget):
layout.addStretch(2)
layout.setContentsMargins(24, 16, 24, 16)
def minimumSizeHint(self):
# Word-wrapped labels report almost no minimum height, so a small card
# would squeeze icon, title and text on top of each other.
width = max(self.width(), 320) - 48
height = 32 + 56 + self.title_label.heightForWidth(width) + self.text_label.heightForWidth(min(width, 520))
height += 2 * 10
def _heights(self, width):
width = max(width, 320) - 48
core = 32 + self.title_label.heightForWidth(width) + 10
if self.action is not None:
height += 16 + self.action.sizeHint().height()
return QSize(260, height)
core += 16 + self.action.sizeHint().height()
return core, self.text_label.heightForWidth(min(width, 520)) + 10, 56 + 10
def minimumSizeHint(self):
# Title and button always fit; icon and text are dropped when space is short.
core, _text, _icon = self._heights(self.width())
return QSize(260, core)
def resizeEvent(self, event):
super().resizeEvent(event)
if event.size().width() != event.oldSize().width():
self.updateGeometry()
# Word-wrapped labels report almost no minimum height, so a small card
# would squeeze icon, title, text and button on top of each other.
core, text, icon_height = self._heights(event.size().width())
available = event.size().height()
self.text_label.setVisible(available >= core + text)
self.icon_label.setVisible(available >= core + text + icon_height)
def set_text(self, title=None, text=None):
if title is not None: