methods back in wirepy as functions "theme dark and light"
This commit is contained in:
parent
67ff24f0b6
commit
f9ecd54e0a
3
.idea/dictionaries/project.xml
generated
Normal file
3
.idea/dictionaries/project.xml
generated
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
<component name="ProjectDictionaryState">
|
||||||
|
<dictionary name="project" />
|
||||||
|
</component>
|
5
.idea/workspace.xml
generated
5
.idea/workspace.xml
generated
@ -5,7 +5,8 @@
|
|||||||
</component>
|
</component>
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="940e1630-c825-4d4c-be80-bc11f543c122" name="Changes" comment=" - Update Translate Files">
|
<list default="true" id="940e1630-c825-4d4c-be80-bc11f543c122" name="Changes" comment=" - Update Translate Files">
|
||||||
<change beforePath="$PROJECT_DIR$/wirepy.py" beforeDir="false" afterPath="$PROJECT_DIR$/wirepy.py" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/cls_mth_fc.py" beforeDir="false" afterPath="$PROJECT_DIR$/cls_mth_fc.py" afterDir="false" />
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
@ -60,7 +61,7 @@
|
|||||||
"Shell Script.run_as.executor": "Run",
|
"Shell Script.run_as.executor": "Run",
|
||||||
"git-widget-placeholder": "21-04-2025-new-tooltip",
|
"git-widget-placeholder": "21-04-2025-new-tooltip",
|
||||||
"last_opened_file_path": "/home/punix/Pyapps/wire-py",
|
"last_opened_file_path": "/home/punix/Pyapps/wire-py",
|
||||||
"settings.editor.selected.configurable": "reference.settingsdialog.IDE.editor.colors"
|
"settings.editor.selected.configurable": "ml.llm.LLMConfigurable"
|
||||||
}
|
}
|
||||||
}]]></component>
|
}]]></component>
|
||||||
<component name="RecentsManager">
|
<component name="RecentsManager">
|
||||||
|
Binary file not shown.
@ -136,32 +136,6 @@ class LxTools(tk.Tk):
|
|||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super().__init__(*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
|
@staticmethod
|
||||||
def uos():
|
def uos():
|
||||||
"""
|
"""
|
||||||
@ -282,7 +256,6 @@ class LxTools(tk.Tk):
|
|||||||
signal.signal(signal.SIGTERM, signal_handler)
|
signal.signal(signal.SIGTERM, signal_handler)
|
||||||
signal.signal(signal.SIGHUP, signal_handler)
|
signal.signal(signal.SIGHUP, signal_handler)
|
||||||
|
|
||||||
|
|
||||||
class GiteaUpdate:
|
class GiteaUpdate:
|
||||||
"""
|
"""
|
||||||
Calling download requests the download URL of the running script,
|
Calling download requests the download URL of the running script,
|
||||||
|
30
wirepy.py
30
wirepy.py
@ -133,6 +133,32 @@ class FrameWidgets(ttk.Frame):
|
|||||||
with open(set_file, "w", encoding="utf-8") as set_f2:
|
with open(set_file, "w", encoding="utf-8") as set_f2:
|
||||||
set_f2.writelines(lines2)
|
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():
|
def tooltip():
|
||||||
"""
|
"""
|
||||||
Set True or False in file
|
Set True or False in file
|
||||||
@ -197,8 +223,8 @@ class FrameWidgets(ttk.Frame):
|
|||||||
self.settings.add_checkbutton(
|
self.settings.add_checkbutton(
|
||||||
label=_("Disable Tooltips"), command=tooltip, variable=set_tip
|
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=_("Light"), command=theme_change_light)
|
||||||
self.settings.add_command(label=_("Dark"), command=lambda: LxTools.theme_change_dark(self, set_file))
|
self.settings.add_command(label=_("Dark"), command=theme_change_dark)
|
||||||
|
|
||||||
# About BTN Menu / Label
|
# About BTN Menu / Label
|
||||||
self.about_btn = ttk.Button(
|
self.about_btn = ttk.Button(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user