Skip to content

Commit fc06e53

Browse files
committed
select_with_shape_tool: new toolbar and options args
1 parent 4a649f9 commit fc06e53

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
🛠️ Bug fixes:
66

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

910
📚 Documentation:
1011

plotpy/widgets/selectdialog.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ def select_with_shape_tool(
142142
size: tuple[int, int] = None,
143143
other_items: list[QwtPlotItem] = [],
144144
tooldialogclass: SelectDialog = SelectDialog,
145+
toolbar: bool = False,
146+
options: PlotOptions | None = None,
145147
icon=None,
146148
**kwargs,
147149
) -> AbstractShape:
@@ -155,6 +157,8 @@ def select_with_shape_tool(
155157
size: Dialog size
156158
other_items: Other items to be displayed
157159
tooldialogclass: Tool dialog class
160+
toolbar: show/hide toolbar
161+
options: plot options
158162
icon: Icon
159163
kwargs: Keyword arguments for the tool class
160164
@@ -165,7 +169,9 @@ def select_with_shape_tool(
165169
title = "Select an area then press OK to accept"
166170
if icon is not None:
167171
icon = get_icon(icon) if isinstance(icon, str) else icon
168-
win: SelectDialog = tooldialogclass(parent, title=title, edit=True, icon=icon)
172+
win: SelectDialog = tooldialogclass(
173+
parent, title=title, edit=True, toolbar=toolbar, options=options, icon=icon
174+
)
169175
win.set_image_and_tool(item, toolclass, **kwargs)
170176
plot = win.get_plot()
171177
for other_item in other_items:

0 commit comments

Comments
 (0)