New Features
---------------
- Lots of new `Container`s are now available. Use `magicclass(widget_type="scrollable")` for scrollable Containers, `magicclass(widget_type="button")` for Containers that are hidden in push buttons, `magicclass(widget_type="tabbed")` for Containers with many tabs, and so on.
- When checkable widgets are defined in `magicmenu`, then it will be converted to a checkable action.
- Instead of line number recording before v0.4.1, I switched widget ordering to a new way that depends on `__dict__`. Therefore, you don't have to add some widgets like `w = field(LineEdit)`, but `w = LineEdit()` also works.
- With `wraps` function you can copy signature from a template function to other methods. For example, if you defined a lot of methods that take argument `path`, you don't have to add annotation `Path` for every function. Define a template function
python
def template(path: Path): pass
and decorate methods.
python
wraps(template)
def method1(self, path): ...
`wraps` method of `magicclass` also support the same wrapping strategy but currently need keyword "template=".
Changes
----------
- Docstring of class was converted into `Label` widget before. But this was usually useless. Now it will be converted into tooltip. If you want a `Label` widget, create a widget inside `magicclass` like
python
magicclass
class Main:
label = Label(...)
def func(self): ...
- When a `magicclass` is docked into `napari`, all the `magicgui`s and macro windows were opened via `add_dock_widget` and `setFloating`. However, it is no general and is not a good way in general. Now parent is set for every `magicgui` and macro window.
Bug fixes
----------
- When `magicclass` is nested for three times it resulted in wrong macro.
- When method arguments conflict with any attributes of `FunctionGui`, `magicclass` raised error when recording parameter histories.
- When more than one `magicgui`s were added in a same `magicclass`, only one of them was shown up.