From f9ecd54e0a18a642eba008e82f06c9d8f7fc52a8 Mon Sep 17 00:00:00 2001 From: punix Date: Fri, 25 Apr 2025 16:19:36 +0200 Subject: [PATCH] methods back in wirepy as functions "theme dark and light" --- .idea/dictionaries/project.xml | 3 +++ .idea/workspace.xml | 5 +++-- __pycache__/cls_mth_fc.cpython-312.pyc | Bin 23547 -> 21850 bytes cls_mth_fc.py | 27 ---------------------- wirepy.py | 30 +++++++++++++++++++++++-- 5 files changed, 34 insertions(+), 31 deletions(-) create mode 100644 .idea/dictionaries/project.xml 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 67aa271abd0b127f8673e9cbf341b79999c38dc9..a683d9cc65388184f3199ac0095d84e42b10a998 100644 GIT binary patch delta 1400 zcmZvbUrZcT6vp?=?948^Kq{orB3&1DD-5PBubFj6csm4D|sxih+W7C-UWYQ`R#wxW=jrPHqU}~a1kCO6z5#;(HtKsnaAEi z_ZP5$dg6+};#9SOsp&yoGt?ZG1s{d8RxX|eQRo|MQp0&&l89>D6_C|RdTYD33 zxQtTQR{s^MxU;KG{+!|^E;r-3u9=D(6mH?LMO`)S{w=H*o8y&m5R>sbSirgX zuF_>ny+-(kaGe9!DeLiz9Z<2PF;2{ssCKPvn!zks}n>Cj3*i@i8^N|#`i?`$DRhLV@L#N*Rz`W{oZzgd2fc9H*`9cKf{88!?b<0Q2rL$g{+0j6bcB1u7$<0(|HdVc+7O~ zdvsuerD`=rO`*MNFh;`{4O(MsUShi&KUg<$H@j+rWw*`St{VNIb=L$#EruqWz2{A# z*mkptA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r%J3h4d}a1^E@fE&Q#;s`laU6%*kF?sEf8qrMw zD?_ov3WjHs(oHU`YPg$RudWg%s0K$!dCfDZ&v>uqbGGbb(EJAsDGfqlJ#tvl;4V*I zN;rec33tbEG^(gY$>rybiw_70r4e&iC3?;9*0$M@N#yz>*FPYZRq89`<@yJNf5QAz zDh7xnIGXh>ObaQPoT^0EbdyS63TC4raz0pqX33YqU7oMN^lN~t0N;@EJw@oO5#IA} zRO+QEB`E>PSpjh&NVnD8+793#d91M)eQSK(*u|n!QrBEYC-LTaR zQ3{fX%OKh&P?VCH)_eh)0-qp%Y27G12jUCldTUYDY~wV&_h>a^bd-H)4&$Eimj$B0O=1DOuIf9iPC>VR*z#pxzV17J|sCEyImGL lt#TC;wIc^TOrGv|!Fzy36~_-wDig{z2IQr~q;&u0{{p5-;DP`E 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(