Install an event filter to intercept mouse events coming to the buttons and react on them to perform resizing.