Improved button logic

When switching view, buttons deactivate properly; also fixed
mouse-dragging glitch