Keep aspect ratio of native resizeable windows?


#1

Is there a standard way to keep the aspect ratio of a native resizeable window like resizing by the ResizableCornerComponent?


#2

Yes, have a look at ComponentBoundsConstrainer::setFixedAspectRatio()


#3

Hi Jules, thanks.

But does not work if set: setUsingNativeTitleBar( true ). Should it? (only tested on KDE yet)


#4

Should work, but haven't tried it myself. Let me know if you find a bug in it.


#5

On Windows & Mac it works as expected, but not on Linux KDE desktop (i can set every ratio i like). I have no GTK linux ready for testing at the moment. Do you have a GTK one ready?


#6

No, I don't have a GTK distro.


#7

Ok, I'll set up one and check this.


#8

Hi, a bit late, but it doesn't work on GTK desktops too. So this is a linux issue (Windows and Mac works).