<!--
Description:
  The Library container.
  Left: Preview deck, CoverArt and Tree view (collapsible)
  Right: Tracks table.
-->
<Template>
<!-- This additional wrapper is necessary for being able to address
    QMenus in QTableView, QTreeView etc. at once with #LibraryContainer QMenu
    like in LateNight. Go figure... -->
  <WidgetGroup>
<!-- Finally fixed: library can shrink to noting!
    Solution was to define SizePolicy as 'xx,i'.
    Found this in Deere-2.1 -->
    <SizePolicy>me,i</SizePolicy>
    <Layout>vertical</Layout>
    <Children>
      <WidgetGroup>
        <ObjectName>LibraryContainer</ObjectName>
        <SizePolicy>me,me</SizePolicy>
        <Layout>vertical</Layout>
        <Children>

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

          <Splitter><!-- Split Tree / Tracks table -->
            <ObjectName>LibrarySplitter</ObjectName>
            <SizePolicy>me,me</SizePolicy>
            <SplitSizes>1,6</SplitSizes>
            <SplitSizesConfigKey>[Skin],librarySidebar_splitsize</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="skins:Tango/decks/preview_deck.xml"/>

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

                  <Splitter><!-- Splitter to make CoverArt resizable -->
                    <ObjectName>LibrarySplitter</ObjectName>
                    <SizePolicy>me,me</SizePolicy>
                    <SplitSizes>1,3</SplitSizes>
                    <SplitSizesConfigKey>[Skin],coverArt_splitsize</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 -->
                            <ObjectName>SearchBoxContainer</ObjectName>
                            <Layout>horizontal</Layout>
                            <SizePolicy>me,min</SizePolicy>
                            <Children>

                              <SearchBox></SearchBox>

                              <!-- Align the expand buttontop in case the searchbox grows taller -->
                              <WidgetGroup>
                                <ObjectName>AlignTop</ObjectName>
                                <Layout>horizontal</Layout>
                                <Size>19f,15min</Size>
                                <Children>
                                  <Template src="skins:Tango/controls/button_2state_persist.xml">
                                    <SetVariable name="ObjectName">LibMiniMaxiButton</SetVariable>
                                    <SetVariable name="Size">19f,15f</SetVariable>
                                    <SetVariable name="ConfigKey">[Skin],show_maximized_library</SetVariable>
                                  </Template>
                                </Children>
                              </WidgetGroup>

                            </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">[Skin],show_library_coverart</ConfigKey>
                          <BindProperty>visible</BindProperty>
                        </Connection>
                      </CoverArt>

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

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

        </Children>
      </WidgetGroup>
    </Children>
  </WidgetGroup><!-- extra wrapper -->
</Template>
