From cbc0bb619925b6b1fddaf2d1372df38851cb37fc Mon Sep 17 00:00:00 2001 From: Adam Tyson Date: Wed, 10 Jan 2024 10:29:45 +0000 Subject: [PATCH] Adds vertical scroll bar to the training widget (#357) * Add brainglobe-napari-io to dependencies * Add vertical scroll bar to training widget --- cellfinder/napari/train/train.py | 6 ++++++ pyproject.toml | 1 + 2 files changed, 7 insertions(+) diff --git a/cellfinder/napari/train/train.py b/cellfinder/napari/train/train.py index 54d985a4..4d5e005b 100644 --- a/cellfinder/napari/train/train.py +++ b/cellfinder/napari/train/train.py @@ -5,6 +5,7 @@ from magicgui.widgets import FunctionGui, PushButton from napari.qt.threading import thread_worker from napari.utils.notifications import show_info +from qtpy.QtWidgets import QScrollArea from cellfinder.core.train.train_yml import run as train_yml from cellfinder.napari.utils import ( @@ -48,6 +49,7 @@ def training_widget() -> FunctionGui: **MiscTrainingInputs.widget_representation(), call_button=True, reset_button=dict(widget_type="PushButton", text="Reset defaults"), + scrollable=True, ) def widget( header: dict, @@ -175,4 +177,8 @@ def restore_defaults(): if value is not None: getattr(widget, name).value = value + scroll = QScrollArea() + scroll.setWidget(widget._widget._qwidget) + widget._widget._qwidget = scroll + return widget diff --git a/pyproject.toml b/pyproject.toml index 816c8b3b..c9c7fa29 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,6 +21,7 @@ classifiers = [ requires-python = ">=3.9" dependencies = [ "brainglobe-utils", + "brainglobe-napari-io", "dask[array]", "fancylog>=0.0.7", "natsort",