Resizing main window causes components to scale temporarily (Using JUCE 5.01)

gui

#1

Hey there,

My first post here. I searched for a similar question/post for a couple hours and found nothing. At any rate, when I hit the maximize button on my simple app, all components temporarily resize. The resize() function for all components are only called once. Once it maximizes, it looks fine.

See the video of this in action here: ftp://ftp.acoustica.com/Temp/shows-resize-issue2.wmv

In my code, I am using a DocumentWindow. It has three components that resize using the bounds().removeFrom…methods as described in the GUI tutorials.

void MainContentComponent::resized()
{
Rectangle bounds = getBounds();
Rectangle controlBounds = bounds.removeFromRight(300);
Rectangle waveBounds = controlBounds.removeFromBottom(100);

controlPanel.setBounds(controlBounds);
workSpace.setBounds(bounds);
testWaveform.setBounds(waveBounds);
}

Resizing normally has no problem. Any idea on this? Or could this be a bug?


#2

you should use getLocalBounds() not getBounds()


#3

Thanks for the reply, but that does not change anything. The video shows the weird scaling during the maximize. This is on Windows. In addition, when resizing the window by dragging the lower right hand corner, it resizes fine. Only when I maximize does it temporarily show all the components scale up so that the font looks bigger and the graphics looks bigger. I think it could be a bug.


#4

Sounds like it’s just the OS animating the window itself, not anything that juce is drawing. OSX does the same thing, i.e. takes the current window contents, animates it being stretched, then when it’s finished, lets the program draw itself again.


#5

Jules,

Thanks for the reply! Love the SDK. Brilliant to say the least.

However, I’ve been programming Windows software for 17 years and I have never seen a maximize window resize/scale the internal elements like this before. Did you happen to watch the video that was in the original post? It shouldn’t ‘animate’/scale as it maximizes. And, it doesn’t ‘animate’/scale the opposite way when it ‘restores’ to normal size.

My desired behavior would be for nothing to scale during the maximize and only re-position once. The scaling/animation seems to cause a slow down as well. Other windows in Windows do not scale/animate in this way when maximizing.

Again, thanks for your time.

-Joseph


#6

can you post that video to youtube or vimeo (or even facebook)? can’t really play wmv files in the browser natively on os x…


#7

Ok - here is an MP4 of the same video which should work for you. Thank you for checking it out.

ftp://ftp.acoustica.com/Temp/shows-resize-scaling-issue.mp4


#8

Nothing in juce will do any animated scaling when it maximises - if that happens, it’s Windows doing it, and that’s what it looks like to me in your video.