Skip to content

Commit

Permalink
Hide update button unless manual update is selected
Browse files Browse the repository at this point in the history
  • Loading branch information
ceriottm committed Jun 26, 2024
1 parent 0353f2d commit 186a495
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/scwidgets/exercise/_widget_code_exercise.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,14 +403,13 @@ def __init__(
demo_children.append(self._cue_parameter_panel)

buttons = []
if self._check_button is None and self._update_button is None:
self._code_buttons = HBox([])
elif self._check_button is None:
self._code_buttons = HBox([self._update_button])
elif self._update_button is None:
self._code_buttons = HBox([self._check_button])
else:
self._code_buttons = HBox([self._check_button, self._update_button])
no_show_update = self._update_mode != "manual" or self._update_button is None
button_box = []
if self._check_button is not None:
button_box.append(self._check_button)
if self._update_mode == "manual" and self._update_button is not None:
button_box.append(self._update_button)
self._code_buttons = HBox(button_box)
buttons.append(self._code_buttons)

if self._save_button is not None and self._load_button is not None:
Expand Down

0 comments on commit 186a495

Please sign in to comment.