Add header_action method for panels

Rough implementation that seems to work. No tests yet, but wanted to open #2552 for discussion over actual code.