lsp-plugins icon indicating copy to clipboard operation
lsp-plugins copied to clipboard

Add support of combo box items defined in the XML markup of the UI

Open sadko4u opened this issue 1 year ago • 1 comments

Something like this (inspired by HTML):

<select id="value">
  <option text="Text" value="1" (active=":value igt 5") />
</select>

The current element is checking top-down

If the value attribute equals to the value or the active attribute is true, the item is marked as active (current)

If not, the search continues

Some examples

Fixed list:

<combo id="param">
    <option text="Low" value="0" />
    <option text="Medium" value="1" />
    <option text="High" value="2" visibility=":advanced_mode" />
</combo>

Sampling list:

<combo id="param">
    <option text="Low" value="0.5" selected=":value le 1" />
    <option text="Medium" value="1" selected=":value le 2" /> <!-- else-if -->
    <option text="High" value="2" selected="true" /> <!-- else -->
</combo>

sadko4u avatar Dec 23 '23 17:12 sadko4u

Example code snippet:

<combo id="react">
	<option text="Fast" value="0.005" selected=":react le 0.01" />
	<option text="Rapid" value="0.05" selected="(:react gt 0.01) and (:react le 0.1)" />
	<option text="Normal" value="0.2" selected="(:react gt 0.1) and (:react le 0.3)" />
	<option text="Slow" value="0.4" selected="(:react gt 0.3) and (:react le 0.6)" />
	<option text="Slowest" value="0.8" selected=":react gt 0.6" />
</combo>

sadko4u avatar Apr 11 '24 22:04 sadko4u

Available in 1.2.16!

sadko4u avatar May 22 '24 21:05 sadko4u