So I was playing around with the new windowsize function and button stacking. I thought I'd post some code to show others how to use it. Here is a layout that will create three vertical panels stacked vertically, there are toggle buttons for the top and bottom panels as well as buttons to change the "tab" of the middle panel. The entire foobar window and center panel will resize when the top and bottom panels are added or removed:
$drawrect(0,0,0,0,brushcolor-233-233-233 pencolor-null)
$panel(Menu,Menu,0,0,%_width%,20,)
$ifgreater($getpvar(toppanel.hide),0,,
$panel(Now Playing,Track Display,5,20,$sub(%_width%,10),140,)
)
$puts(mainpanel.y,$add(20,$ifgreater($getpvar(toppanel.hide),0,,145)))
$puts(mainpanel.height,$sub(%_height%,$add(55,$ifgreater($getpvar(toppanel.hide),0,0,140),$ifgreater($getpvar(bottompanel.hide),0,0,50))))
$select($add($getpvar(mainpanel.mode),1),
$panel(Lists,Playlists Dropdown,0,$get(mainpanel.y),150,20,)
$panel(Order,Playback order,150,$get(mainpanel.y),120,20,)
$panel(Search,Quick Search Toolbar,270,$get(mainpanel.y),$sub(%_width%,270),20,)
$panel(Playlist,Single Column Playlist,0,$add($get(mainpanel.y),20),%_width%,$sub($get(mainpanel.height),20),)
,
$panel(Test,Track Display,0,$get(mainpanel.y),%_width%,$get(mainpanel.height),)
,
$panel(Queue,Queue Manager,0,$get(mainpanel.y),%_width%,$get(mainpanel.height),)
,
$panel(Albums,Album list,0,$get(mainpanel.y),%_width%,$get(mainpanel.height),)
,
$panel(Lyrics,Lyric Show,0,$get(mainpanel.y),%_width%,$get(mainpanel.height),)
,
$panel(Console,Console,0,$get(mainpanel.y),%_width%,$get(mainpanel.height),)
)
$ifgreater($getpvar(bottompanel.hide),0,,
$panel(Egoh,Egoh Spectrum analyser,5,$sub(%_height%,75),$sub(%_width%,10),45,)
)
$panel(Progress,Seekbar,0,$sub(%_height%,30),%_width%,14,)
// Buttons //
$puts(offset.button.x,0)
$puts(offset.button.y,$sub(%_height%,15))
$button2($add($get(offset.button.x),2),$get(offset.button.y),0,0,14,14,,,WINDOWSIZE:%_width%:$ifgreater($getpvar(toppanel.hide),0,$add(%_height%,145),$sub(%_height%,145)),)
$button2($add($get(offset.button.x),2),$get(offset.button.y),0,0,14,14,A,x,PVAR:SET:toppanel.hide:$ifgreater($getpvar(toppanel.hide),0,0,1),)
$button2($add($get(offset.button.x),16),$get(offset.button.y),0,0,14,14,,,WINDOWSIZE:%_width%:$ifgreater($getpvar(bottompanel.hide),0,$add(%_height%,50),$sub(%_height%,50)),)
$button2($add($get(offset.button.x),16),$get(offset.button.y),0,0,14,14,B,x,PVAR:SET:bottompanel.hide:$ifgreater($getpvar(bottompanel.hide),0,0,1),)
$puts(offset.button.x,%_width%)
$puts(offset.button.y,$sub(%_height%,15))
$button2($sub($get(offset.button.x),86),$get(offset.button.y),0,0,14,14,0,x,'PVAR:SET:mainpanel.mode:0',)
$button2($sub($get(offset.button.x),72),$get(offset.button.y),0,0,14,14,1,x,'PVAR:SET:mainpanel.mode:1',)
$button2($sub($get(offset.button.x),58),$get(offset.button.y),0,0,14,14,2,x,'PVAR:SET:mainpanel.mode:2',)
$button2($sub($get(offset.button.x),44),$get(offset.button.y),0,0,14,14,3,x,'PVAR:SET:mainpanel.mode:3',)
$button2($sub($get(offset.button.x),32),$get(offset.button.y),0,0,14,14,4,x,'PVAR:SET:mainpanel.mode:4',)
$button2($sub($get(offset.button.x),16),$get(offset.button.y),0,0,14,14,5,x,'PVAR:SET:mainpanel.mode:5',)