Skip to content

Commit

Permalink
Fix ipywidgets dark mode for toolbar buttons on Colab (#1716)
Browse files Browse the repository at this point in the history
* Fix ipywidgets dark mode on Colab

* Change button color for Colab only
  • Loading branch information
giswqs authored Sep 21, 2023
1 parent 556c9d6 commit c509c97
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions geemap/toolbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ def returned_callback(change):
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()
Expand Down Expand Up @@ -835,6 +839,10 @@ def search_data_gui(m, position="topleft"):
)
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",
Expand Down

0 comments on commit c509c97

Please sign in to comment.