Fix T95323: Icon-Viewer Type Error in invoke_props_dialog()

Latest builds of Blender require WindowManager.invoke_props_dialog() to
use int explicitly in width= argument. Otherwise a TypeError will be
thrown.

Ref D14031
This commit is contained in:
Paul Golter 2022-02-22 11:51:20 +11:00 committed by Campbell Barton
parent 7476c1ac24
commit bb62f10715
Notes: blender-bot 2023-02-14 18:25:56 +01:00
Referenced by issue #95939,  Extra Objects: Type Error when adding curve
Referenced by issue #95323, Python Traceback on calling Icon Viewer
1 changed files with 2 additions and 2 deletions

View File

@ -469,9 +469,9 @@ class IV_OT_icons_show(bpy.types.Operator):
self.auto_focusable = True
num_cols = self.get_num_cols(len(pr.popup_icons.filtered_icons))
self.width = min(
self.width = int(min(
ui_scale() * (num_cols * ICON_SIZE + POPUP_PADDING),
context.window.width - WIN_PADDING)
context.window.width - WIN_PADDING))
return context.window_manager.invoke_props_dialog(
self, width=self.width)