Making a PluginToolbarButton deactivate

I’m trying to figure out how to ‘deactivate’ a plugin toolbar button, when I click the button to make the widget come up, and then press the X button on the widget, the toolbar button is still highlighted. I found a hacky solution to this but I’m not sure if it’s the best practice.

Button.Enabled = false
Button.Enabled = true

This basically makes the button unclickable and then clickable again, setting the button to the original state. I’m looking for a better way of ‘deactivating’ the plugin toolbar button.