can swap to search and button line

-------------------------------------------------------------------------------
optimized code
some bug fixes and improvements