def on_margins_changed(self, v): if isinstance(v, int): self.left_margin = self.right_margin = \ self.top_margin = self.bottom_margin = const(v) else: v = (list(v) + [0, 0, 0, 0])[:4] self.left_margin, self.top_margin, \ self.right_margin, self.bottom_margin = consts(*v)
def on_vertical_center_changed(self, v): if v: self.top = self.bottom = const('')
def on_horizontal_center_changed(self, v): if v: self.left = self.right = const('')
def on_center_changed(self, v): self.fill = self.left = self.right = self.top = self.bottom = const('')
def on_bottom_changed(self, v): if self.fill != v: self.fill = const('') if v: self.center = const('')
def on_right_changed(self, v): if self.fill != v: self.fill = const('') if v: self.center = const('')
def on_fill_changed(self, v): self.left = self.right = self.top = self.bottom = const(v) self.center = ''