<!--
Description:
  An effect parameter button.
  Stacked layout of invisible button, parameter name
  and button display underneath.
Variables:
  FxRack     : rack number
  FxUnit     : unit number
  FxRack_FxUnit_FxNum : EffectRack1_EffectUnitX_EffectY
  FxNum         : effect number
  parameter     : the parameter
-->
<Template>
  <SetVariable name="FxRack_FxUnit_FxNum">[<Variable name="FxRack_FxUnit"/>_Effect<Variable name="FxNum"/>]</SetVariable>

  <WidgetGroup>
    <Layout>stacked</Layout>
    <ObjectName>FxParameterButton</ObjectName>
  <!-- working around disrespected AlignVCenter when Connection is applied. -->
    <Size>52f,26f</Size>
    <Children>
      <!-- Actual button, invisible except hover border -->
      <Template src="skin:../Tango/fx/button.xml">
        <SetVariable name="ObjectName">FxParameterButtonOverlay</SetVariable>
        <SetVariable name="Size">51f,18f</SetVariable>
        <SetVariable name="FxParameter">button_parameter<Variable name="FxParameter"/></SetVariable>
      </Template>

      <!-- Name of effect parameter when inactive-->
      <EffectButtonParameterName>
        <Size>51f,18f</Size>
        <ObjectName>FxParameterButtonName</ObjectName>
        <EffectRack><Variable name="FxRack"/></EffectRack>
        <EffectUnit><Variable name="FxUnit"/></EffectUnit>
        <Effect><Variable name="FxNum"/></Effect>
        <EffectButtonParameter><Variable name="FxParameter"/></EffectButtonParameter>
        <Alignment>center</Alignment>
        <Elide>right</Elide>
        <Connection>
          <ConfigKey><Variable name="FxRack_FxUnit_FxNum"/>,button_parameter<Variable name="FxParameter"/></ConfigKey>
          <BindProperty>highlight</BindProperty>
        </Connection>
      </EffectButtonParameterName>

      <!-- Button to indicate parameter state -->
      <Template src="skin:../Tango/fx/button.xml">
        <SetVariable name="ObjectName">FxParameterButtonUnderlay</SetVariable>
        <SetVariable name="Size">51f,18f</SetVariable>
        <SetVariable name="FxParameter">button_parameter<Variable name="FxParameter"/></SetVariable>
      </Template>
    </Children>
    <!-- show only if button parameter is loaded -->
    <Connection>
      <ConfigKey><Variable name="FxRack_FxUnit_FxNum"/>,button_parameter<Variable name="FxParameter"/>_loaded</ConfigKey>
      <BindProperty>visible</BindProperty>
    </Connection>
  </WidgetGroup>
</Template>
