I’m trying to use setResizeLimits on a DocumentWindow to constraint the size of the component inside to a minimum value.
If my inside component width and height are W and H, then I would have though that
Unfortunately this do not work with windows with native title bar
On Windows I must add 8 to the width and 27 to the height.
On Mac I should add some too but not the same values.
Any idea what’s wrong ?
(I’m using the tip by the way)
That does look like it should work… Did you check the value that getBorderSize returns? Maybe you’re calling this before the window is on-screen, so it doesn’t yet have a way of measuring the frame thickness?
Sorry, I wasn’t thinking straight - neither of those actually gets the native frame, they just deal with the border that the ResizableWindow class should draw. You can get the native decoration size by calling getPeer()->getFrameSize().
You still need to call it outside of the ctor though otherwise you have 2 pixels off for width and height on Windows.(works fine on mac)
So far I use parentHierarchyChanged because I was not able to find a better place to put it.