From 35534ca2110bf0df4b5f9b97adb5650d0337e229 Mon Sep 17 00:00:00 2001 From: Chris Meyer Date: Sat, 8 Jul 2023 09:07:48 -0700 Subject: [PATCH] Remove unnecessary on_layout_changed call. Canvas size stream automatically used. --- nion/swift/MetadataPanel.py | 7 ------- setup.cfg | 1 + 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/nion/swift/MetadataPanel.py b/nion/swift/MetadataPanel.py index 3b39cd5a7..9d07b1eaa 100644 --- a/nion/swift/MetadataPanel.py +++ b/nion/swift/MetadataPanel.py @@ -295,8 +295,6 @@ def __init__(self, document_controller: DocumentController.DocumentController, p def content_size_changed(content_size: Geometry.IntSize) -> None: def _content_height_changed() -> None: - # start = time.perf_counter_ns() - # the code below will do the upstream part of the line below. we can't use the line below # because it will lay out the children again. # metadata_editor_canvas_item.update_layout(Geometry.IntPoint(), content_size) @@ -306,11 +304,6 @@ def _content_height_changed() -> None: # set the content size and send it on up so the scroll area sees it. metadata_editor_canvas_item._set_canvas_size(content_size) - if callable(metadata_editor_canvas_item.on_layout_updated): - metadata_editor_canvas_item.on_layout_updated(metadata_editor_canvas_item.canvas_origin, metadata_editor_canvas_item.canvas_size, False) - - # end = time.perf_counter_ns() - # print(f"height change {(end - start) / 1000}us") self.__thread_helper.call_on_main_thread("_content_height_changed", _content_height_changed) metadata_editor_canvas_item = ThreadedCanvasItem(ui.get_font_metrics, delegate, content_size_changed) diff --git a/setup.cfg b/setup.cfg index 716b98e6a..5fb1b953f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -2,6 +2,7 @@ name = nionswift version = 0.16.8 # niondata >= 0.15.3 (DataMetadata read-only props), nionutils >= 0.4.7 (DatetimeToStringConverter/is_local) +# nionui >= 0.6.12 (layout) author = Nion Software author_email = swift@nion.com description = Nion Swift: Scientific Image Processing.