a) Go to the screen/track/item sets window (the good old "screensets window").
b) Click on the "Layouts" tab.
c) Double-click on "Action #1" and choose "Selected mixer panel" or "Selected track panel" and then choose the empty item in the drop-list which corresponds to the "default layout" (if you use it as your default, that is).
d) Now double-click on "Action #2" and choose "Selected mixer panel" or "Selected track panel" (this depends on what you chose on step c), then choose the layout you'd want to "switch to". In this case I used "Selected mixer panel" and "Sidebar".
e) OK, now the fun. You'll need SWS extensions for this. Go to the "Extensions" menu and click on "Cycle Action editor...". This will show you a window like this:
f) Right-click on the left window to add a new cycle action and give it a name. In this case I chose "Cycle Default-Sidebar Layouts in MCP". Then, right-click on the right window to add the actions (I did it with "Add/learn from 'Actions' window" but you need the Actions List opened to make this work since it will "grab" the actions from there). I added "Layout: apply custom layout #01" and "Layout: apply custom layout #02", see here:
g) Now, to make this "cycling" between actions work you have to add a command and put it between these two actions we just added, like this:
h) Now click on apply and go the Actions List. Search for your new action and verify it was successfully created:
i) Ok, good, now go to Options/Preferences/Editing behavior/Mouse Modifiers and choose the right context for your new action. In this case I chose "Mixer Control Panel". I just added my new action to the default action there...
and voila!