From 8c1388db63afc5489110f9c7ab4269ba8ea029b2 Mon Sep 17 00:00:00 2001 From: Gabe Joseph Date: Tue, 10 Dec 2019 14:33:06 -0700 Subject: [PATCH] Workflows: more map layout fixes [EC-791, EC-792] (#5930) GitOrigin-RevId: 4ee27bb2c326c0b6026252ac08b64f379243fb72 --- descarteslabs/workflows/interactive/layer.py | 3 ++- descarteslabs/workflows/interactive/layer_controller.py | 3 ++- descarteslabs/workflows/interactive/lonlat.py | 4 +++- descarteslabs/workflows/interactive/map_.py | 7 +++++-- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/descarteslabs/workflows/interactive/layer.py b/descarteslabs/workflows/interactive/layer.py index c6aa6696..0697df74 100644 --- a/descarteslabs/workflows/interactive/layer.py +++ b/descarteslabs/workflows/interactive/layer.py @@ -95,7 +95,8 @@ def __init__(self, image, *args, **kwargs): self.set_trait( "autoscale_progress", ClearableOutput( - widgets.Output(), layout=widgets.Layout(max_height="20rem") + widgets.Output(), + layout=widgets.Layout(max_height="10rem", flex="1 0 auto"), ), ) self.set_parameters(**params) diff --git a/descarteslabs/workflows/interactive/layer_controller.py b/descarteslabs/workflows/interactive/layer_controller.py index 6498e09c..653b3c03 100644 --- a/descarteslabs/workflows/interactive/layer_controller.py +++ b/descarteslabs/workflows/interactive/layer_controller.py @@ -25,7 +25,8 @@ def __init__(self, map): # initialize with the current layers on the map, if any self.layout.overflow = "auto" - self.layout.max_height = "30rem" + self.layout.max_height = "12rem" + self.layout.flex = "1 0 auto" def _layers_changed(self, change): new_layers = change["new"] diff --git a/descarteslabs/workflows/interactive/lonlat.py b/descarteslabs/workflows/interactive/lonlat.py index 1c18aff3..9ec9bde1 100644 --- a/descarteslabs/workflows/interactive/lonlat.py +++ b/descarteslabs/workflows/interactive/lonlat.py @@ -64,4 +64,6 @@ def __init__(self, map): super(PositionController, self).__init__(children=(lonlat, zoom_label, zoom)) - self.layout.overflow = "initial" + self.layout.overflow = "hidden" + self.layout.flex = "1 0 auto" + self.layout.padding = "2px 0" diff --git a/descarteslabs/workflows/interactive/map_.py b/descarteslabs/workflows/interactive/map_.py index ba44af5a..382076be 100644 --- a/descarteslabs/workflows/interactive/map_.py +++ b/descarteslabs/workflows/interactive/map_.py @@ -97,7 +97,9 @@ def on_clear(): pass self.errors = ClearableOutput( - map.error_log, on_clear=on_clear, layout=widgets.Layout(max_height="20rem") + map.error_log, + on_clear=on_clear, + layout=widgets.Layout(max_height="20rem", flex="1 0 auto"), ) self.autoscale_outputs = widgets.VBox( @@ -105,7 +107,8 @@ def on_clear(): x.autoscale_progress for x in reversed(self.map.layers) if isinstance(x, WorkflowsLayer) - ] + ], + layout=widgets.Layout(flex="1 0 auto", max_height="16rem"), ) super(MapApp, self).__init__(