cleaned up code for setAutoPosition arrow and action toolbar
fixed the m margin of rectFunctionBar