How to adjust the width of the "module panel"

How to adjust the width of the “module panel” by code?
image

Problem: After some custom widgets were added in the “module panel”, a white space generated beside the “module panel”. how to adjust it by code?

Thank you!