svghmi/widget_list.ysl2
author Edouard Tisserant
Mon, 15 Mar 2021 11:25:24 +0100
branchsvghmi
changeset 3188 c173452bf894
parent 3175 b2ba6eeb61ec
child 3185 9038655c1b18
permissions -rw-r--r--
SVGHMI: Fixed problems happening when value is higher than maximum or lower than minimum in Input widget. "max" and "min" string was getting into keypad text field, was not diplayed systematically, and was staying forever sometime.
// widget_list.ysl2

template "widget[@type='List']", mode="widget_defs" {
    param "hmi_element";
    |     items: {
    foreach "$hmi_element/*[@inkscape:label]" {
    |         «@inkscape:label»: "«@id»",
    }
    |     },
}

template "widget[@type='TextStyleList']", mode="widget_defs" {
    param "hmi_element";
    |     styles: {
    foreach "$hmi_element/*[@inkscape:label]" {
        const "text", "func:refered_elements(.)[self::svg:text][1]";
        const "tspan", "$text/svg:tspan[1]";
        const "style" choose {
            when "$text/@style and $tspan/@style" > «$text/@style»;«$tspan/@style»
            otherwise > «$text/@style»«$tspan/@style»

        }
    |         «@inkscape:label»: "«$style»",
    }
    |     },
}