Fix #2528 remove line widgets before adding a new widget

@njx See #2528