Skip to content

Commit

Permalink
Merge pull request #16 from Thisal-D/Thisal-D-patch-1
Browse files Browse the repository at this point in the history
fix Theme Manager issue
  • Loading branch information
Thisal-D authored Nov 29, 2024
2 parents 731c78b + c5e609f commit ff21ba4
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/ctkchart/CTkLineChart.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,6 @@ def __init__(
pointer_size: int = 1,

*args: Any) -> None:
"""
Initialize Theme manager
"""
ThemeManager.bind_widget(self)
if ThemeManager.running_state is not True:
ThemeManager.run()

"""
Initialize the CTkLineChart.
Expand Down Expand Up @@ -269,6 +263,16 @@ def __init__(
self.__place_widgets()
self.__reset_chart_info()
self.__configure_theme_mode()
self.__configure_theme_management()

def __configure_theme_management(self):
"""
Initialize Theme manager (if not already initialized)and bind the widget to it
"""

ThemeManager.bind_widget(self)
if ThemeManager.running_state is not True:
ThemeManager.run()

def __configure_theme_mode(self) -> None:
"""
Expand Down Expand Up @@ -325,6 +329,7 @@ def __set_tkinter_widgets_colors(self):
This method adjusts the background colors of various Tkinter widgets based on the current theme.
"""

self.__y_axis_frame.configure(bg=ThemeManager.get_color_by_theme(self.__axis_color))
self.__x_axis_frame.configure(bg=ThemeManager.get_color_by_theme(self.__axis_color))
self.__output_canvas.configure(bg=ThemeManager.get_color_by_theme(self.__fg_color))
Expand Down

0 comments on commit ff21ba4

Please sign in to comment.