<!--
Description:
  SizeAwareStack / WidgetStack trigger hack that sets controls
  to hide or show the small or big Spinny/CoverArt containers
  depending on
  1)  if Spinny and/or Cover Art are selected at all
  2)  if so ^ also checks if big spinny/cover is selected

  If none is visible the spinny/cover container is hidden.

Controls:
  [LateNight],show_small_spinny_cover
  [LateNight],show_big_spinny_cover

-->
<Template>
  <WidgetGroup>
    <Layout>vertical</Layout>
    <Size>,0f</Size>
    <Children>

      <WidgetGroup>
        <Layout>horizontal</Layout>
        <Size>2f,0f</Size>
        <Children>

          <WidgetGroup>
            <Size>1f,0f</Size>
            <Connection>
              <ConfigKey persist="true">[Skin],show_spinnies</ConfigKey>
              <Transform><Not/></Transform>
              <BindProperty>visible</BindProperty>
            </Connection>
          </WidgetGroup>

          <WidgetGroup>
            <Size>1f,0f</Size>
            <Connection>
              <ConfigKey persist="true">[Skin],show_coverart</ConfigKey>
              <Transform><Not/></Transform>
              <BindProperty>visible</BindProperty>
            </Connection>
          </WidgetGroup>

          <SizeAwareStack>
            <Children>
              <WidgetStack>
                <SizePolicy>me,f</SizePolicy>
                <MaximumSize>0,0</MaximumSize>
                <Children>
                  <WidgetGroup trigger="[LateNight],no_spinny_no_cover"><Size>1f,0f</Size></WidgetGroup>
                  <WidgetGroup trigger="[LateNight],show_spinny_cover"><Size>1f,0f</Size></WidgetGroup>
                </Children>
              </WidgetStack>

              <WidgetStack>
                <SizePolicy>me,f</SizePolicy>
                <MinimumSize>1,0</MinimumSize>
                <MaximumSize>-1,0</MaximumSize>
                <Children>
                  <WidgetGroup trigger="[LateNight],show_spinny_cover"><Size>1f,0f</Size></WidgetGroup>
                  <WidgetGroup trigger="[LateNight],no_spinny_no_cover"><Size>1f,0f</Size></WidgetGroup>
                </Children>
              </WidgetStack>

            </Children>
          </SizeAwareStack>

        </Children>
      </WidgetGroup>

      <WidgetGroup>
        <Layout>horizontal</Layout>
        <Size>3f,0f</Size>
        <Children>

          <WidgetGroup>
            <Size>2f,0f</Size>
            <Connection>
              <ConfigKey>[LateNight],show_spinny_cover</ConfigKey>
              <Transform><Not/></Transform>
              <BindProperty>visible</BindProperty>
            </Connection>
          </WidgetGroup>

          <WidgetGroup>
            <Size>1f,0f</Size>
            <Connection>
              <ConfigKey persist="true">[Skin],select_big_spinny_coverart</ConfigKey>
              <Transform><Not/></Transform>
              <BindProperty>visible</BindProperty>
            </Connection>
          </WidgetGroup>

          <SizeAwareStack>
            <Children>
              <!-- Hide small and big spinny/cover container -->
              <WidgetStack>
                <SizePolicy>me,f</SizePolicy>
                <MinimumSize>0,0</MinimumSize>
                <MaximumSize>1,0</MaximumSize>
                <Children>
                  <WidgetGroup><Size>1f,0f</Size></WidgetGroup>
                  <WidgetGroup trigger="[LateNight],show_small_spinny_cover"><Size>0f,0f</Size></WidgetGroup>
                  <WidgetGroup trigger="[LateNight],show_big_spinny_cover"><Size>0f,0f</Size></WidgetGroup>
                </Children>
              </WidgetStack>

              <!-- Show small spinny/cover container,
                    hide big spinny/cover container -->
              <WidgetStack>
                <SizePolicy>me,f</SizePolicy>
                <MinimumSize>2,0</MinimumSize>
                <MaximumSize>2,0</MaximumSize>
                <Children>
                  <WidgetGroup trigger="[LateNight],show_small_spinny_cover"><Size>0f,0f</Size></WidgetGroup>
                  <WidgetGroup trigger="[LateNight],show_big_spinny_cover"><Size>0f,0f</Size></WidgetGroup>
                </Children>
              </WidgetStack>

              <!-- Show big spinny/cover container,
                    hide small spinny/cover container -->
              <WidgetStack>
                <SizePolicy>me,f</SizePolicy>
                <MinimumSize>3,0</MinimumSize>
                <MaximumSize>3,0</MaximumSize>
                <Children>
                  <WidgetGroup trigger="[LateNight],show_big_spinny_cover"><Size>0f,0f</Size></WidgetGroup>
                  <WidgetGroup trigger="[LateNight],show_small_spinny_cover"><Size>10,0f</Size></WidgetGroup>
                </Children>
              </WidgetStack>

            </Children>
          </SizeAwareStack>

        </Children>
      </WidgetGroup>

    </Children>
  </WidgetGroup>
</Template>
