Skip to content

Commit

Permalink
feat: indicate pre-init properties in device property browser (#382)
Browse files Browse the repository at this point in the history
* wip add color

* use QPalette

* Update src/pymmcore_widgets/device_properties/_device_property_table.py

Co-authored-by: Talley Lambert <[email protected]>

* fix: use p icon

---------

Co-authored-by: Talley Lambert <[email protected]>
  • Loading branch information
fdrgsp and tlambert03 authored Nov 8, 2024
1 parent 7277aa6 commit fa04a74
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit fa04a74

Please sign in to comment.