Skip to content

Commit

Permalink
select_with_shape_tool: new toolbar and options args
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreRaybaut committed Nov 22, 2023
1 parent 4a649f9 commit fc06e53
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
🛠️ Bug fixes:

* Fixed `plotpy.tools.AnnotatedEllipseTool`: `AttributeError` when finalizing the shape
* `plotpy.widgets.select_with_shape_tool`: added missing `toolbar` and `options` parameters

📚 Documentation:

Expand Down
8 changes: 7 additions & 1 deletion plotpy/widgets/selectdialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ def select_with_shape_tool(
size: tuple[int, int] = None,
other_items: list[QwtPlotItem] = [],
tooldialogclass: SelectDialog = SelectDialog,
toolbar: bool = False,
options: PlotOptions | None = None,
icon=None,
**kwargs,
) -> AbstractShape:
Expand All @@ -155,6 +157,8 @@ def select_with_shape_tool(
size: Dialog size
other_items: Other items to be displayed
tooldialogclass: Tool dialog class
toolbar: show/hide toolbar
options: plot options
icon: Icon
kwargs: Keyword arguments for the tool class
Expand All @@ -165,7 +169,9 @@ def select_with_shape_tool(
title = "Select an area then press OK to accept"
if icon is not None:
icon = get_icon(icon) if isinstance(icon, str) else icon
win: SelectDialog = tooldialogclass(parent, title=title, edit=True, icon=icon)
win: SelectDialog = tooldialogclass(
parent, title=title, edit=True, toolbar=toolbar, options=options, icon=icon
)
win.set_image_and_tool(item, toolclass, **kwargs)
plot = win.get_plot()
for other_item in other_items:
Expand Down

0 comments on commit fc06e53

Please sign in to comment.