aboutsummaryrefslogtreecommitdiff
path: root/src/texty.py
diff options
context:
space:
mode:
authorBobby <[email protected]>2022-11-06 10:12:55 -0500
committerBobby <[email protected]>2022-11-06 10:12:55 -0500
commitafb29a0c8325ace3eccc53ff2bd5a41004dc1fd6 (patch)
treeff09521a8d48d30ade590fc2c67131bcbee8f296 /src/texty.py
parent54cac2ebde7369400816c5f118b6dc7210dceb6d (diff)
downloadtexty-afb29a0c8325ace3eccc53ff2bd5a41004dc1fd6.tar.xz
texty-afb29a0c8325ace3eccc53ff2bd5a41004dc1fd6.zip
feat: basic text editor with toolbar
Diffstat (limited to 'src/texty.py')
-rw-r--r--src/texty.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/texty.py b/src/texty.py
index a8c92b1..35347f5 100644
--- a/src/texty.py
+++ b/src/texty.py
@@ -7,6 +7,7 @@ import sys
import tkinter as tk
import click
+import darkdetect
from config.defaults import DEFAULT_PREFS, KEYBINDS, MAC_KEYBINDS, PREFERENCES_FILE
from helpers.managers import FileManager, PreferenceManager
@@ -18,7 +19,7 @@ class Texty(tk.Tk):
super().__init__()
self.title("Texty")
self.debug = debug
- self.prefs = PreferenceManager(DEFAULT_PREFS, PREFERENCES_FILE)
+ self.prefs = PreferenceManager(DEFAULT_PREFS, PREFERENCES_FILE, debug=debug)
self.fm = FileManager()
self.system = self.call("tk", "windowingsystem")
self.log(
@@ -26,6 +27,10 @@ class Texty(tk.Tk):
self.system, sys.platform
)
)
+ if self.prefs.get("theme") == "system":
+ self.theme = "dark" if darkdetect.isDark() else "light"
+ else:
+ self.theme = self.prefs.get("theme")
self.windows = 0
self.withdraw()
self.create_window()