added check for negative width
added cog button for opening widget dialog