Skip to content

Commit bdf3649

Browse files
committed
Change descriptions to VTooltip
1 parent b3d4f01 commit bdf3649

File tree

1 file changed

+24
-21
lines changed

1 file changed

+24
-21
lines changed

src/fourc_webviewer/gui_utils.py

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -449,16 +449,18 @@ def _prop_value_table():
449449
key="item_key",
450450
):
451451
with html.Td(classes="text-center"):
452-
html.P(v_text=("item_key",))
453-
html.P(
454-
v_if=(
455-
"json_schema['properties']?.[selected_section_name]?.['properties']?.[item_key]?.['description']",
456-
),
457-
v_text=(
458-
"json_schema['properties']?.[selected_section_name]?.['properties']?.[item_key]?.['description'] || 'no description'",
459-
),
460-
style="font-size: 0.8em; color: #aaa; padding-left: 20px; padding-right: 20px;",
461-
)
452+
with vuetify.VTooltip(location="bottom"):
453+
with html.Template(v_slot_activator="{ props }"):
454+
html.P(v_text=("item_key",), v_bind="props")
455+
html.P(
456+
v_text=(
457+
"json_schema['properties']?.[selected_section_name]?.['properties']?.[item_key]?.['description'] || 'no description'",
458+
),
459+
v_if=(
460+
"json_schema['properties']?.[selected_section_name]?.['properties']?.[item_key]?.['description']",
461+
),
462+
style="max-width: 450px;",
463+
)
462464
html.Td(
463465
v_if="edit_mode == all_edit_modes['view_mode']",
464466
v_text=("item_val",),
@@ -585,17 +587,18 @@ def _materials_panel():
585587
):
586588
# html.Td("awdawdawd")#v_text=("param_key",))
587589
with html.Td(classes="text-center"):
588-
html.P(v_text=("param_key",))
589-
html.P(
590-
v_text=(
591-
"json_schema?.properties?.MATERIALS?.items?.oneOf?"
592-
".find(v => v.properties?.[materials_section[selected_material]?.TYPE])?"
593-
".properties?.[materials_section[selected_material]?.TYPE]?.properties?"
594-
".[param_key]?.description || 'Error on parameter description'",
595-
),
596-
# v_text=("json_schema?.properties?.MATERIALS?.items?.oneOf?.find(v => v.properties?.['MAT_electrode'])?.properties?.['MAT_electrode']?.description || 'no description'",),
597-
style="font-size: 0.8em; color: #aaa; padding-left: 20px; padding-right: 20px;",
598-
)
590+
with vuetify.VTooltip(location="bottom"):
591+
with html.Template(v_slot_activator="{ props }"):
592+
html.P(v_text=("param_key",), v_bind="props")
593+
html.P(
594+
v_text=(
595+
"json_schema?.properties?.MATERIALS?.items?.oneOf?"
596+
".find(v => v.properties?.[materials_section[selected_material]?.TYPE])?"
597+
".properties?.[materials_section[selected_material]?.TYPE]?.properties?"
598+
".[param_key]?.description || 'Error on parameter description'",
599+
),
600+
style="max-width: 450px;",
601+
)
599602
html.Td(
600603
v_text=("param_val",),
601604
)

0 commit comments

Comments
 (0)