Fix preference button not re-selecting the tab

Made it so when the preferences tab is not selected and the button is pressed again, the tab is reselected.