GSOC Day 25 – FoldPanelBar Resizing
After getting the basic collapsible panels to display yesterday, I had to make them resize correctly. This turned out to be a rather difficult task.
At the beginning of the day, if I resized the panel, the internal contents would then remain at the maximum size they’d reached permanently, so I’d be unable to return the panel to its former size without scrolling to see things. I wanted the contents to shrink again as long as they could still display in full, then start scrolling.
I first was able to remove the horizontal scrollbar, then I managed to get the internal width to decrease so that the FoldPanels would shrink horizontally to fit inside the window.
Then I realized that I had been creating multiple FoldPanelBars, when really I needed to create one FoldPanelBar with a number of FoldPanels inside of it. After doing so, they collapsed properly rather than staying the same size with the contents hidden.
However, this still left the problem of vertical resizing – the FoldPanelBar still took up as much space as it could vertically, without shrinking to fit the window as much as possible. Finally, I found a function in the FoldPanelBar class that told me the exact height of its contents, and I was able to use that to shrink it appropriately.
This still all only worked on resize, however, not when the FoldPanel was collapsed or expanded. So with one last event hook, I fixed that.
Tomorrow, I’ll work on making different types of FoldPanels to hold different content information.