You may like to change the layout and behaviour of your sidebar gadget in docked and floating style. This could be easily done, by handling two events that are fired when docked/undocked. onDock and onUndock are triggered in the case that a Gadget is