Calculate actual widget content width based on given margins and paddings.

def calculate_width_widget_int(width, border = False, margin = None, margin_left = None, margin_right = None):
        """
        Calculate actual widget content width based on given margins and paddings.
        """
        if margin_left is None:
            margin_left = margin
        if margin_right is None:
            margin_right = margin
        if margin_left is not None:
            width -= int(margin_left)
        if margin_right is not None:
            width -= int(margin_right)
        if border:
            width -= 2
        return width if width > 0 else None