From 46e1cf680c14d8275abfe7f5d47b2b327ce298b6 Mon Sep 17 00:00:00 2001 From: aedhcarrick Date: Tue, 20 Dec 2022 14:09:28 -0600 Subject: [PATCH] minor tweak to property panel(flet ui) --- webui/flet/scripts/flet_property_manager.py | 59 ++++++--------------- 1 file changed, 17 insertions(+), 42 deletions(-) diff --git a/webui/flet/scripts/flet_property_manager.py b/webui/flet/scripts/flet_property_manager.py index 38a6595..01ad8f1 100644 --- a/webui/flet/scripts/flet_property_manager.py +++ b/webui/flet/scripts/flet_property_manager.py @@ -22,10 +22,10 @@ class PropertyManager(ft.Container): self.property_panel.preview.width = self.page.right_panel_width self.property_panel.preview_dragbar.content.content.height = self.page.divider_height self.property_panel.preview_dragbar.content.content.color = self.page.tertiary_color - self.property_panel.canvas_properties_dragbar.content.content.height = self.page.divider_height - self.property_panel.canvas_properties_dragbar.content.content.color = self.page.tertiary_color - self.property_panel.layer_properties_dragbar.content.content.height = self.page.divider_height - self.property_panel.layer_properties_dragbar.content.content.color = self.page.tertiary_color + self.property_panel.canvas_properties_divider.content.height = self.page.divider_height + self.property_panel.canvas_properties_divider.content.color = self.page.tertiary_color + self.property_panel.layer_properties_divider.content.height = self.page.divider_height + self.property_panel.layer_properties_divider.content.color = self.page.tertiary_color def set_tab_text_size(self, size): for tab in self.tabs: @@ -55,14 +55,6 @@ class PropertyPanel(ft.Container): self.preview.height = max(200, self.preview.height + e.delta_y) self.update() - def resize_canvas_properties(self, e): - self.canvas_properties.height = max(50, self.canvas_properties.height + e.delta_y) - self.update() - - def resize_layer_properties(self, e): - self.layer_properties.height = max(50, self.layer_properties.height + e.delta_y) - self.update() - preview_pane = ft.Container( content = ft.Image( src_base64 = None, @@ -135,23 +127,14 @@ canvas_property_header = ft.Column( on_click = open_close_canvas_properties, ), ], - height = 50, ) canvas_property_header.open = False -def resize_canvas_properties(e): - property_panel.resize_canvas_properties(e) - -canvas_property_dragbar = ft.GestureDetector( - mouse_cursor = ft.MouseCursor.RESIZE_ROW, - drag_interval = 50, - on_pan_update = resize_canvas_properties, - content = ft.Container( - content = ft.Divider(), - margin = 0, - padding = 0, - ), +canvas_property_divider = ft.Container( + content = ft.Divider(), + margin = 0, + padding = 0, ) def get_layer_properties(e): @@ -201,34 +184,26 @@ layer_property_header = ft.Column( disabled = True, ), ], - height = 50, ) layer_property_header.open = False -def resize_layer_properties(e): - property_panel.resize_layer_properties(e) - -layer_property_dragbar = ft.GestureDetector( - mouse_cursor = ft.MouseCursor.RESIZE_ROW, - drag_interval = 50, - on_pan_update = resize_layer_properties, - content = ft.Container( - content = ft.Divider(), - margin = 0, - padding = 0, - ), +layer_property_divider = ft.Container( + content = ft.Divider(), + margin = 0, + padding = 0, ) + property_panel = PropertyPanel( content = ft.Column( controls = [ preview_pane, preview_dragbar, canvas_property_header, - canvas_property_dragbar, + canvas_property_divider, layer_property_header, - layer_property_dragbar, + layer_property_divider, ], ), ) @@ -236,9 +211,9 @@ property_panel = PropertyPanel( property_panel.preview = preview_pane property_panel.preview_dragbar = preview_dragbar property_panel.canvas_properties = canvas_property_header -property_panel.canvas_properties_dragbar = canvas_property_dragbar +property_panel.canvas_properties_divider = canvas_property_divider property_panel.layer_properties = layer_property_header -property_panel.layer_properties_dragbar = layer_property_dragbar +property_panel.layer_properties_divider = layer_property_divider output_panel = PropertyPanel( content = ft.Column(