Inititalize disabled color when creating label and disabled (#7527)

This commit is contained in:
matham 2021-05-22 17:38:11 -04:00 committed by GitHub
parent 28bfe768d8
commit e10ef1a11c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -341,8 +341,12 @@ class Label(Widget):
if (markup and cls is not CoreMarkupLabel) or \
(not markup and cls is not CoreLabel):
# markup have change, we need to change our rendering method.
d = Label._font_properties
dkw = dict(list(zip(d, [getattr(self, x) for x in d])))
dkw = {x: getattr(self, x) for x in self._font_properties}
dkw['usersize'] = self.text_size
if self.disabled:
dkw['color'] = self.disabled_color
dkw['outline_color'] = self.disabled_outline_color
if markup:
self._label = CoreMarkupLabel(**dkw)
else: