Changing the maximise button image

I like having a maximise button, but I don’t really want my app going over its resize limit of 1024x640, so I added this to my DocumentWindow:

void maximiseButtonPressed() { if( maximized ) { setSize( oldWidth, oldHeight ); setTopLeftPosition( getX() + ( 1024 - oldWidth ) / 2, getY() ); } else { oldWidth = getWidth(); oldHeight = getHeight(); setSize( 1024, 640 ); setTopLeftPosition( getX() + ( oldWidth - 1024 ) / 2, getY() ); } maximized ^= 1; resized(); }

And it all works fine, except the image for the maximise button doesn’t change like it would normally. I tried digging through the code of what ResizableWindow::setFullScreen() is doing, but I still can’t figure out what’s changing the look of the button, and it doesn’t look like the buttons themselves are being stored as ImageButton components. I really don’t know what’s going on…