<!--
Description:
  The Library container.
  Left: Preview deck, CoverArt and Tree view (collapsible)
  Right: Tracks table.
-->
<Template>
  <WidgetGroup>
<!-- Finally fixed: library can shrink to noting!
    Solution was to define SizePolicy as 'xx,i'.
    Found this in Deere-2.1 -->
    <ObjectName>Library</ObjectName>
    <SizePolicy>me,i</SizePolicy>
    <Layout>vertical</Layout>
    <Children>

      <WidgetGroup>
        <Size>1me,2f</Size>
        <Connection>
          <ConfigKey persist="true">[Master],maximize_library</ConfigKey>
          <BindProperty>visible</BindProperty>
        </Connection>
      </WidgetGroup>

      <Splitter><!-- Split Tree / Tracks table -->
        <ObjectName>LibrarySplitter</ObjectName>
        <SizePolicy>me,me</SizePolicy>
        <SplitSizes>1,6</SplitSizes>
        <SplitSizesConfigKey>[Tango],splitter__tree_lib</SplitSizesConfigKey>
        <Orientation>horizontal</Orientation>
        <Collapsible>1,0</Collapsible>
        <Children>

          <WidgetGroup><!-- Preview Search Cover Tree -->
            <Layout>vertical</Layout>
            <!-- minSize so that 8 Preview HotCues fit nicely, 23+1px each -->
            <Size>159min,74me</Size>
            <Children>
              <Template src="skin:preview_deck.xml"/>

              <WidgetGroup>
                <Size>1me,5f</Size>
                <Connection>
                  <ConfigKey persist="true">[PreviewDeck],show_previewdeck</ConfigKey>
                  <BindProperty>visible</BindProperty>
                </Connection>
              </WidgetGroup>

              <Splitter><!-- Splitter to make CoverArt resizeable -->
                <ObjectName>LibrarySplitter</ObjectName>
                <SizePolicy>me,me</SizePolicy>
                <SplitSizes>1,3</SplitSizes>
                <SplitSizesConfigKey>[Tango],splitter__coverArt_tree</SplitSizesConfigKey>
                <Orientation>vertical</Orientation>
                <Collapsible>0,0</Collapsible>
                <Children>
                  <WidgetGroup><!-- Preview Deck, Search, Tree View -->
                    <Layout>vertical</Layout>
                    <SizePolicy>me,min</SizePolicy>
                    <Children>
                      <WidgetGroup><!-- Search, Maxi button -->
                        <Layout>horizontal</Layout>
                        <SizePolicy>me,min</SizePolicy>
                        <Children>
                          <SearchBox></SearchBox>
                          <Template src="skin:button_2state_persist.xml">
                            <SetVariable name="ObjectName">LibMiniMaxiButton</SetVariable>
                            <SetVariable name="Size">19f,28f</SetVariable>
                            <SetVariable name="ConfigKey">[Master],maximize_library</SetVariable>
                          </Template>
                        </Children>
                      </WidgetGroup><!-- /Search, Maxi button -->

                      <!-- Tree View -->
                      <LibrarySidebar></LibrarySidebar>
                    </Children>
                  </WidgetGroup><!-- /Preview Deck, Search, Tree View -->

                  <CoverArt>
                    <Size>30min,30min</Size>
                    <Connection>
                      <ConfigKey persist="true">[Library],show_coverart</ConfigKey>
                      <BindProperty>visible</BindProperty>
                    </Connection>
                  </CoverArt>

                </Children>
              </Splitter><!-- /Splitter to make CoverArt resizeable -->
            </Children>
          </WidgetGroup><!-- /Preview Search Cover Tree -->

          <WidgetGroup><!-- Library Table -->
            <Layout>vertical</Layout>
            <Children>
              <Library>
                <BgColor>#585858</BgColor>
                <FgColor>#eece33</FgColor>
              </Library>
            </Children>
          </WidgetGroup><!-- /Library Table -->
        </Children>
      </Splitter><!-- /Split Tree / Tracks table -->

    </Children>
    <Connection>
      <ConfigKey persist="true">[Library],show_library</ConfigKey>
      <BindProperty>visible</BindProperty>
    </Connection>
  </WidgetGroup>
</Template>
