Skip to content

Commit

Permalink
Fix AttributeError
Browse files Browse the repository at this point in the history
'ThemeManager' object has no attribute 'schemes_name_colors'`
  • Loading branch information
HeaTTheatR committed Jan 30, 2024
1 parent 80608dd commit b7c9d8d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
7 changes: 3 additions & 4 deletions examples/dynamic_color_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,11 @@ def theme_switch(self) -> None:

def generate_cards(self, *args):
self.root.ids.card_list.data = []
for color in self.theme_cls.schemes_name_colors:
value = f"{color}Color"
for name_color in self.theme_cls.current_schemes_color_data:
self.root.ids.card_list.data.append(
{
"bg_color": getattr(self.theme_cls, value),
"text": value,
"bg_color": getattr(self.theme_cls, name_color),
"text": name_color,
}
)

Expand Down
8 changes: 3 additions & 5 deletions examples/dynamic_color_schemes.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
MDScreen:
md_bg_color: app.theme_cls.backgroundColor
MDIconButton:
on_release: app.open_menu(self)
Expand Down Expand Up @@ -120,12 +119,11 @@ def theme_switch(self) -> None:

def generate_cards(self, *args):
self.root.ids.card_list.data = []
for color in self.theme_cls.schemes_name_colors:
value = f"{color}Color"
for name_color in self.theme_cls.current_schemes_color_data:
self.root.ids.card_list.data.append(
{
"bg_color": getattr(self.theme_cls, value),
"text": value,
"bg_color": getattr(self.theme_cls, name_color),
"text": name_color,
}
)

Expand Down

0 comments on commit b7c9d8d

Please sign in to comment.