added code samples; fixed color load bug

This commit is contained in:
2023-10-23 00:00:01 -05:00
parent f3e808b839
commit cd8ed222ae
4 changed files with 146 additions and 21 deletions

View File

@@ -73,18 +73,22 @@ class ListSignalsMixin:
# handle foreground and background colors
if this_style.foreground:
self.fr_color_btn.set_color(Gdk.color_parse(this_style.foreground))
self.fr_color_btn.set_sensitive(True)
self.fr_check_btn.set_active(True)
color = Gdk.color_parse(this_style.foreground)
if color:
self.fr_color_btn.set_color(color)
self.fr_color_btn.set_sensitive(True)
self.fr_check_btn.set_active(True)
else:
self.fr_color_btn.set_color(self.black_color)
self.fr_color_btn.set_sensitive(False)
self.fr_check_btn.set_active(False)
if this_style.background:
self.br_color_btn.set_color(Gdk.color_parse(this_style.background))
self.br_color_btn.set_sensitive(True)
self.br_check_btn.set_active(True)
color = Gdk.color_parse(this_style.background)
if color:
self.br_color_btn.set_color(color)
self.br_color_btn.set_sensitive(True)
self.br_check_btn.set_active(True)
else:
self.br_color_btn.set_color(self.black_color)
self.br_color_btn.set_sensitive(False)