Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: notebook checkbox layout #10455

Merged
merged 1 commit into from
Mar 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions mne/gui/_coreg.py
Original file line number Diff line number Diff line change
Expand Up @@ -1731,13 +1731,13 @@ def _configure_dock(self):
filter='Head->MRI transformation (*-trans.fif *_trans.fif)',
initial_directory=str(Path(self._info_file).parent),
)
self._renderer._layout_add_widget(trans_layout, save_trans_layout)
self._widgets["reset_trans"] = self._renderer._dock_add_button(
name="Reset",
name="Reset Parameters",
callback=self._reset,
tooltip="Reset all the parameters affecting the coregistration",
layout=save_trans_layout,
layout=trans_layout,
)
self._renderer._layout_add_widget(trans_layout, save_trans_layout)

fitting_options_layout = self._renderer._dock_add_group_box(
name="Fitting Options",
Expand Down
6 changes: 4 additions & 2 deletions mne/viz/backends/_notebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def _dock_initialize(self, window=None, name="Controls",
if self._docks is None:
self._docks = dict()
current_dock = VBox()
self._dock_width = 300
self._dock_width = 302
self._dock = self._dock_layout = current_dock
self._dock.layout.width = f"{self._dock_width}px"
self._layout_initialize(self._dock_width)
Expand Down Expand Up @@ -268,10 +268,12 @@ def _dock_add_check_box(self, name, value, callback, *, tooltip=None,
widget = Checkbox(
value=value,
description=name,
indent=False,
disabled=False
)
hbox = HBox([widget]) # fix stretching to the right
widget.observe(_generate_callback(callback), names='value')
self._layout_add_widget(layout, widget)
self._layout_add_widget(layout, hbox)
return _IpyWidget(widget)

def _dock_add_spin_box(self, name, value, rng, callback, *,
Expand Down