def METHOD_NAME(self):
    max_text_item_width = max(
        self._header_text_item.boundingRect().width(),
        self._instruction_text_item.boundingRect().width(),
    )
    self._width = self.HORIZONTAL_PADDING * 2 + max_text_item_width
    self._height = self.VERTICAL_PADDING * 2 + self._y_off
    self._width = max(30, self._width)
    self._height = max(10, self._height)
    self.recalculate_size()