Skip to content

Commit

Permalink
Improve control layout
Browse files Browse the repository at this point in the history
  • Loading branch information
edan-bainglass committed Dec 20, 2024
1 parent 168da67 commit 01cae31
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions home/code_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
CONFIG = {
"column_widths": {
"Full Label": "25%",
"Executable Path": "70%",
"Hide": "5%",
"Executable Path": "65%",
"Hide": "10%",
},
"cell_style": {"padding": "2px 5px"},
"rows_per_page": 10,
Expand Down Expand Up @@ -199,9 +199,22 @@ def render_table_with_filters():

table_output = ipw.Output()

search_box = ipw.Text(
description="Search:",
placeholder="Filter by label or path...",
layout=ipw.Layout(width="50%"),
style={"description_width": "initial"},
)
search_box.observe(
on_search_change,
"value",
)

show_hidden_only_button = ipw.Checkbox(
value=False,
indent=False,
description="Show hidden codes only",
layout=ipw.Layout(width="fit-content", margin="2px 10px 2px auto"),
)
show_hidden_only_button.observe(
on_show_hidden_click,
Expand All @@ -212,26 +225,17 @@ def render_table_with_filters():
description="Show All",
tooltip="Unhide all hidden codes",
button_style="primary",
layout=ipw.Layout(margin="0 0 0 auto"),
layout=ipw.Layout(margin="0", width="105px"),
)
show_all_button.on_click(on_show_all_click)

search_box = ipw.Text(
description="Search:",
placeholder="Filter by label or path...",
layout=ipw.Layout(width="50%"),
)
search_box.observe(
on_search_change,
"value",
)

filters = ipw.HBox(
children=[
search_box,
show_hidden_only_button,
show_all_button,
],
layout=ipw.Layout(padding="0 8px", align_items="center"),
)

pagination = ipw.HBox(layout=ipw.Layout(justify_content="center"))
Expand Down

0 comments on commit 01cae31

Please sign in to comment.