From fa04a74385d7f2507625b852332be807a44947a9 Mon Sep 17 00:00:00 2001 From: federico gasparoli <70725613+fdrgsp@users.noreply.github.com> Date: Fri, 8 Nov 2024 15:48:59 -0500 Subject: [PATCH] feat: indicate pre-init properties in device property browser (#382) * wip add color * use QPalette * Update src/pymmcore_widgets/device_properties/_device_property_table.py Co-authored-by: Talley Lambert * fix: use p icon --------- Co-authored-by: Talley Lambert --- .../device_properties/_device_property_table.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/pymmcore_widgets/device_properties/_device_property_table.py b/src/pymmcore_widgets/device_properties/_device_property_table.py index e9b490897..84646a363 100644 --- a/src/pymmcore_widgets/device_properties/_device_property_table.py +++ b/src/pymmcore_widgets/device_properties/_device_property_table.py @@ -123,11 +123,12 @@ def _rebuild_table(self) -> None: self.clearContents() props = list(self._mmc.iterProperties(as_object=True)) self.setRowCount(len(props)) + for i, prop in enumerate(props): - item = QTableWidgetItem(f"{prop.device}-{prop.name}") + extra = " 🅿" if prop.isPreInit() else "" + item = QTableWidgetItem(f"{prop.device}-{prop.name}{extra}") item.setData(self.PROP_ROLE, prop) - icon_string = ICONS.get(prop.deviceType()) - if icon_string: + if icon_string := ICONS.get(prop.deviceType()): item.setIcon(icon(icon_string, color="Gray")) self.setItem(i, 0, item)