diff --git a/.idea/dictionaries/project.xml b/.idea/dictionaries/project.xml new file mode 100644 index 0000000..4787784 --- /dev/null +++ b/.idea/dictionaries/project.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 3a30f82..71a1f4b 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -5,7 +5,8 @@ - + + diff --git a/__pycache__/cls_mth_fc.cpython-312.pyc b/__pycache__/cls_mth_fc.cpython-312.pyc index 67aa271..a683d9c 100644 Binary files a/__pycache__/cls_mth_fc.cpython-312.pyc and b/__pycache__/cls_mth_fc.cpython-312.pyc differ diff --git a/cls_mth_fc.py b/cls_mth_fc.py index 9c0997d..8debe1f 100755 --- a/cls_mth_fc.py +++ b/cls_mth_fc.py @@ -136,32 +136,6 @@ class LxTools(tk.Tk): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) - def theme_change_light(self, file=None): - """ - Set light theme - """ - if self.tk.call("ttk::style", "theme", "use") == "water-dark": - self.tk.call("set_theme", "light") - with open(file, "r", encoding="utf-8") as theme_set2: - lines3 = theme_set2.readlines() - lines3[3] = "light\n" - with open(file, "w", encoding="utf-8") as theme_set2: - theme_set2.writelines(lines3) - self.color_label() - - def theme_change_dark(self, file=None): - """ - Set dark theme - """ - if not self.tk.call("ttk::style", "theme", "use") == "water-dark": - self.tk.call("set_theme", "dark") - with open(file, "r", encoding="utf-8") as theme_set2: - lines4 = theme_set2.readlines() - lines4[3] = "dark\n" - with open(file, "w", encoding="utf-8") as theme_set2: - theme_set2.writelines(lines4) - self.color_label() - @staticmethod def uos(): """ @@ -282,7 +256,6 @@ class LxTools(tk.Tk): signal.signal(signal.SIGTERM, signal_handler) signal.signal(signal.SIGHUP, signal_handler) - class GiteaUpdate: """ Calling download requests the download URL of the running script, diff --git a/wirepy.py b/wirepy.py index 7cd4cae..eca364f 100755 --- a/wirepy.py +++ b/wirepy.py @@ -133,6 +133,32 @@ class FrameWidgets(ttk.Frame): with open(set_file, "w", encoding="utf-8") as set_f2: set_f2.writelines(lines2) + def theme_change_light(): + """ + Set light theme + """ + if self.tk.call("ttk::style", "theme", "use") == "water-dark": + self.tk.call("set_theme", "light") + with open(set_file, "r", encoding="utf-8") as theme_set2: + lines3 = theme_set2.readlines() + lines3[3] = "light\n" + with open(set_file, "w", encoding="utf-8") as theme_set2: + theme_set2.writelines(lines3) + self.color_label() + + def theme_change_dark(): + """ + Set dark theme + """ + if not self.tk.call("ttk::style", "theme", "use") == "water-dark": + self.tk.call("set_theme", "dark") + with open(set_file, "r", encoding="utf-8") as theme_set2: + lines4 = theme_set2.readlines() + lines4[3] = "dark\n" + with open(set_file, "w", encoding="utf-8") as theme_set2: + theme_set2.writelines(lines4) + self.color_label() + def tooltip(): """ Set True or False in file @@ -197,8 +223,8 @@ class FrameWidgets(ttk.Frame): self.settings.add_checkbutton( label=_("Disable Tooltips"), command=tooltip, variable=set_tip ) - self.settings.add_command(label=_("Light"), command=lambda: LxTools.theme_change_light(self, set_file)) - self.settings.add_command(label=_("Dark"), command=lambda: LxTools.theme_change_dark(self, set_file)) + self.settings.add_command(label=_("Light"), command=theme_change_light) + self.settings.add_command(label=_("Dark"), command=theme_change_dark) # About BTN Menu / Label self.about_btn = ttk.Button(