From f6fa9e34ccb081ee0587dfa5adca4b9c258d8e92 Mon Sep 17 00:00:00 2001 From: Qiusheng Wu Date: Tue, 19 Sep 2023 15:54:00 -0400 Subject: [PATCH 1/2] Fix ipywidgets dark mode on Colab --- geemap/toolbar.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/geemap/toolbar.py b/geemap/toolbar.py index b795c937ad..579fb8ff99 100644 --- a/geemap/toolbar.py +++ b/geemap/toolbar.py @@ -127,6 +127,7 @@ def returned_callback(change): value=False, tooltip="Toolbar", icon="wrench", + button_style="primary", layout=widgets.Layout( width="28px", height="28px", padding="0px 0px 0px 4px" ), @@ -136,6 +137,7 @@ def returned_callback(change): value=False, tooltip="Layers", icon="server", + button_style="primary", layout=widgets.Layout(height="28px", width="72px"), ) @@ -822,6 +824,7 @@ def search_data_gui(m, position="topleft"): value=False, tooltip="Search location/data", icon="globe", + button_style="primary", layout=widgets.Layout(width="28px", height="28px", padding="0px 0px 0px 4px"), ) @@ -832,6 +835,7 @@ def search_data_gui(m, position="topleft"): "Search by lat-lon coordinates", "Search Earth Engine data catalog", ], + button_style="primary", ) search_type.style.button_width = "110px" From cd6f58321e1d20c4474f0eaed5958ab9f23dc194 Mon Sep 17 00:00:00 2001 From: Qiusheng Wu Date: Thu, 21 Sep 2023 12:17:48 -0400 Subject: [PATCH 2/2] Change button color for Colab only --- geemap/toolbar.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/geemap/toolbar.py b/geemap/toolbar.py index 579fb8ff99..43beaae4d0 100644 --- a/geemap/toolbar.py +++ b/geemap/toolbar.py @@ -127,7 +127,6 @@ def returned_callback(change): value=False, tooltip="Toolbar", icon="wrench", - button_style="primary", layout=widgets.Layout( width="28px", height="28px", padding="0px 0px 0px 4px" ), @@ -137,10 +136,13 @@ def returned_callback(change): value=False, tooltip="Layers", icon="server", - button_style="primary", layout=widgets.Layout(height="28px", width="72px"), ) + if in_colab_shell(): + self.toolbar_button.button_style = "primary" + self.layers_button.button_style = "primary" + self.toolbar_header = widgets.HBox() self.toolbar_header.children = [self.layers_button, self.toolbar_button] self.toolbar_footer = widgets.VBox() @@ -824,7 +826,6 @@ def search_data_gui(m, position="topleft"): value=False, tooltip="Search location/data", icon="globe", - button_style="primary", layout=widgets.Layout(width="28px", height="28px", padding="0px 0px 0px 4px"), ) @@ -835,10 +836,13 @@ def search_data_gui(m, position="topleft"): "Search by lat-lon coordinates", "Search Earth Engine data catalog", ], - button_style="primary", ) search_type.style.button_width = "110px" + if in_colab_shell(): + search_button.button_style = "primary" + search_type.button_style = "primary" + search_box = widgets.Text( placeholder="Search by place name or address", tooltip="Search location",