def _section_resized(self, log_index, old_size, new_size):
        """ section_resized(horizontal: bool, log_index: int,
                old_size: int, new_size: int) -> None
        Called when a section of of the header is resized
        """
        if not self.fitToWindow or self._target_size is None:
            return

        vis_index = self.visualIndex(log_index)
        if vis_index == self.count() - 1:
            self.resizeSection(log_index, old_size)
            return

        orig_new_size = new_size

        # Can't shrink below minimum size
        if new_size < old_size and new_size < self.MINIMUM_SIZE:
            new_size = self.MINIMUM_SIZE

        if self._target_size is None:
            return

        # Can't take other cells below minimum size
        if new_size > old_size:
            min_right = 0
            for i in xrange(vis_index + 1, self.count()):
                if not self.isSectionHidden(self.logicalIndex(i)):
                    min_right += self.MINIMUM_SIZE
            pos = self.sectionPosition(log_index)
            total_right = self._target_size - pos - new_size
            if total_right < min_right:
                new_size = self._target_size - pos - min_right

        if new_size != orig_new_size:
            self.resizeSection(log_index, new_size)

        # Resize the rows to the right
        self.read_section_sizes()
        self.section_sizes[vis_index] = float(new_size)
        self._resize_right_rows(vis_index + 1)
dataset/ETHPy150Open VisTrails/VisTrails/vistrails/packages/spreadsheet/spreadsheet_sheet.py/StandardWidgetHeaderView._section_resized/original