Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jun 23, 2024
1 parent 568bf89 commit 4bd6c7c
Showing 1 changed file with 14 additions and 19 deletions.
33 changes: 14 additions & 19 deletions leafmap/maplibregl.py
Original file line number Diff line number Diff line change
Expand Up @@ -2004,40 +2004,31 @@ class Container(v.Container):

def __init__(self, host_map=None, *args, **kwargs):


# Create the left column with the map
left_col_layout = v.Col(
cols=11,
children=[],
class_='pa-1' # padding for consistent spacing
cols=11, children=[], class_="pa-1" # padding for consistent spacing
)
if host_map is not None:
left_col_layout.children = [host_map]

# Create the right column with some output
right_col_layout = v.Col(
cols=1,
children=[
v.Card(children=[v.CardText(children=['Output Content'])])
],
class_='pa-1' # padding for consistent spacing
children=[v.Card(children=[v.CardText(children=["Output Content"])])],
class_="pa-1", # padding for consistent spacing
)

# Create a toggle button with an icon
btn = v.Btn(
children=[
v.Icon(left=False, children=['mdi-layers']),
v.Icon(left=False, children=["mdi-layers"]),
],
# class_='ma-1',
v_model=False
v_model=False,
)

# Create the button toggle
toggle = v.BtnToggle(
v_model='toggle_exclusive',
children=[btn]
)

toggle = v.BtnToggle(v_model="toggle_exclusive", children=[btn])

# Function to change column widths
def change_column_widths(*args, **kwargs):
Expand All @@ -2048,11 +2039,15 @@ def change_column_widths(*args, **kwargs):
left_col_layout.cols = 11
right_col_layout.cols = 1


# Observe changes in the v_model of the toggle button
toggle.on_event('change', change_column_widths)
toggle.on_event("change", change_column_widths)

# Update the right column to include the toggle button
right_col_layout.children = [toggle]
row = v.Row(class_='d-flex flex-wrap', children=[left_col_layout, right_col_layout], *args, **kwargs)
super().__init__(fluid=True, children=[row])
row = v.Row(
class_="d-flex flex-wrap",
children=[left_col_layout, right_col_layout],
*args,
**kwargs,
)
super().__init__(fluid=True, children=[row])

0 comments on commit 4bd6c7c

Please sign in to comment.