Skip to content

Commit

Permalink
Hide labeling-related widgets when there are no keypoints (#136)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeylau authored Jun 12, 2024
1 parent 4ef3ed2 commit 6e698c0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/napari_deeplabcut/_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -631,10 +631,12 @@ def __init__(self, napari_viewer):
self._layout.addLayout(grid)

# form buttons for selection of annotation mode
self._radio_group = self._form_mode_radio_buttons()
self._radio_box, self._radio_group = self._form_mode_radio_buttons()
self._radio_box.setEnabled(False)

# form color scheme display + color mode selector
self._color_grp, self._color_mode_selector = self._form_color_mode_selector()
self._color_grp.setEnabled(False)
self._display = ColorSchemeDisplay(parent=self)
self._color_scheme_display = self._form_color_scheme_display(self.viewer)
self._view_scheme_cb.toggled.connect(self._show_color_scheme)
Expand Down Expand Up @@ -917,7 +919,7 @@ def _func():
self.label_mode = group.checkedButton().text()

group.buttonClicked.connect(_func)
return group
return group_box, group

def _form_color_mode_selector(self):
group_box = QGroupBox("Keypoint coloring mode")
Expand Down Expand Up @@ -1096,6 +1098,8 @@ def on_insert(self, event):
"project": layer.metadata.get("project"),
}
)
self._radio_box.setEnabled(True)
self._color_grp.setEnabled(True)
self._trail_cb.setEnabled(True)
self._matplotlib_cb.setEnabled(True)

Expand Down

0 comments on commit 6e698c0

Please sign in to comment.